Install

Google Tag Manager

Load CookieTrue through Tag Manager with the CookieTrue template, and build triggers on the consent signals it sends.

If you manage your tags in Google Tag Manager and cannot edit the website's code, you can install CookieTrue as a tag. It works, but putting the line directly into your page is more reliable (see the warning below).

#Install with the template

  1. Download the CookieTrue template.
  2. In Tag Manager open Templates → Tag Templates → New. In the three-dot menu choose Import and select the file. Save.
  3. Create a tag of type CookieTrue Consent Banner and enter your site ID. You find it on the Installation page of your website, for example ct_yoursiteid.
  4. Set the trigger to Consent Initialization – All Pages.
  5. Submit and publish.

#Prefer a Custom HTML tag?

  1. Create a tag of type Custom HTML and paste your script line.
  2. Set the trigger to Consent Initialization – All Pages.
  3. Under Advanced settings → Tag firing priority enter 1000, so it fires before your other tags.

CookieTrue sends Google Consent Mode v2 signals, and Tag Manager's built-in consent checks understand them. For each tag that sets cookies:

  1. Open the tag and go to Advanced settings → Consent settings.
  2. Choose Require additional consent for tag to fire.
  3. Add the consent types it needs, for example analytics_storage for Google Analytics 4 and ad_storage for Google Ads.

Google's own tags (Analytics, Ads, Floodlight) already check consent by themselves. This step matters most for third-party tags from the template gallery and for Custom HTML tags.

Each time a visitor decides, CookieTrue pushes an event to the data layer:

{
  "event": "cookietrue_consent_update",
  "cookietrue": {
    "preferences": true,
    "analytics": true,
    "marketing": false,
    "necessary": true,
    "region": "DE"
  }
}

To fire a tag when a visitor accepts marketing, create a Custom Event trigger named cookietrue_consent_update and add a condition on the data layer variable cookietrue.marketing equal to true.

#See also

Still stuck? Write to [email protected]. A person answers, usually the same day.