What this article covers
This article explains how to make Google Tag Manager (GTM) tags fire only when a visitor has given consent through the Usercentrics CMP. It covers two configuration methods, when to use each, and how to verify everything is working.
Important:
Google Consent Mode only affects the tracking behavior of Google products. Non-Google scripts and tags must be configured to be consent-aware using Option A: Consent Variable + Trigger.
Before starting, confirm all of the following:
- The Usercentrics CMP script is installed on your website. If not: Implementing Usercentrics CMP v3 using Google Tag Manager
- Google Consent Mode is enabled in your Usercentrics Admin Interface under Configuration > CMP Settings.
- The service you want to configure (e.g. Google Analytics 4) has been added to your Usercentrics Admin Interface under Data Processing Services.
- You know the exact service name as it appears in the Usercentrics Admin Interface, including spelling, capitalization, and hyphenation.
- The GTM tag for that service already exists (or you are creating it now).
Which method should I use?
| I am implementing… | Use |
|---|---|
| Google tags with built-in Consent Mode support: Google Ads, Google Analytics 4, Floodlight, Conversion Linker | Option B: GTM Consent Settings |
| Other tags and services: LinkedIn, Hotjar, Facebook Pixel, etc. | Option A: Consent Variable + Trigger |
Option A: Consent Variable + Trigger (recommended for most services)
Use this method for third-party services such as Facebook Pixel, LinkedIn Insight Tag, or Hotjar. You will create three components and link them together: a Tag, a Variable, and a Trigger.
Step 1: Create the Tag
- In GTM, go to Tags and click New
- Name the tag after the service, for example,
Facebook Pixel Tag. - Click Tag Configuration. Select the matching template if one exists in the gallery (for example, LinkedIn Insight Tag). If no template exists, as with Facebook Pixel, select Custom HTML.
- Copy and paste the
Facebook Pixeltracking snippet into the HTML field. - Save the tag. You will add the trigger in Step 3.
Step 2: Create the Consent Variable
This variable reads the visitor's consent status for this specific service from the GTM data layer.
- Go to Variables → User-Defined Variables and click New.
- Name the variable after the service, for example,
Facebook Pixel Variable. - Click Variable Configuration and select Data Layer Variable.
-
In the Data Layer Variable Name field, enter the exact service name from your Usercentrics Admin Interface. For example, if the service is named
Facebook Pixelin the Usercentrics Admin Interface, enterFacebook Pixel.⚠️ The name must match exactly, including spelling, capitalization, and hyphenation. A mismatch means the variable will always return
falseand the tag will never fire. -
Check Set Default Value and set the default to
false. - Save the variable.
Step 3: Create the Consent Trigger
This trigger listens for the Usercentrics consent event and checks whether the visitor has opted in for this specific service.
- Go to Triggers and click New.
- Name the trigger, for example,
Facebook Pixel Trigger. - Click Trigger Configuration and select Custom Event.
- In the Event Name field, enter
consent_status.*and check Use regex matching. - Under This trigger fires on, select Some Custom Events.
-
Set the condition:
Facebook Pixel Variablecontainstrue. This ensures the trigger only fires if the visitor has consented to this service. If they have not consented, the variable returnsfalseand the tag does not fire. Save the trigger.
Step 4: Connect the Trigger to the Tag
- Open the Facebook Pixel tag you created in Step 1.
- In the Triggering section, remove the default All Pages trigger.
- Add the Facebook Pixel consent trigger you created in Step 3.
- Save the tag.
- Publish your GTM container to make the changes live.
Why this matters: The tag should be triggered by the Usercentrics consent_status.* event rather than by a page-view trigger such as All Pages. This allows the tag to fire when Usercentrics makes the visitor's consent status available, including when a returning visitor's stored consent is restored.
Please note
Repeat for each service. Each service needs its own variable and trigger. The structure is always the same, only the service name changes.
Option B: GTM's Built-in Consent Settings (Google tags only)
Use this method only for Google tags that support Consent Mode natively, such as Google Ads, Google Analytics 4, Floodlight, and Conversion Linker. These tags support Advanced Consent Mode natively and have built-in consent checks.
Please note
This method does not apply to non-native Google tags. For tags such as Facebook Pixel, LinkedIn, or Hotjar, use Option A: Consent Variable + Trigger.
Step 1: Create the consent trigger
The consent_status.* trigger listens for the consent update sent by Usercentrics. Use it to ensure that native Google tags are triggered when Usercentrics makes the visitor's updated consent state available.
- Go to Triggers and click New.
- Name it, for example,
Consent Status. - Select Custom Event as the trigger type.
- Enter
consent_status.*in the Event Name field and check Use regex matching. - Leave This trigger fires on set to All Custom Events.
- Save the trigger.
Important:
This trigger does not replace the Google tag's built-in consent checks. It triggers the tag when Usercentrics sends the consent update, the Google tag then applies its built-in Consent Mode behavior based on the consent state.
Step 2: Connect the trigger to the tag
- Open the Google tag (e.g. your GA4 Configuration tag).
- In the Triggering section, remove the tag's existing trigger and add the Consent Status trigger from Step 1.
- Go to Advanced Settings → Tag firing options and leave it set to Once per page.
- Save the tag and publish your container.
Why this works: the tag only needs to fire once, to initialize its underlying script with whatever consent state exists at that moment, even if that's the default denied state. From then on, Usercentrics pushes every consent change directly to that already-running script via Google's native consent update call, independent of GTM's tag firing. The tag doesn't need to fire again for the update to reach it.
For a deeper explanation of the difference between Basic and Advanced Consent Mode, see Advanced and Basic Google Consent Mode v2.
How to verify your setup
After publishing, use the Google Consent Mode Checker in your Usercentrics Admin Interface to confirm your implementation is correct:
- Log into the Usercentrics Admin Interface.
- Go to Configuration → CMP Settings.
- Scroll to the Google Consent Mode Status section and run a check.
You can also verify using Google Tag Assistant:
- Open tagassistant.google.com and enter your website URL.
- Check that the
consent_statusevent appears in the event list. -
Click the Consent tab and confirm the parameter values are set correctly for both the default and update events.
Frequently asked questions (FAQ)
- Confirm the service name in the GTM variable exactly matches the name in the Usercentrics Admin Interface, including capitalization and hyphens.
- Confirm the variable default value is set to
false. - Confirm the trigger uses
consent_status.*with regex matching enabled. - Confirm the trigger condition is set to contains
true(not "equals"). - Confirm the visitor has actually consented to the service in the Usercentrics banner.
- Confirm your GTM container changes have been published (not just saved).
- If still failing, run the Google Consent Mode Checker to identify configuration issues.
Immediately on page load. For returning visitors, Usercentrics reads their stored consent preferences and fires the consent_status event as soon as the page loads, no banner is shown because their choice is already known. The tag fires instantly without any user interaction required.
It depends on which method you are using:
- Option A (Basic Consent Mode): No. Each tag needs its own trigger with its own variable condition, because the condition checks the consent status for a specific service.
- Option B (Advanced Consent Mode): Yes. The Consent Status trigger has no service-specific condition, so it can be shared across multiple native Google tags.
A data drop after implementing consent is expected and normal, tags now only fire when visitors consent. See Less GA4 data after implementing Google Consent Mode v2 for an explanation and ways to recover data using Advanced Consent Mode.
Glossary
- Consent-aware tag
A GTM tag configured to fire only after Usercentrics has confirmed that the visitor consented to that specific service.
- Basic Consent Mode
The tag is fully blocked until the visitor gives explicit consent. No data is sent before consent. This is what Option A configures.
- Advanced Consent Mode
The tag always loads but adjusts its behavior based on consent signals. Built into native Google tags. No manual variable or trigger setup needed for those tags.
- Data Processing Service (DPS)
Any service registered in the Usercentrics Admin Interface under Data Processing Services. The service name entered there must be used exactly when creating GTM variables.
- consent_status event
The GTM data layer event that Usercentrics fires once it knows the visitor's consent choices, either when they submit the banner on a first visit, or immediately on page load for returning visitors whose preferences are already stored.
- Data Layer Variable
A GTM variable that reads a value from the GTM data layer. Used here to check whether a visitor has consented to a specific service, returning
trueorfalse.