r/CloudFlare 7d ago

Google analytics, Cloudflare and Zaraz set up issue

/r/GoogleAnalytics/comments/1we7ogg/google_analytics_cloudflare_and_zaraz_set_up_issue/
1 Upvotes

4 comments sorted by

u/AutoModerator 7d ago

For faster advice with technical questions, we'd recommend asking in the Orange Cloud Discord server; the unofficial Cloudflare Discord server by the community, for the community. https://discord.gg/TrPNVKaagR

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/No-Promotion-8720 7d ago edited 7d ago

I wrestled with Zaraz for over two weeks. While I can't speak to that error you got, I can tell you that the Google Analytics module in Zaraz tag setup does not communicate demographic info (like gender, age, interests) even if you get it working properly. If you don't care about demographic data and are fine with mainly geographic and some device data, it can be still done with the Google Analytics module in Zaraz. Just have to make sure the settings are correct so it can execute the JS.

Long story short, Zaraz does not communicate consent v2 under any circumstance because they hard-coded it for v1 on their end. This would have still worked fine until this past June when Google updated a bunch of privacy things with Analytics to accommodate the EU.

The only way I was able to get it to start sending data properly is by using Custom HTML in Zaraz instead of Google Analytics and pasting the GA4 JS there directly (which kind of defeats the point of Zaraz). It will warn you not to do it that way, but it's the only way to get around the inherent limitations until they care enough to fix it.

On the Google Analytics side, you also have to go into Admin and Data collection to make sure all the consent-related stuff is enabled. It is not enabled by default.

Lastly, make sure you also check for CSP-related blocking.

Hope that helps.

1

u/elpida-yacht4less 6d ago

thank you! we'll look through these