Google Analytics Consent Mode
-
On https://support.google.com/analytics/answer/9976101 Google describes the consent mode on website and mobile apps.
Using the embedded video https://www.youtube.com/watch?v=MqAEbshMv84 you can see how they set up the consent mode to communicate users’ consent mode to Google.
The following piece of code is added just before the loading script of Google Tag Manager.
<script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} if(localStorage.getItem('consentMode') === null){ gtag('consent', 'default', { 'ad_storage': 'denied', 'analytics_storage': 'denied', 'personalization_storage': 'denied', 'functionality_storage': 'denied', 'security_storage': 'denied', }); } else { gtag('consent', 'default', JSON.parse(localStorage.getItem('consentMode'))); } </script>
With this piece of code I can use Google Tag Manager bèta feature to read and use the consent mode.
I was not able to find this piece of code in your most recent version of GTM4WP
Are you willing to embed this in a future version of your plugin?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Google Analytics Consent Mode’ is closed to new replies.