# Consent Management: Configuring Google Tag Manager

This tutorial is using an older, more manual approach in configuring Google Tag Manager. In most cases the [Consent Mode integration](/content/docs/consent/guides/google-tag-manager-consent-mode/index.html) is recommended.

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 Fides consent to ensure tags only fire with consent from a Tag Manager. In this example, we'll use Google Tag Manager, however, these steps are also applicable to similar tag managers such as Adobe Tag Manager and Tealium.

After reading this, you'll be familiar with how to configure tags to respect consent.

## Prerequisites [Permalink for this section](/content/docs/consent/guides/google-tag-manager#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 Google Tag Manager 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#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 a GTM Variable [Permalink for this section](/content/docs/consent/guides/google-tag-manager#create-a-gtm-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 the corresponding cookie key of the privacy notice you configured. In this example, we use `Fides.consent.data_sales_and_sharing`. Read about [creating cookie keys as part of privacy notices](/content/docs/consent/guides/privacy-notices#cookie-key/index.html) here.
4. Give the variable a suitable, identifiable name, such as `Fides.DataSalesAndSharing`. In certain cases, you may want to set a default value. For example, in opt-out consent, you would set the default value to `true`. See the example below:

Repeat this step to create a GTM variable for each of the cookie keys assigned to your privacy notices. You can define as many as you require but it's common to have variables for `data_sales_and_sharing`, `analytics`, `marketing`, `functional` and so on.

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

Many third-party tools rely on you to correctly configure their tags to fire depending on user consent. A single consent trigger tag ensures that a third-party tag only fires when a user’s consent is appropriately set.

1. Navigate to **Triggers** → **New** to create a new Trigger.
2. From the **Choose a trigger type** menu, select the appropriate trigger, this can be anything you choose but is typically **Page View** or **Custom Event**:

Ensure you use the appropriate trigger type for your tag. If your primary firing trigger is Page View based, use the Page View exception trigger. If your primary firing trigger is Custom Event based, use the Custom Event exception trigger.

3. Give the trigger a suitable, identifiable name, such as `Fides.DataSalesAndSharing.OptOut`
4. Set “This trigger fires on” to _**Some Page Views**_.
5. In the “Fire this trigger when…” option, set the following:
   - The event field to match your user-defined variable earlier (e.g. `Fides.DataSalesAndSharing`)
   - The evaluation to `equals`
   - The value to `false`

To suppress tags from firing where the user hasn't given consent, you can add your newly created trigger using the following steps:

1. Navigate to **Tags** and select the Tag you would like to add a consent trigger to.
2. Under **Triggering** you can add, remove or combine triggers. In this case, you are adding an exception that will suppress firing where you do not have consent. Select **Add Exception** to add your newly created trigger.
3. Select the consent trigger created earlier (e.g. `Fides.DataSales.Consent`), which will add it as an exception to your tag:

You should now see your trigger listed in your tag as an Exception. When configured as outlined in this tutorial, this tag will no longer fire if a user has opted out of Data Sales.

Repeat this step for any other tag you would like to apply consent to for any privacy notices you have configured for your organization in Fides.

## Configure Limited Data Use for Meta (Facebook) [Permalink for this section](/content/docs/consent/guides/google-tag-manager#configure-limited-data-use-for-meta-facebook/index.html)

Meta's implementation of data sales is unique to their platform, and requires specific configuration in Google Tag Manager.

To implement the Limited Data Use flag, the following modifications to your pixel are required:

1. Add the line below before the Facebook pixel is initialized `fbq('init', '{{YOUR_FACEBOOK_PIXEL_ID}}');`

Facebook Pixel Updates

```
   {{Fides.DataSalesAndSharing}} ? fbq('dataProcessingOptions', []) : fbq('dataProcessingOptions', ['LDU'], 0, 0);
   ```

##### Note about `<noscript>` tags [Permalink for this section](/content/docs/consent/guides/google-tag-manager#note-about-noscript-tags/index.html)

If your Meta pixel is using the `<noscript></noscript>` for non-javascript browsers, remove this from your pixel. Consent management solutions, like Fides, rely on JavaScript; this pixel would risk firing, causing noncompliance.

Save your changes. Your Limited Data Use is now configured!

[GTM with Consent Mode](/content/docs/consent/guides/google-tag-manager-consent-mode "GTM with Consent Mode"/index.html) [Adobe Experience Platform](/content/docs/consent/guides/adobe-experience-platform "Adobe Experience Platform"/index.html)
