Introduction to Google Tag Manager (GTM)


Google Tag Manager (GTM) is a tool designed to help website owners organize and deploy scripts and tags on their site. When using GTM, websites are still subject to global data regulations such as the GDPR, PIPEDA, CCPA, and more.


Businesses under these regulations who use GTM to deploy third-party tracking technologies (e.g., Google Analytics, Facebook Pixel, LinkedIn, AdWords, etc.) must prevent them from triggering until site visitors have given their consent to their use.


Google Tag Manager Consent Mode


GTM’s consent configuration allows users to categorize tags so that they are fired only under the right conditions when site visitors give consent. By connecting Consent Management Platforms (CMPs)  — such as Termly — to Consent Mode, you can streamline the entire process and mitigate regulatory risks.


If you don't want to use GTM's built-in consent features, follow the instructions for blocking third-party cookies with GTM.


GTM + Termly


Termly offers a GTM template that acts as a translator to communicate your users’ consent preferences with GTM as they come to your site and interact with Termly’s consent banner. To get started, follow the steps in the guide below: 


  1. Install Termly’s Consent Management Platform 
  2. Install the Termly Consent Mode Template 
  3. Configure Consent Checks 


1. Install Termly’s Consent Management Platform


1.1 Scan your site for cookies


If you haven’t done so already, you will need to scan your site for cookies: 

  1. Sign in to your Termly dashboard.
  2. Start a website scan by clicking Consent Management, then click Scan Report.
  3. Click Scan Now to start your website scan.
  4. Once your scan is complete, your cookie report will be generated. Review your site’s cookies and their classifications, and make any changes necessary.


1.2 Install Termly consent banner code snippet


Next, you will need to install your Termly consent management platform code snippet. You can do this in one of two ways:

  • Install the Termly consent banner script tag directly on your page, before the GTM snippet (recommended).
  • Serve the Termly consent banner script tag through Termly's GTM template (see step 2.4.6).


Note: We do not recommend enabling Termly’s Auto Blocker if you use GTM as it will interfere with GTM’s ability to serve scripts. 


2. Install the Termly Consent Management Platform Template


Use Termly’s native Google Tag Manager template to automatically read user consent preferences and manage tag behavior anywhere your banner is installed.


2.1 Add Consent Mode template to your workspace


To install Termly’s Consent Management Platform template:

  1. Click on Templates in the left hand menu of your GTM workspace
  2. Click Search Gallery
  3. Search for “Termly”
  4. Select “Termly Consent Management Platform”
  5. Click Add to Workspace


2.2 Create new event trigger "userPrefUpdate"

  1. Go to your GTM workspace and create a new trigger
  2. Click Choose a trigger type to begin setup, then click Custom Event.
  3. Under Event name type userPrefUpdate
  4. Trigger should be set to fire on All Custom Events


2.3 Create new event trigger "Termly.consentSaveDone"

  1. Go to your GTM workspace and create a new trigger
  2. Click Choose a trigger type to begin setup, then click Custom Event.
  3. Under Event name type Termly.consentSaveDone
  4. Trigger should be set to fire on All Custom Events


2.4 Add the Template tag

    

  1. Go to Tags
  2. Create a new tag and select Termly Consent Mode in Tag Configuration
  3. Click Triggering, then click New / +
  4. Add Consent Initialization - All Pages
  5. Add userPrefUpdate
  6. Optional: if you want to install the Termly script tag along with the template, select 'Inject Termly consent management platform script tag' then paste in your website UUID.


3. Configure Consent Checks


If you do not see consent checks in your tag manager environment, you may need to enable the feature from Container Settings > Additional Settings > Enable consent overview


3.1 No additional consent required


To configure tags where no additional consent is required for them to fire (e.g., Essential tags, or those with Built-in Consent checks), navigate to the Tags tab, and for each tag do the following:

  1. Click on the Tag name you wish to update
  2. Click into Tag Configuration at the top
  3. Open Consent Settings > Additional Consent Checks
  4. Select ”No additional consent required”


3.2 Non-Essential Tags


To configure tags where additional consent is required for them to fire (e.g., Non-Essential tags), navigate to the Tags tab, and for each tag do the following:


  1. Click on the Tag name you wish to update
  2. Click into Tag Configuration at the top
  3. Open Consent Settings > Additional Consent Checks near the bottom
  4. Select “Require additional consent for tag to fire”
  5. Use the mapping table below to select the appropriate categorization
  6. Open Triggering > Firing Triggers below Tag Configuration
  7. Select “Termly.consentSaveDone”
  8. For tags that are expected to trigger when the page loads, set Tag firing options > Once per page to prevent the tag from firing again each time consent changes.


Consent category mapping:

Termly Consent CategoryGTM Consent Type
advertisingad_storage
analyticsanalytics_storage
performancefunctionality_storage
performancepersonalization_storage
essentialsecurity_storage
socialsocial_storage*

*Not a default GTM consent category