Rasmus
Rasmus

Reputation: 245

Google Consent Mode works with UA but not GA4

I am having trouble tracking without cookies using GA4.

I have both a UA and a GA4 property that I am tracking simuntaniusly using gtag:

window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
      
gtag("consent", "default", {
    ad_storage: "denied",
    analytics_storage: "denied",
    wait_for_update: 1000
});
        
gtag('set', 'url_passthrough', true);
      
gtag('js', new Date());
gtag('config', 'UA_TRACKING_CODE');
gtag('config', 'GA4_TRACKING_CODE');

Both UA and GA4 complies with consent set to "denied" and are not setting any cookies.
In UA i can see the pageviews coming in even though no cookies are beging set. But nothing is tracked in GA4 unless i set the "analytics_storage" set to "granted".

Does anyone know how to track in GA4 with "analytics_storage" set to "denied"?

Upvotes: 5

Views: 2333

Answers (2)

pinkasey
pinkasey

Reputation: 153

This subject is very confusing and frustrating for me as well.
In short - I believe GA4 won't let you track ANY information without user consent (not even aggregated, anonymous information).

Here's some documentation, that I don't think was available when this question was asked: https://support.google.com/analytics/answer/9976101?hl=en
Spesificaly:

analytics_storage='denied'
...

  • Cookieless pings will be sent to Google Analytics for future measurement. Google Analytics 4 will use cookieless pings for modeling.

I tested it, and that's indeed the behaviour I see when analytics_storage and ad_storage are 'denied':

  • No cookies are set
  • GA sends a ping for every pageview (i have set-up a server-GTM, so the ping goes there - and from there to Google)
  • The pageview-ping does not show in:
    • real-time report
    • normal reports (not even after 24h - some posts I've seen said it takes 24h. but it doesn't. It's never visible in reports)
    • Not even in DebugView (a GA4 feature)
  • Sadly, I couldn't find statistics about consent-preferences - how many people accepted/rejected each storage option

I think GA4 went too far here - I just want to track aggregated, anonymous data, when users reject cookies. That's not PII at all. I just want to know stuff like "how many people have visited this page in my site". That shouldn't be banned. But seems like it is, and I've yet to understand why or how to get around it.

I know GA4 sends a parameter called gcs (Google Consent Status) with the ping. presumably, in my sGTM, I can send my ping without this parameter, or set it to G111 (= 'permissions granted'), and maybe that would make the pageview count in reports, but so far I wasn't able to override this parameter - not in GTM, nor in sGTM (Server-Side GTM).

If anyone knows a solution to this situation - I'm more than happy to hear.

Upvotes: 4

Michele Pisani
Michele Pisani

Reputation: 14197

With the Consent Mode it doesn't even track Universal Analytics if analytics_storage is denied (you can see that the data is sent to the Google Analytics servers but none of those hits will be shown in the reports).

Upvotes: 3

Related Questions