Phil15
Phil15

Reputation: 522

Google Analytics Consent mode (beta) - Sends data but is not reflected on dashboard

I wanted to use the new analytics consent mode which is gdpr compliant following this official guide

Placed following into the header:

    <script>
 

     window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
    
      gtag('consent', 'default', {'ad_storage': 'denied', 'analytics_storage': 'denied'});
     
    </script>
        
    <script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXX"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());
    
      gtag('config', 'G-XXXXXXXX');
    </script>

Analytics consent mode works with:

 gtag('consent', 'default', {'ad_storage': 'denied'})

However no longer works (no user activity on dashboard) if I deny cookies in the settings like so:

gtag('consent', 'default', {'ad_storage': 'denied', 'analytics_storage': 'denied'});

My understanding is that it should still reflect page hits without the cookie.

I can see the POST request being sent to their go server with status 204.

What am I doing wrong?

Upvotes: 14

Views: 3533

Answers (2)

florian
florian

Reputation: 501

The hits with 'analytics_storage' set to 'denied' are not shown in GA reports at all now. Initially I could see them in the real-time report, but now that seems to be gone too.

Having said that, it is possible to manipulate the request with the customTask API and rewrite the 'gcs' parameter (or drop it altogether). This way, you would see the anonymized (on user level) hits in GA while not using cookies.

Upvotes: 2

Michele Pisani
Michele Pisani

Reputation: 14189

Currently (beta) with analytics_storage denied Google Analytics will not use the _ga cookie to identify the user, even if already present in the browser, but will associate a temporary identifier that only exists on the current page. This guarantees the non-traceability of navigation however, despite the interactions being sent to the Google Analytics servers, the data set in question, characterized by a parameter that identifies the consent method, is not currently collected / exposed in the reports.

Anyway GA4 always sets IP anonymization by default, so this thing doesn't need to be managed.

Upvotes: 0

Related Questions