Hi everyone, I'm currently struggling with using `client.get` and `client.set` in custom managed com

Hi everyone, I'm currently struggling with using client.get and client.set in custom managed components. I'm 99% certain that my code worked before, but after checking today, it's not behaving like I expected it to. Shouldn't the following code log the value the second time I visit the page? I have enabled the "Access client key-value store" permission for this component.
manager.addEventListener('pageview', event => {
const { client } = event
const id = client.get('someId')
console.log('id', id)
if (!id) {
client.set('someId', '4711')
}
})
manager.addEventListener('pageview', event => {
const { client } = event
const id = client.get('someId')
console.log('id', id)
if (!id) {
client.set('someId', '4711')
}
})
17 Replies
ItsTobias
ItsTobias•3mo ago
yo'av, I know this isnt Zaraz related but it is somewhat related to Cloudflare Analytics and I know that you are looking into making improvements to that area of CF. We have been encountering some issues very recently on our Google Merchant Center and Google Search console intermittently marking pages as "website down"/5xx error Unfortunately Google gives very little information as to what is going on. I was able to identify that Google had encountered a 503 error which was interesting. When I started looking into the Analytics in Cloudflare I encountered the attached image which is obviously concerning. I pulled everything about the request apart, assuming that something had gone wrong with our application servers or our AWS load balancers which was causing nearly 1% of our page requests to return a 503 It was only after working through this for a few hours that I remembered that I had tweaked some settings in Cloudflare on Monday and looked into whether they could have been at fault. Long story short, I had enabled Speed Brain. I should have remembered that Speed Brain uses the 503 response code to indicate a failed cache pull. Unfortunately this means though that genuine 503 errors are getting absolutely swamped by a huge influx of Speed Brain related 503 errors in the analytics. With Speed Brain enabled it is completely impossible to get an accurate rate of 503 errors which have been caused by non Speed Brain related issues. I know the blog post justifies the use of 503 to prevent incompatibilities with services which have not had support enabled for speculative requests but this seems like a pretty major downside. On top of that, It does appear that 503's related to Speed Brains cache lookup failures are leaking and being interpreted by services which should not be interpreting them that way. Mainly Google Mrchant Center and Search Console (and possibly other tools) are somehow encountering these responses and disabling shopping listings/ads/search results
No description
Zvonimir Adriatic.hr
Zvonimir Adriatic.hr•3mo ago
Hi community I am new here and i need help regarding Zaraz Consent Mode, i set up everything including translations, turned modal on but it is always in EN. I belive that is because zaraz reads browsers lang and sets that lang to use. I have a website with multylang support like this: www.adriatic.hr/en ... /de ... /hr ... /hu etc and defined lang in <html>. So how do i tell zaraz what language to use? (i posted in general help but then i saw this channel)
Unknown User
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
Zvonimir Adriatic.hr
Zvonimir Adriatic.hr•3mo ago
so only way is Custom Consent API ty
BadgeMan
BadgeMan•3mo ago
I can't get it to work anymore.... It used to work, but I guess TikTok updated the API and now it's not receiving any events anymore 😦
BadgeMan
BadgeMan•3mo ago
No description
Mackenly
Mackenly•3mo ago
UI Bug Report: Notice that both say unpublished. This is found in the publish confirmation modal.
No description
Mackenly
Mackenly•3mo ago
Feature request: When publishing changes, users should be able to uncheck changes to "stash" them for later. Perhaps I need to hot fix one tool and am in the process of working on another. I'd like to be able to uncheck the changes of the one I am still working on and bring it live later. In the UI this could look like the change list having checkboxes (that are by default checked) giving users more control over changes. Maintenance/Feature Request: For the custom MC packaging script, in order to use the recently announced Workers Observability persistent logs, the Wrangler version needs to be bumped (see issue below). https://github.com/cloudflare/managed-component-to-cloudflare-worker/issues/26
A_Person
A_Person•3mo ago
I set everything up in Zaraz on our staging site and everything went smoothly. But when I tried to add it to the production site I get a net::ERR_ABORTED 404 (Not Found) error for the /cdn-cgi/zaraz/s.js path. I've checked the settings and everything seems to match. I know it is a 404 but I also checked to make sure it wasn't getting blocked by cloudflare. I also enabled billing for zaraz just to make sure it wasn't checking our potential traffic. I'm not sure what I should check next to get to the bottom of this. Any ideas?
BadgeMan
BadgeMan•3mo ago
In Google Ads I get this warning since a couple of days... anybody is experiencing the same? How to solve this? To my understanding Google Ads is expecting this script to run on the website but because of Zaraz all requests are server side right? Am I missing something?
No description
No description
jeremy
jeremy•3mo ago
Hey there - I know there has been a number of threads discussing implementing support for Google Ads "Enhanced Conversions" soon - but no concrete specifics. Is there any sort of rough deadline this is expected to be implemented by? Our stakeholders are asking
ItsTobias
ItsTobias•3mo ago
You can implement enhanced conversions yourself via the Google ads api. The only issue with that is that the Google ads api is an absolute nightmare to work with.
Md Rashedul Islam
Md Rashedul Islam•3mo ago
Hello, Is there any cookie banner template for zaraz or only the default banner. If there are any alternative anyone show me the resource please
Unknown User
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
_fe_he
_fe_he•3mo ago
I hope this is the right place to ask. When I check the code for the ManagedComponents (e.g. floodlight) I noticed that the calls against the api are still client-sided (client.fetch) and also the Zaraz debugger is showing me "Client-Side network request). Is there a reason this is not done server-sided (manager.fetch)?
Mackenly
Mackenly•3mo ago
Zaraz Performance Optimization What are the best practices for speeding up Zaraz loads? I've been noticing on some sites that the initial Zaraz s.js is taking about 800ms. If manually loaded, could we do it async so that it starts loading asap rather than being deferred?
Unknown User
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server