Introduction
In March of this year, Google decided to force advertisers to implement Consent Mode V2, following the Digital Market Act. Google Consent Mode V2 offers a flexible and user-centric way to manage how Google tags behave based on the consent status of your users.
In a previous article, we explained this decision in more detail, but also gave a full overview of what the V2 was bringing. This article provides a detailed walkthrough for digital marketing professionals on how to verify and debug an implementation of Google Consent Mode V2 using Google Tag Manager (GTM) and browser developer tools.
Debug with GTM’s preview mode
GTM's Preview Mode is invaluable for real-time debugging. It allows you to see which tags are firing and which are not, based on the consent decisions made by users. Make sure to test different scenarios:
- User grants full consent
- User denies consent
- User partially allows consent categories
Debug consent variables
First, you’ll want to use the ‘’Consent’’ section of the preview mode. You need to make sure that the way you interact with the cookie banner is being reflected here. So if you refused all the cookies, this is what you should see :
On the other hand, if you accepted all the cookies, you should see that:
With consent preferences set, observe the network requests being made by your tags in GTM's Preview Mode. This helps ensure that no personal data is sent without consent, complying with the ad_storage and analytics_storage settings as per user consent.
What about tags firing?
Now that you made sure that the consent variables are being sent correctly, you can check if your tags are behaving as expected. And this will depend on the version of Consent Mode that you implemented.
With the basic implementation of Consent Mode, as long as no cookies are accepted no Advertising or Analytics tags should fire, therefore, the consent variables should be configured as denied. If no cookies are accepted, your tags should appear as “Tags Blocked by Consent Settings”. The respective tags can only fire once the cookie status has been updated.
With the advanced implementation of Consent Mode, it’s different. Your Google tags can fire, even when you refuse cookies, to allow Google to send a cookieless ping. And of course, if you accept the cookies, your tags are being fired too.
Debug with your browser developer tool
Browser Developer Tools offer a deeper dive into the inner workings of Consent Mode and what information is actually collected. Once again, the way to debug will depend on the version of Consent Mode that you implemented.
Basic implementation
To access the developer tool, use the inspect function and use the network section, then search for collect?v=2.
Go to the payload and find variable gcs. Of course, the value of this variable should match with the consent that you gave on the website.
- G100: No Consent is Given
- G110: Advertising consent is given, no analytical
- G101: No advertising consent is given, but analytical is
- G111: All consent is given
Advanced implementation
Same as with the basic implementation, you’ll need to look for collect?v=2 in your network section of the developer tool. You’ll also need to find the gcd variable.
In this case, the string should start with 11, use 1 to separate the different consent signals, and ends with a number like 5.
Each letter has a specific meaning that should match with the consent that you gave on the website.
Conclusion
Properly implementing and debugging Google Consent Mode V2 is crucial for compliance and efficient data collection. By using Google Tag Manager and browser developer tools effectively, you can ensure that your website respects user consent preferences while capturing necessary analytics and advertising data.