CookieTractor with GTM and Google Consent Mode v2
Here is a guide on how to implement CookieTractor using Google Tag Manager (GTM) with full support for Google Consent Mode v2. We install CookieTractor on a page using our GTM Template and includes a Google Analytics 4 (GA4) account.
Install CookieTractor using our Google Tag Manager Template
Insert your GTM code inside the <head> tag on the page if it is not already in place.

Create a new tag in GTM
Click on Tag Configuration and open the Community Template Gallery. In the Import Tag Template dialogue, search for CookieTractor and add it by clicking the Add to workspace button. A warning will appear indicating that a script will be inserted into the tag – this is expected.
Ensure that Triggering is set to All Pages.







Configure the CookieTractor tag
Click on CookieTractor and enter your Website Identifier, which is found under the Installation tab in our tool. Match the Language Code with the language configured in CookieTractor (found under the Settings tab).
There are more advanced settings available in the tag configuration, but these are outside the scope of this guide.



CookieTractor is in place
You can now publish the GTM container, as the installation is essentially complete. However, to demonstrate how Google Consent Mode is used and to verify that it works correctly, we will add Google Analytics 4 in GTM.
Add Analytics
This guide assumes that you have a GA4 account with a web data stream already configured.
Create a new Tag of the type Google Tag. Link it so that the Tag ID matches the one in the data stream in Analytics.
The tag should have All Pages as the Trigger.



Open and test CookieTractor
Now that the GTM container is published, our cookie banner will appear when the website is visited.
To verify that Google Consent Mode is working, add the query string parameter ?ct-debug=true to the URL. You can find more information here about how to verify the implementation.


Relaterad information
Support
Do you have questions about Google Consent Mode or Google Tag Manager for your installation? Feel free to contact us at google@cookietractor.com. Google does not provide direct support for the product – support should primarily go through us.