Consent Mode in Google Tag Manager

Consent mode (beta) allows you to adjust how your Google tags behave based on the consent status of your users. You can indicate whether consent has been granted for Analytics and Ads cookies. Google's tags will dynamically adapt, only utilizing measurement tools for the specified purposes when consent has been given by the user.

Products that support consent mode include:

  • Google Ads*
  • Floodlight
  • Google Analytics

* includes Google Ads Conversion Tracking and Remarketing; support for Phone Call Conversions pending

You can find further information about Consent mode here.

Sections

CookieHub and Consent mode

CookieHub has built-in support for Consent mode for Google Tag Manager and no changes are required to enabling it when using the CookieHub GTM template. When using Consent mode, you should not use the CookieHub GTM recipe as you will use normal GTM triggers for your tags.

Supported consent types

Consent mode type Linked CookieHub category
security_storage Necessary
functionality_storage Preferences
personalization_storage  Preferences
analytics_storage Analytics
ad_storage Marketing

How to setup CookieHub in Google Tag Manager with Consent mode

Please note that the CookieHub template for Google Tag Manager is currently pending review and approval. Once approved, you will be able to locate the CookieHub template in the Community Template Gallery but until then, an additional step is required to import the template in GTM.

CookieHub GTM template repository on Github

Install the CookieHub template

1. Download the CookieHub template here or from the offical CookieHub repository on Github

2. Log into Google Tag Manager, select your Tag manager container and click the Templates link in the left menu.

3. Click the New button in the Tag Templates section.

4. Click the three dots in the top right corner and select Import.

5. Select the template.tpl file previously downloaded. The template will now be imported and you should see the name, description and other fields populate.

6. Click the Save button in the top right corner and close the Template Editor.

Create the CookieHub tag

You will have to create a CookieHub tag in your Google Tag Manager container to load the CookieHub widget. This tag uses the previously imported CookieHub template.

1. Log into Google Tag Manager, select your Tag manager container and click the  Tags link in the left menu.

2. Click the New button in the Tags section:

3. Click the Tag Configuration section, scroll down to the Custom tag types and click the CookieHub tag:

4. Type your 8 character CookieHub domain code (you can find the code in the Overview tab for your domain in the CookieHub dashboard) and check the Enable Consent Mode checkbox:

Optionally you can change the default consent state for each consent type. By default, only the security_storage consent type is granted.

5. Select Consent Initialization - All Pages as the Firing Trigger and save the tag.

If all tags in your Google Tag Manager container support Consent mode, you don't have to do anything more and can go ahead and publish the changes. If you have other tags that need to be conditionally loaded based on consent state, follow the next section to create the additional consent state updated trigger.

Create consent updated trigger

When tags don't have built-in Google Consent mode support we can use the Additional Consent Checks as described in the next section but we will need an additional trigger in Google Tag Manager to trigger these tags so that they trigger after CookieHub has set the correct initial consent state or when the user changes his cookie consent using the CookieHub dialogs.

1. Log into Google Tag Manager, select your Tag manager container and click the  Triggers link in the left menu.

2. Click the  New button in the Triggers section:

3. Click the  Trigger Configuration section and select the Custom Event trigger type:

4. Type  cookiehub_consent_update in the Event name field and leave everything else unchanged:

5. Save the trigger and set the name to something descriptive like  CookieHub - Consent Update


Using Additional Consent Checks for tags that don't have built-in Google Consent mode support

Please note that only a few tags have built-in Google Consent mode support. For other tags, we'll have to use the Additional Consent Checks feature in Google Tag Manager that can be used with any tags. In this example, we're using the Facebook Pixel tag type.

1. Log into Google Tag Manager, select your Tag manager container and click the  Tags link in the left menu.

2. Click the tag that you want to modify:

3. Click the Tag Configuration section, scroll down and expand Advanced Settings

4. Expand Consent Settings and click the Require additional consent for tag to fire radio box.

5. Click the Add required consent button and select the consent type that you want to use with this tag:

6. Change the Firing Trigger for this tag to CookieHub - Consent Update:

7. Save and publish the Tag Manager container and you're all set. Repeat these steps for all tags that don't have built-in Consent Mode support.

Still need help? Contact Us Contact Us