How do I import the GTM Consent Mode template?
Download the CookieConsentHQ template file and import it into Google Tag Manager. The template uses the Apache-2.0 license and is not yet listed in the Community Template Gallery.
Follow these steps:
- Open your Google Tag Manager workspace.
- Select Templates, Tag Templates, New.
- Open the three-dot menu in the template editor.
- Select Import.
- Choose
cookieconsenthq-gtm-template.tpl. - Save the imported template.
Google documents this process in its custom template guide. Since the CookieConsentHQ template is not yet in the Gallery, use the downloaded .tpl file rather than searching for a Gallery listing.
After importing, the template becomes available when creating a tag. It provides CookieConsentHQ's consent initialization settings and banner loading controls.
You can also install CookieConsentHQ directly without GTM. The installation documentation explains that approach, which is recommended when your website contains tracking scripts outside the GTM container.
How do I create the CookieConsentHQ tag?
Create a new tag using the imported CookieConsentHQ Consent Mode template and enter your website's script URL. Set its trigger to Consent Initialization - All Pages, then preview and publish the container.
In Google Tag Manager:
- Open Tags, New.
- Choose CookieConsentHQ Consent Mode.
- Paste the script URL from the CookieConsentHQ Install tab.
- Select Consent Initialization - All Pages.
- Save the tag.
- Preview the container, inspect its behavior and publish.
The Consent Initialization trigger is intended for consent setup before other GTM tags. Google's consent template documentation describes using this trigger with its consent APIs.
The CookieConsentHQ template sets consent defaults and then injects the banner script. The banner sends updates after a visitor makes a choice.
Use GTM to load the banner only if you are not already loading it directly in the page head. Two loading methods should not be active for the same banner.
Which consent defaults does the template set?
The template uses Google's setDefaultConsentState API to establish consent defaults. Its enabled regional rule covers the EU/EEA, UK and Switzerland, with all consent types denied except security_storage.
You can configure additional regional overrides using ISO region codes. These settings let the template apply different starting consent states according to the configured regions.
The template also provides optional Google settings:
ads_data_redaction, enabled by default.url_passthrough, disabled by default.
Google's Tag Manager consent API supports regional defaults and consent updates. The setDefaultConsentState call establishes the starting state before the banner receives a visitor's choice.
Once the visitor chooses, CookieConsentHQ sends updates for the four Consent Mode v2 signals, along with functionality_storage and personalization_storage.
See Google Consent Mode v2 for the signal names, available modes and additional settings.
How can GTM triggers respond to a consent choice?
The CookieConsentHQ banner pushes a cchq_consent event into the dataLayer after consent updates. You can use that named event when configuring custom triggers inside Google Tag Manager.
The event gives GTM a defined point associated with the visitor's choice. The consent update itself communicates the changed storage and advertising states to Google's consent controls.
These functions have separate purposes. The consent state determines how participating tags handle the visitor's permissions, while a custom trigger can respond to the cchq_consent event.
Check that the relevant tags are configured to follow consent states rather than assuming the presence of the event changes every tag automatically.
The Consent Mode testing guide covers how to inspect the implementation after publishing. For scheduled checks, the Consent Mode Health Monitor starts on Starter and reads consent information from Google's requests during each scheduled scan.
Should I install the banner through GTM or directly in the head?
The recommended installation places the standalone CookieConsentHQ snippet first inside <head>, above the GTM container. Loading the banner through GTM is an alternative for sites where the relevant tags are managed inside that container.
The distinction is script execution order. A banner injected by GTM arrives after GTM itself has loaded, so that method can gate GTM-managed tags but cannot stop hardcoded page trackers before the container starts.
For hardcoded analytics and advertising tags, the direct snippet must be first in <head> to block them before execution. Do not add async or defer to that snippet.
Choose one banner loading method. If you use the standalone snippet, do not also configure the GTM template to inject another copy.
After publishing, use the free checker to examine one public page for cookies set before consent, hardcoded tracker tags and Consent Mode v2 defaults.
Does the GTM template establish legal compliance?
The template provides consent defaults, banner loading and update controls, but the website operator must decide which regional settings and tag behaviors are appropriate. Google Consent Mode support also does not make CookieConsentHQ a Google-certified CMP.
CookieConsentHQ does not support IAB TCF or IAB GPP. Those limitations matter for websites that require those frameworks.
Google's documentation describes how its consent APIs operate, while the website remains responsible for its tracking configuration and applicable obligations.
This page describes installation and product behavior as of October 20, 2026. It is not legal advice.