I've just added Google Analytics 4 to Zaraz but is not working

Hi guys,

I’ve just started using Zaraz for Google Analytics 4:

But when I check on GA4 reports (including the Realtime), it’s not working. So, I rund a health check and found these two errors:

  1. no_dnssec_found
  2. not_found_ds_record
    I read in other topycs in this community that one can ignore those two errors, but does this have anything to do with Zaraz not working for me? or perhaps I’m doing something wrong? This is the website where I’m trying to implement it: https://mayangateway.com/

I also saw something strange. In Zaraz - Settings at first I saw that the Auto-inject script was green, but I checked again, and now it is off:

I believe this should be on, right?

Thank you in advance for your help!

Hi @MayanTraveler! If auto-injection is turned off Zaraz will not load on your website, unless you’ve implemented it manually (which may explain why you are not seeing data in GA4). If your site is proxied by Cloudflare, you can use Auto-injection to load Zaraz, if not you would need to load it manually. See our docs for more info: https://developers.cloudflare.com/zaraz/

1 Like

Hi @yair-dovrat ! thank you for your answer. When I realized that auto-injection was turned off, I turned it on. My website is proxied by Cloudflare. I runed this test to double check: Check if Cloudflare is enabled - by Selesti Ltd so I don’t understand why Auto-injection doesn’t load Zaraz - it’s strange. I guess something is not right in my configuration but I can’t find what it is.

Hi @yair-dovrat ! Besides the test by Selesti Ltd (don’t know how accurate it is), I also enter https:// www.example.com /cdn-cgi/trace into my browser to double check that my webiste is proxied by Cloudflare, and I get this results:

It seems like I get the expected outpot. So, my website is proxied by Cloudflare, and I’ve turned on the Auto-inject script, but it doesn’t work. By any chance do you have any idea why this is happening?

Hi @MayanTraveler, have you had any progress on this issue? I am also finding the “auto-injected” code missing.

I can use the trace URL to confirm my site is being proxied, however when I replace this with “zaraz/s.js” I am receiving a 404.


Hi @TomHenshall

I had to contact custommer support of Cloudflare. My site is also being proxied by Cloudflare but some of my configurations are managed by my server because I have a Cloudlfare plan with them, and I’m actually happy with the results, so I didn’t want to change anything there.

So, even though my website is proxied by Cloudflare, but because of the configuration with my server I had to follow the steps as if my website were not proxied by Cloudflare like the documentation here: https://developers.cloudflare.com/zaraz/advanced/domains-not-proxied/ - so basically I had to load the zaraz script manually like it says in that link.

I’ve been using zaraz for Google Analytics 4, and for Adwords now. It seems to be working fine. Now, I’m trying to set up Facebook Pixel.

Perhaps you should contact support, and have them to take a look at your configurations?

1 Like

Glad you got it working.

My problem has also been solved now. I was trying to run my site on my local device, once I deployed the changes to my server which is proxied by Cloudflare everything started working as expected

1 Like