Skip to content

Consent Management: Configuring Google Tag Manager

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 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.


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 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 a GTM 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 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 here.
  2. 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:
Name the Data Layer Variable

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

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 TriggersNew 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:
Select Trigger Type

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.

  1. Give the trigger a suitable, identifiable name, such as Fides.DataSalesAndSharing.OptOut
  2. Set “This trigger fires on” to Some Page Views.
  3. 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
Trigger Configuration

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.
Pinterest Sample Tag
  1. Select the consent trigger created earlier (e.g. Fides.DataSales.Consent), which will add it as an exception to your tag:
Select Exception 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.

GTM Exception Tag

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)

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:

GTM Exception Tag
  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

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!