Google Consent Mode and Termly

How-To-Set-Up-Google-Consent-Mode-With-Termly-01

Google’s Consent Mode is a way to communicate your users’ consent status to Google. Google services such as Tag Manager, Analytics, Floodlight, and Ads adjust their behavior in response to flags set by Consent Mode and respect users’ choices accordingly.

Table of Contents
  1. How Does Termly’s CMP Work With Google Consent Mode?
  2. How To Set Up Google Consent Mode With Termly’s CMP
  3. FAQ

When properly configured, Termly’s Consent Management Platform (CMP) integrates seamlessly with all of Google Consent Mode’s features.

Note: Google Consent Mode only works with Google’s Global Site Tags (gtag). For example, a Google Analytics gtag contains src=”https://www.googletagmanager.com/gtag/js?id=GA_MEASUREMENT_ID” 

There are two possible ways to set up Google Consent Mode with our consent management platform:

Implementation method Consent default calls Consent update calls
Regional consent settings in Termly dashboard Use code example (see below) Integrated
Google Tag Manager community template Integrated Integrated

Below, we teach you how to do both. For more hands-on assistance, feel free to reach out to our customer service team.

Enable Consent Mode Using Regional Settings in the Termly Dashboard

Google Consent Mode can be enabled on a region-by-region basis from your Termly dashboard.

To enable Google Consent Mode using regional consent settings in the Termly Dashboard, follow these simple steps.

Step 1: Navigate to Your Consent Banner Settings in Your Termly Dashboard

Locate the consent banner settings in your Termly Dashboard and enable Google Consent Mode under your Consent Settings for any region you require.

step-1-termly-cmp-consent-mode

step-2-termly-cmp-consent-mode

Once this setting is enabled, Google tags (gtags) are exempt from being blocked by the CMP’s Auto Blocker, meaning they’ll always be allowed to run on a loaded page.

If you want to prevent this from happening so the Google tags are not exempt, use manual blocking to assign those scripts to the appropriate blocking category.

For guidance, read our documentation on how to block JavaScript third-party cookies manually.

Step 2: Configure Your Consent Defaults

When Google Consent Mode is turned ‘On‘, you must configure consent defaults for each consent category with in-line code before your Termly embed script.

After manually completing this step, your consent banner will make ‘update’ calls whenever the consent state changes on the page.

Changing the default setting for a given category gives you control over how the consent state is configured on the first page load before subsequent ‘update’ calls are made, and you can set it to either ‘denied‘ or ‘granted‘, as shown for you below.


<script>
// Define dataLayer and the gtag function.
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}

// Default all categories to 'denied' 
gtag('consent', 'default', {
  'ad_storage': 'denied',
  'analytics_storage': 'denied',
  'functionality_storage': 'denied',
  'personalization_storage': 'denied',
  'security_storage': 'denied',
  'social_storage': 'denied',
});
</script>

Consent category mapping

Termly Consent Category GTM Consent Type
advertising ad_storage
analytics analytics_storage
performance functionality_storage
performance personalization_storage
essential security_storage
social social_storage*

*Not a default GTM consent category

Read more about setting consent defaults and other advanced configurations.

Enable Consent Mode Using Termly’s Google Tag Manager Template

You can also successfully integrate Google Consent Mode with our consent management platform by using our Google Tag Manager template. Just follow these three easy steps.

Step 1: Add the Consent Mode Template to Your Workspace

The first thing you need to do is add our Consent Mode template to your workspace. To install this template:

  • Click on Templates in the left-hand menu of your GTM workspace
  • Click Search Gallery
  • Search for “Termly
  • Select “Termly Consent Management Platform
  • Click Add to Workspace

termly consent mode template screenshot

Step 2: Create a New Event Trigger “userPrefUpdate”

Next, you’ll need to create a new event trigger.

Our CMP fires the event trigger “userPrefUpdate” every time a user’s consent choice changes. The template listens for this event and updates their consent state according to their preferences.

To create this event and configure this step properly:

  • Go to your GTM workspace and create a new trigger
  • Click Choose a trigger type to begin setup, then click Custom Event.
  • Under Event name, type “userPrefUpdate”
  • The trigger should be set to fire on All Custom Events

For some extra assistance, see a screenshot example below.

Termly_CMP and Google Consent Mode Set Up Example 1

Step 3. Add the Template Tag

Next, you’ll need to add the template tags. All you need to do is:

  • Go to Tags
  • Create a new tag and select Termly Consent Mode in Tag Configuration
  • Click Triggering, then click New / +
  • Add Consent Initialization – All Pages
  • Add userPrefUpdate

For some assistance, take a look at the screenshot example below.

Termly_CMP and Google Consent Mode Set Up Example 2

That’s it! You’ve officially configured Termly’s CMP to work with Google Consent Mode.

Your site won’t place any cookies on users’ browsers who opted out of consent, but you’ll still receive anonymized, non-identifiable data to fill gaps and assist with your various campaign insights.

FAQ

What is Google Consent Mode?

Google launched Google Consent Mode in 2020 to give website owners more control over advertising and analytics cookies in relation to users’ consent preferences.

Instead of relying on internet cookies, Google Consent Mode introduces new tag settings that adapt based on each individual’s consent choice. With these tags enabled, Google Consent Mode can gather non-identifying, aggregate information about users who opt out of cookies.

Their algorithm uses data mapping technology to fill gaps in your conversions based on user consent choices.

You just need to use a compatible CMP, like ours, that’s certified to integrate seamlessly with all of Google Consent Mode’s revolutionary bells and whistles.

Currently, Google Consent Mode works with the following Google services:

  • Google Analytics
  • Google Ads
  • Floodlight
  • Conversion Linker

What is the advantage of Google Consent Mode?

The advantage of using a CMP that integrates with Google Consent Mode is that you won’t lose significant amounts of data due to consumers following through on their right to opt out of certain types of cookies and other trackers.

Google Consent Mode uses an incredibly smart algorithm that applies conversion modeling to your data sets to recover lost conversions caused by changes in your users’ consent preferences without relying on the use of internet cookies.

What’s a Google CMP Partner?

Google CMP Partners are a group of privacy compliance organizations that Google recognizes as offering consent management platforms or CMPs that easily enable websites to fully access all of Google Consent Mode’s features and benefits — like comprehensive data mapping.

Using an official Google CMP Partner like us for your consent management helps automate the entire process. We also support you if you need assistance with setup or basic troubleshooting.

How do businesses benefit from using a Google CMP Partner?

Businesses benefit from using an official Google CMP Partner for consent management because it’s the easiest way to access all the features of Google Consent Mode.

The partnership means Google recognizes that Termly’s CMP seamlessly integrates with Google Consent Mode so you can officially unlock and utilize its technology.

Plus, our support staff can help you with setup and basic troubleshooting!

Etienne Cussol CIPP/E, CIPM
More about the author

Written by Etienne Cussol CIPP/E, CIPM

Etienne is an Information Privacy professional and compliance analyst for Termly. He has been with us since 2021, managing our own compliance with data protection laws and participating in our marketing researches. His fields of expertise - and interest - include data protection (GDPR, ePrivacy Directive, CCPA), tracking technologies (third-party cookies, fingerprinting), and new forms of privacy management (GPC and the Google Privacy Sandbox). Etienne studied International Economic Affairs at the University of Toulouse, and graduated with a Masters in 2017. More about the author

Related Articles

Explore more resources