We are using Google Analytics consent mode (Beta). I believe my implementation is correct, following the official documentation. However, I can't see (in GTM "preview mode") a difference of behavior whether I opt-in or opt-out of tracking. Tags are fired and marked as "succeedeed" in both case. I'm wondering if my implementation is working. (of course I'm clearing cookies and cache between test sessions)
What should I see or NOT see if consent is denied? Is there a difference I should see that would tell me if the consent is taken into account? How can I tell if GTM is tracking or not?
For info, my implementation:
<head>
<script>
// gtm snippet...
</script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag("consent", "default", {
// yes, everything is granted by default (not an EU site)
ad_storage: "granted",
analytics_storage: "granted",
functionality_storage: "granted",
personalization_storage : "granted",
security_storage : "granted",
wait_for_update: 10000, // comfortable timer for starter, will fine-tune it later
});
dataLayer.push({ 'event': 'default_consent' });
</script>
//later after the main js is loaded
gtag("consent", "update", {
ad_storage: "denied", // or granted, depending on user choice
analytics_storage: "denied",
functionality_storage: "denied",
personalization_storage : "denied",
security_storage : "denied",
});
Bonus question: is my setup with a default to "granted" later updating to "denied" a supported case? Could that be the reason I see my tags fired all the time?