# Consent Management: Configuring Google Tag Manager Consent Mode

This tutorial requires Fides Cloud or Fides Enterprise. For more information, [talk to our solutions team. (opens in a new tab)](/content/speak-with-us?utm_source=docs-site/index.html)

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

## Overview [Permalink for this section](/content/docs/consent/guides/google-tag-manager-consent-mode#overview/index.html)

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)](https://github.com/ethyca/gtm-template).

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 as `FidesInitialized`
3. A Consent Mode template and its corresponding tag

## Prerequisites [Permalink for this section](/content/docs/consent/guides/google-tag-manager-consent-mode#prerequisites/index.html)

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](/content/docs/data-mapping/guides/adding-systems-manually/index.html) now.
- At least one privacy notice configured. Read how to [configure privacy notices](/content/docs/consent/guides/privacy-notices/index.html) now.
- At least one privacy experience configured. Read how to [configure privacy experiences](/content/docs/consent/concepts/fundamentals/privacy-experiences/index.html) now.
- Installed `Fides.js` on your web site. Read how to [install fides.js](/content/docs/consent/guides/install-fides/index.html) now.

## Regulation information [Permalink for this section](/content/docs/consent/guides/google-tag-manager-consent-mode#regulation-information/index.html)

In Spring 2025, a German court ruled that Google Tag Manager cannot be included on any page without consent. This ruling is available in German [here (opens in a new tab)](https://www.juris.de/static/infodienst/autoren/D_NJRE001608982.htm).

When implementing Fides and Google Tag Manager for use in Europe and Germany specifically, seek the advice of your legal counsel on the proper implementation. In response to their advice, you may wish to load the GTM javascript only after consent is obtained from Fides. To accomplish this, ensure that Fides is loaded and initialized before Google Tag Manager. You can read more about this in the Fides.js documentation [here](/content/docs/consent/guides/install-fides/index.html).

Once Fides is initialized, you should defer any loading of GTM javascript until after consent is obtained. The specific consent you wish to use to load GTM is a choice you and your legal counsel will need to make. Once you have obtained the agreed upon consent, you can check for it using the [Fides interface](/content/docs/privacy-center-fidesjs/fidesjs/reference/interfaces/Fides#consent/index.html) and load GTM based on the user's consent.

## Create the Data Layer Variable [Permalink for this section](/content/docs/consent/guides/google-tag-manager-consent-mode#create-the-data-layer-variable/index.html)

1. Navigate to **Variables** → **New** to create a new GTM Variable.
2. From the **Choose variable type** menu, select **Data Layer Variable** as the type:

3. Set the Data Layer Variable Name to `Fides` as we will be passing the consent details to the template wholesale.
4. Name the variable `Fides` and hit **Save**.

## Configure a Trigger [Permalink for this section](/content/docs/consent/guides/google-tag-manager-consent-mode#configure-a-trigger/index.html)

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 **Triggers** → **New** to create a new Trigger.
2. From the **Choose a trigger type** menu, select **Custom Event**:

3. Give the trigger a suitable, identifiable name, such as `Fides Events`
4. 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.

## Add and configure the consent mode template [Permalink for this section](/content/docs/consent/guides/google-tag-manager-consent-mode#add-and-configure-the-consent-mode-template/index.html)

1. Visit the [template repository (opens in a new tab)](https://github.com/ethyca/gtm-template) and download the `template.tpl` file to your computer.
2. In GTM, navigate to **Templates** → **New**
3. In the meatball dropdown menu select **Import** and upload the template file.

4. Click **Save** and close the template editor.
5. Navigate to **Tags** → **New**
6. Click on the **Tag Configuration** block and select the template (Ethyca CMP) you just added from the **Custom** section.
7. Click on the **Triggering** block and select both **Consent Initialization - All Pages** and the custom Fides Events trigger you added earlier.
8. Give the tag a name, such as `Ethyca CMP`, click **Save** and you're done!

9. 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 [Permalink for this section](/content/docs/consent/guides/google-tag-manager-consent-mode#ensure-your-tags-respect-the-users-consent/index.html)

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.

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](/content/docs/consent/guides/google-tag-manager/index.html) can be used together with the Consent Mode template.

[Google Consent Mode v2](/content/docs/consent/guides/google-consent-mode-v2 "Google Consent Mode v2"/index.html) [Google Tag Manager](/content/docs/consent/guides/google-tag-manager "Google Tag Manager"/index.html)
