BensTechLab
CDCloudflare Developers
•Created by Mackenly on 9/20/2024 in #zaraz
With Google Ads' Enhanced Conversions,
Google keeps emailing me this is "required" for Oct 1st. So I'm also searching here...
11 replies
CDCloudflare Developers
•Created by Zino (Expatfile.tax) on 5/27/2024 in #zaraz
Hey! Did anything change regarding the
@Zino (Expatfile.tax) without seeing the network requests tab and based on your screenshot, I'd say the
s.js
request responded with 403 Forbidden and contained a user oriented message response with content-type text/html to show the error message. Then the 2nd error is because the browser did not want to interpret that 403 Forbidden response as a script because your root html file was served with a X-Content-Type-Options: nosniff
header telling the browser to be strict about content types.
So basically the real question is why would /s.js
ever respond with 403 forbidden? Does CloudFlare ever use this status code when throttling "malicious visitors" or scrapers? Perhaps your IP was making a few too many requests per minute while you were developing? Maybe a cloudflare rule was disallowing certain geographies or some other cloudflare level firewalling? I don't know the answer - but I think my understanding above will be correct around understanding the error. And I'm of course curious to know what the mechanism was that resulted in this!8 replies
CDCloudflare Developers
•Created by BensTechLab on 5/26/2024 in #zaraz
Changelog · Cloudflare Zaraz docs
Separate Issue/Side Effect of learning above: Interestingly I've learned a lot about the Zaraz debugger on a nextjs/react site where if it re-renders the body element it will also destroy the zaraz debugger UI. In my case the body element is not in my root layout file as I change the body element attributes on various pages of the site. This causes react to re-render the body element and will also destroy the zaraz debugger if open. I never really knew why this happened before, now I do. I could build something in react to overcome this - but curious if you had any well known approach to this already.
3 replies
CDCloudflare Developers
•Created by BensTechLab on 5/26/2024 in #zaraz
Changelog · Cloudflare Zaraz docs
Thanks Yo'av. I was missing analytics events and trying to debug. The problem was on my end to do with scope of re-rendering in nextjs/react. That said I did find the documentation lacking for spaPageview() so I couldn't tell if it was exactly equivalent to the above sample code in terms of recognizing the referrer and current page title if those changes in a soft navigation. If the old way continues to work, I won't change it. But if you want more people to be using the new way, I'm happy to go further.
3 replies
CDCloudflare Developers
•Created by squareclamp on 4/11/2024 in #zaraz
This might be a dumb question, is there
Just buy a 2nd domain name and deploy a 2nd copy of the site (for me its also in Cloudflare Pages, so its pretty easier to deploy another pages site).
7 replies
CDCloudflare Developers
•Created by squareclamp on 4/11/2024 in #zaraz
This might be a dumb question, is there
I agree with @Mackenly Jones. Not only for Zaraz... but I have a fully development copy of my website with developer accounts for everything including Zaraz/GA4 but also payment processing Stripe, and user login Auth0. Dev site is a full test playground. 🙂
7 replies
CDCloudflare Developers
•Created by c3d on 4/8/2024 in #zaraz
Tracking HTML links with Zaraz
You can do it with other selectors - but its just going to be a matter of really verifying that the XPath thing works the way you think it does! (ie: not a bug in Zaraz, just the intricacy of DOM traversal).
11 replies
CDCloudflare Developers
•Created by c3d on 4/8/2024 in #zaraz
Tracking HTML links with Zaraz
The element_id lets me know which instance of the CTA links a user clicked.
11 replies
CDCloudflare Developers
•Created by c3d on 4/8/2024 in #zaraz
Tracking HTML links with Zaraz

11 replies
CDCloudflare Developers
•Created by c3d on 4/8/2024 in #zaraz
Tracking HTML links with Zaraz

11 replies
CDCloudflare Developers
•Created by c3d on 4/8/2024 in #zaraz
Tracking HTML links with Zaraz
I'm using this feature and it's working for me. But XPath can be complicated... do you have the option to modify the HTML of the site and add a CSS class or Id to the target element(s)? Might be more reliable/simple. For example I add a
cta-try-app
class on my site for all call to action links that I wanted Zaraz to track for me, then added a unique element id for each CTA and forward both the click and the link id to google analytics.11 replies
CDCloudflare Developers
•Created by Pat Branchaud on 4/6/2024 in #zaraz
Consent Modal with NextJS
Oh and you can disable JavaScript in Chrome for testing purposes by opening the developer tools and pressing Cmd+P on mac, probably Ctrl+P on windows and searching for 'JavaScript'. By disabling JavaScript you can reload your nextjs site and just see if any content at all is server rendered. Ideally the majority of the site content is server rendered and/or you have a suspense boundary holding the dynamic content.
4 replies
CDCloudflare Developers
•Created by Pat Branchaud on 4/6/2024 in #zaraz
Consent Modal with NextJS
If this is not working for you, I suspect there is something else going on in your nextjs code. The thing I mentioned earlier with zaraz debug view modal is when NextJS re-renders the DOM for a soft navigation - but can also happen if you have broken server side rendering. The easiest way to break server side rendering in nextjs is with a useSearchParams() hook too low in the component tree and/or without a suspense boundary - the can cause your entire site to be client side rendered. So search your code for that hook name and if found, read the docs: https://nextjs.org/docs/app/api-reference/functions/use-search-params
4 replies
CDCloudflare Developers
•Created by Pat Branchaud on 4/6/2024 in #zaraz
Consent Modal with NextJS

4 replies
CDCloudflare Developers
•Created by Pat Branchaud on 4/6/2024 in #zaraz
Consent Modal with NextJS
Ah I don’t think I saw the consent part in earlier messages. I will check my site later and see what I did while playing with this. That said I am not using the consent modal in production. But also the Zara’s debug modal can sometimes get cleared by soft navigation in nextjs which I did see before.
4 replies