Skip to content
Installation
Installation

Google Tag Manager

ℹ️

When implementing CookieHub using Google Tag Manager, the automatic cookie blocker is unable to block scripts loaded directly in the website's HTML code. Therefore, to ensure that tags are not loaded before obtaining consent, it is recommended to load all tags through Google Tag Manager.

CookieHub offers a convenient Google Tag Manager template that comes with integrated consent mode support, making it easy and hassle-free to implement into your existing Google Tag Manager container.

Installation

  1. Log in to your Google Tag Manager account.

  2. Go to the Tags section of your Google Tag Manager container.

  3. Click the New button above the list of tags. New tag

  4. Click the Tag Configuration section to select the tag type.

  5. Click "Discover more tag types in the Community Template Gallery" Discover more tag types in the Community Template Gallery

  6. Select the CookieHub CMP tag template by scrolling through the list of types or using the search function. Search the GTM Community Template Gallery

  7. Accept the permissions requested by the CookieHub CMP template by clicking Add. Search the GTM Community Template Gallery

  8. Type your 8 character CookieHub domain code. Click here for instructions on how to find the domain code. CookieHub domain code

  9. Click the Triggering area below to select the trigger.

  10. Select "Consent Initialization - All Pages" from the list. GTM firing trigger

  11. Click the Save button in the top right corner. Your tag configuration should look similar to this: GTM firing trigger

  12. Type a tag name or use the default "CookieHub CMP" and click Save GTM firing trigger

  13. Click Submit to publish the changes.

Congratulations! You have successfully configured the CookieHub tag in your Google Tag Manager container, which includes support for consent mode by default. This means that tags such as Google Analytics, Google Ads, and Floodlight that have built-in consent mode support will now work correctly without any additional changes.

Where can I find my Domain Code?

Your domain code is a unique identifier for your website on CookieHub. To find it, log in to your CookieHub account and navigate to the dashboard. The domain code can be found in the list of domains:

Domain code in list of domains

Regions

In CookieHub 2.8 and later, the consent mode defaults are controlled using the CookieHub GTM community template. This applies both to the global consent mode defaults and region-specific defaults.

If you have more than one region configured in your CookieHub instance, set up the regional defaults in the CookieHub GTM community template by following the steps below:

  1. Log in to your Google Tag Manager account.
  2. Go to the Tags section of your Google Tag Manager container.
  3. Click the CookieHub CMP tag.
  4. Click the Tag Configuration section.
  5. Configure the default consent mode settings in the "Consent Mode Defaults" section. These settings should align with the consent settings for the default region configured in the CookieHub dashboard.
  6. Click "Consent Mode Settings" to expand the advanced consent mode settings.
  7. In the "Region defaults", add new regions for the additional regions that should have different consent mode defaults. The "Regions" textbox should include a comma-separated list of two-digit ISO 3166 country codes (opens in a new tab) or US state (ex. Use "US-CA" for California).

You can find detailed instructions about what information you need to add in the consent mode defaults and region defaults based on your regional settings in the CookieHub dashboard. To find this information, click your domain and go to the Implementation tab.

How can I verify setup?

If you have a paid subscription, you can run a cookie scan for your domain to verify that everything is set up correctly. The cookie scan will identify all cookies and detect if they are being set prior to consent or not. After the scan has completed, you'll receive a scan report by email, and you can also view a list of cookies detected and their status in the CookieHub dashboard.

Request a rescan

What's next?

If you have tags in your Google Tag Manager container that don't offer built-in consent, you'll need to manually select the correct category as additional consent and update the firing triggers for each tag. How to configure additional Consent?

Google Tag Manager (GTM) has a Consent Overview feature that enables you to see an overview of the consent mode setup in your container. This feature helps you identify which tags support built-in consent and which tags need to be configured using additional consent.

Having any problems? Refer to our Google Tag Manager Troubleshooting guide.