Skip to content
Google Tag Manager Consent Mode

Consent Management: Configuring Google Tag Manager Consent Mode

10minFidesConsent Management
This tutorial requires Fides Cloud or Fides Enterprise. For more information, talk to our solutions team. (opens in a new tab)

In this tutorial, we'll configure Google Tag Manager (GTM) to respect the end-user consent choices provided by Fides.js.

Overview

GTM provides a feature called Consent Mode which is a framework that allows Consent Mode aware tags to adjust their behavior based on standardized user consent choices. The consent is gathered via Fides.js and provided to GTM using the Ethyca's Consent Mode Template (opens in a new tab).

For the integration to function correctly, the GTM container and the template need to be configured with:

  1. A new user-defined data layer variable named Fides to allow the template to access the user consent choices.
  2. A new Custom Event trigger that will fire on page events such a FidesInitialized
  3. A Consent Mode template and its corresponding tag

Prerequisites

For this tutorial you'll need:

  • A Fides Cloud or Fides Enterprise account
  • The role of Owner or Contributor for your Fides organization.
  • Update and publisher permissions on your GTM account.
  • At least one system with a data use on your Data Map. Read how to add systems to the Data Map now.
  • At least one privacy notice configured. Read how to configure privacy notices now.
  • At least one privacy experience configured. Read how to configure privacy experiences now.
  • Installed Fides.js on your web site. Read how to install fides.js now.

Create the Data Layer Variable

  1. Navigate to VariablesNew to create a new GTM Variable.
  2. From the Choose variable type menu, select Data Layer Variable as the type:
Create Data Layer Variable
  1. Set the Data Layer Variable Name to Fides as we will be passing the consent details to the template wholesale.
  2. Name the variable Fides and hit Save.
Resulting Data Layer Variable

Configure a Trigger

The next step is to create a Custom Event trigger that will allow the template to respond to Fides.js events and keep the user consent up to date on the GTM side.

  1. Navigate to TriggersNew to create a new Trigger.
  2. From the Choose a trigger type menu, select Custom Event:
Select Trigger Type
  1. Give the trigger a suitable, identifiable name, such as Fides Events
  2. Check Use regex matching and enter ^Fides in the event name field. This allows us to use a single trigger for all of the Fides events.
Trigger Configuration

Add and configure the consent mode template

  1. Visit the template repository (opens in a new tab) and download the template.tpl file to your computer.
  2. In GTM, navigate to TemplatesNew
  3. In the meatball dropdown menu select Import and upload the template file.
Template import
  1. Click Save and close the template editor.
  2. Navigate to TagsNew
  3. Click on the Tag Configuration block and select the template (Ethyca CMP) you just added from the Custom section
  4. Click on the Triggering block and select both Consent Initialization - All Pages and the custom Fides Events trigger you added earlier.
  5. Give the tag a name, such as Ethyca CMP, click Save and you're done!
Template Tag Completed
  1. Optionally, look through Consent Defaults and Regional Consent Defaults sections to review the default consent values. These will be used in case there's a problem with Fides.js and the user's consent cannot be determined. The regional defaults take precedence over Consent Defaults.

Ensure your tags respect the user's consent

Visit Tags and select the Tag you would like to review. In Tag Configuration under Advanced Settings there is a section called Consent Settings. For a Tag that uses the built-in consent checks it will look similar to the screenshot below.

Built-in Consent Settings

If no built-in consent checks are listed, you can configure these yourself in the Require additional consent for tag to fire section. In case you want to use a non-standard consent key, the previous approach described in Configuring Google Tag Manager can be used together with the Consent Mode template.