How to install Google Consent Mode v2 with GTM?
Instructions about how to install Google Consent Mode v2 with Google Tag Manager?
Google allows the use of its own consent mode by including APIs to control tag cookie storage based on user consent choices without disabling services provided by Google, such as Google Tag, Google Analytics, Google Ads, Floodlight, and Conversion Linker. Google Consent Mode v2 could be implemented using either the global site tag (gtag.js) or Google Tag Manager (GTM).
After you install Google Consent Mode v2, select Basic or Advanced consent mode implementation at your GTM account.
If you implement Google consent mode according to the instructions below, the consent mode
default command will load before Google tags fire. Google tags will fire based on your selection of Basic or Advanced consent mode implementation.
For troubleshooting missing Consent Mode or TCF signals on Google tags, clients should first contact the CMP support, as specified by Google.
This video will help you to implement Google Consent Mode easily with CookieScript:
CookieScript has full integration with Google Consent Mode v2:
Tag Manager Community Template available
Integrated with consent update calls
Integrated with consent default calls
Supported consent types:
ad_storage
analytics_storage
ad_user_data
ad_personalization
functionality_storage
personalization_storage
security_storage
The easiest way to implement Google Consent Mode v2 on your website is by using a CookieScript Google Tag Manager (GTM) tag template. This is the recommended Google Consent Mode v2 installation method. It comes with all the necessary default consent state settings and code, so you don't need to worry about writing a single line of code.
First, create your GTM account and a website container in GTM, and install the GTM container code to your website, where you could add your tags. Read the guide on how to create a GTM account and install the GTM container.
Second, install CookieScript using a GTM Tag template. To install CookieScript using a GTM Tag template, follow the steps below:
Step 1: Go to Tags and click New
Step 2: Fill in the name and click on the Tag Configuration area:
Step 3: Click on the link to show Community Template Gallery and search for CookieScript:
Step 4: Click Add to Workspace and confirm your choice.
Step 5: Configure the banner according to your needs: fill in your Cookie Banner script URL (can be found in the banner settings of the CookieScript dashboard > Installation tab) and choose the default consent state:
Step 6: As a firing trigger choose Consent Initialization - All Pages. It's important to have this specific trigger since it is fired before any other tags and ensures proper work of the Tag.
All done, just publish the changes and the Google Consent Mode v2 will be implemented into your website or app.
Enable Google Consent Mode v2 in the cookie banner settings
Google Consent Mode v2 should be enabled in your cookie banner settings too. Go to your CookieScript user account > Settings > Google Consent Mode, where you will find the checkbox ENABLE GOOGLE CONSENT MODE V2, and check it:
You can optionally change a category that allows Ads Storage, Analytics Storage, Functionality Storage, Personalization Storage, and Security Storage in Google Consent mode.
Checklist for the correct implementation of Google Ads and Google Consent Mode v2
Google Consent Mode is enabled in settings.
See the guide about how to enable Google Consent Mode v2.CookieScript is installed in GTM using the latest template from gallery.
See the guide about how to update the GTM template.CookieScript trigger is set to Consent Initialization (AND no other tags in that trigger)
GA trigger is set to Initialization
The right GA trigger should look like this:The common mistake is the wrong GA trigger selected like in this example:
Clear browser Cache
Use preview mode to see how it works. Link to debugger info.
Note: If you want to check that CookieScript is implemented correctly, go to your account > Settings, where at the top of the page you will find information about your banner status. Wait until the scan finishes, then the banner status will be updated:
After you install Google Consent Mode v2, you need to select Basic or Advanced consent mode implementation at your GTM account.
Also read the article about how to check if Google Consent Mode v2 is activated.
Other Google Consent Mode v2 installation methods:
How to implement Google Consent Mode v2 manually (not recommended)?
Note: To implement Google Consent Mode v2, use only one method.
Note: If you implemented Google Consent Mode v2 using a GTM tag template, the Google Ads script should also be implemented using a GTM tag template. Also, make sure that you use a trigger, which sets the Google Ads script after the trigger Consent initialization. If you implemented consent mode v2 using a GTM tag template, and implemented the Google Ads script manually, your Ads script will not work.
If you implemented consent mode v2 manually, implement the Google Ads script manually as well. Just make sure that your cookie banner script loads first, and only then- the Google Ads script.
For more information, read the following documentation from Google:
Google documentation for web:
Google documentation for app:
Did this answer your question?