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?