Skip to content

Guide: CookieTractor with Google Consent Mode v2

This is a step-by-step guide on how to implement CookieTractor using our Script with full support for Google Consent Mode v2

CookieTractor implements Google Consent Mode v2 out of the box. That means that when you install our script, you will implement Google Consent Mode – easy peasy

To add CookieTractor on your website, you first need to have an account with us. Create a test account on our homepage if you don’t already have one. Then log in to our tool and configure the website where you want to implement the dialog.

1) Add CookieTractor to the Website

When your CookieTractor Account is set up, and you've created a a Website, you'll find our Main Script under the Installation tab. Copy the Code and paste it into the <head> section of the HTML

Copy the Code and paste it into you <head> and you're all set

Make sure that the script is Render Blocking and place it before any other script tags. This will allow you to utilize our Events and Functions and API in your custom scripts and enable our automatic YouTube blocking etc.

CookieTractor is installed

At this point, your implementation is complete. However, to demonstrate how Google Consent Mode is used and to verify that it works correctly, we will add Google Analytics 4 to the website.

2) Add Google Analytics 4

This guide assumes that you have a GA4 account with a web data stream already configured.

Open the View tag instructions for your Web stream details and choose your platform or Install manually. If you install it manually, copy the code and paste it intro the <head> section of the website after our script. 

Once the GA4 tag is added to the <head>, you can test your setup by entering your URL and clicking Test

3) Open and test CookieTractor

Now that our script and GA4 is implemented, you can verify that Google Consent Mode is working, by enabling our Debug mode.

Enable it either by clicking the Debug next to the domain button in the Domains section under the Settings tab in our tool:

Click the Debug button to open your site in our Debug mode

... or by adding the query string parameter ct-debug=true to the URL. You can find more information here about how to verify the implementation.

CookieTractor in action! Click on Read more about our cookies to view the information when debug mode is enabled using ct-debug=true in the query string
The debug information shows that the implementation of Google Consent Mode v2 appears to be correct

All done!

Now you've got CookieTractor installed on the website. 

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.