Consent tool guide · Usercentrics
Meta Pixel and Usercentrics: fire only after cookie consent
For the findings that a pixel fires before cookie consent or does not fire after it. See also the general guides for Meta, TikTok and OpenAI.
What goes wrong with Usercentrics and the Meta Pixel
A working setup does two things: the Meta Pixel sends nothing while the Usercentrics banner is waiting for an answer, and it sends a PageView right after the visitor accepts, on the same page. Broken setups usually fail in one of two ways:
- The pixel fires before consent. The pixel is not linked to Usercentrics at all: its script tag is unchanged, its Google Tag Manager (GTM) tag fires on “All Pages”, or the blocking script loads after it.
- The pixel stays silent after consent. The pixel is linked to a service name that does not exist in your Usercentrics configuration, or its GTM trigger runs before the visitor has clicked anything.
Usercentrics stores consent per Data Processing Service (for example a service called “Facebook Pixel”), not only per category. Almost every step below depends on using that service name exactly as it appears in your Admin Interface, including capitals and spaces.
In our scan of showcase sites, none of the five Usercentrics sites with a Meta Pixel sent pixel data before the visitor answered the banner. Five sites is far too few to call the problem rare, so test your own setup anyway.
We report technical behaviour only; we cannot tell you whether your setup is legally compliant.
This guide follows the current Usercentrics Web CMP (v3) documentation. If you still run CMP v2 (the Browser UI loader from app.usercentrics.eu), script URLs and some menus differ, so check the documentation for your version.
How to check your site
- Open a private (incognito) window, open developer tools (F12), go to the Network tab and type
facebook.com/trinto the filter. If your banner only appears in some countries, test from one of them (for example with a VPN). - Load the page and do not touch the banner. Any
facebook.com/trrequest at this point means the pixel fires before consent. - Accept all. Within a few seconds you should see a request with
ev=PageViewon the same page. If it only appears after you open another page, you lose the first page view of every new visit. - In the Console tab, type
dataLayerand open the latestconsent_statusentry. The key with your Meta service name should betrueafter you accept. - In a fresh private window, deny all. No
facebook.com/trrequests should appear.
Meta Ads Data Advisor (formerly Meta Pixel Helper), Meta’s Chrome extension, shows the same events if you prefer not to read network requests.
How to fix it
Or connect it by hand:
First check that the Meta Pixel service is added in the Admin Interface under Data Processing Services, and note its exact name. Then find every copy of the pixel: search the page source for fbevents.js and fbq(, and check your GTM container, plugins and shop apps. Choose one of the routes below and remove the other copies.
Pixel in Google Tag Manager
Usercentrics documents a variable and trigger setup for non-Google tags:
- Create a Data Layer Variable whose Data Layer Variable Name is the exact service name, for example
Facebook Pixel. Tick Set Default Value and set it tofalse. - Create a Custom Event trigger with the event name
consent_status.*and Use regex matching ticked, set to fire on Some Custom Events when the variable containstrue. - Make this the Meta tag’s only firing trigger and remove All Pages. Usercentrics fires the consent event when the visitor decides and when a returning visitor’s stored consent is restored, so the tag fires on the first page in both cases.
- Under Advanced Settings > Tag firing options, choose Once per page, so the tag does not run again on later consent events.
Why not rely on Google Consent Mode? Usercentrics states that Consent Mode only affects Google products, and GTM only checks a tag’s Consent Settings at the moment the tag is triggered. A Meta tag on All Pages is checked once, before the click, and never again on that page. If you add ad_storage under Require additional consent for tag to fire anyway, check in Preview that accepting your Meta service actually grants it, otherwise the tag stays blocked.
Pixel in your site code or a CMS (manual blocking)
If you do not use auto-blocking, change the pixel’s script tag in two ways: set the type to text/plain, and add the data-usercentrics attribute with the exact service name:
<script type="text/plain" data-usercentrics="Facebook Pixel">
// Meta Pixel base code, unchanged
</script>
Both parts matter. Without the type change, the script runs as normal. Without the attribute, Usercentrics cannot match the script to a service and it never runs, even after consent. Place the Usercentrics script before any third-party scripts that need consent, apply the markup to every copy of the base code, and test that the pixel starts on the same page, without a reload, after the visitor accepts.
Auto-blocking or the Smart Data Protector
Usercentrics offers two automatic options. Use one of them, never both: Usercentrics warns that they interfere with each other.
- Auto-blocking. Add Usercentrics’s auto-blocker script before the CMP script, as the first script on the page, ahead of everything else. No markup on the pixel is needed. Auto-blocking takes its instructions from scans of your domain, so it is not effective until a scan has run, and the domain should be rescanned after you add or change tags.
- Smart Data Protector. Add the
uc-block.bundle.jsscript synchronously (noasyncordefer), before all other third-party scripts. It recognises services from a repository of known technologies, and Facebook Pixel is on that list, but only services that are also added in your Admin Interface are handled.
Either way, a pixel that loads before the blocking script, or a copy injected by GTM without the trigger setup above, can still fire before consent.
TikTok Pixel and OpenAI Pixel with Usercentrics
The same rules apply to the TikTok Pixel and to the OpenAI Pixel (the ChatGPT Ads Measurement Pixel): nothing may be sent while the banner waits, and a page view should leave right after the visitor accepts marketing cookies, on the same page. To check them, filter the Network tab by analytics.tiktok.com/api (TikTok) or bzr.openai.com (OpenAI) instead of facebook.com/tr. Two differences from the Meta Pixel matter:
- The OpenAI pixel assumes consent. OpenAI’s documentation says it starts with consent set to
trueunless your site sets it tofalse. Pasted as it is, it measures from the first page load. - Paused events are handled differently. TikTok’s consent mode queues events while consent is on hold and sends them once you grant it. OpenAI drops events that were blocked while consent was
falseand does not send them later, andoaiq("consent", false)deletes the pixel’s cookies, including the stored ChatGPT ad click.
For OpenAI, the simplest route is therefore to keep the whole snippet from loading until the visitor accepts: then it cannot set cookies or measure early. OpenAI’s installation snippet only loads and initializes the pixel, so put your oaiq("measure", "page_viewed", { type: "contents" }) call inside the same blocked script; it then runs once the script is released.
Add a service for each pixel
Usercentrics links scripts to Data Processing Services. Add one for the TikTok Pixel and one for the OpenAI pixel in the Admin Interface, and note their exact names. If the service database has no template for one of them, create a custom service in the marketing category.
TikTok and OpenAI tags in Google Tag Manager
Repeat the Meta setup above for each service: a Data Layer Variable named exactly like the service (default value false), the consent_status.* Custom Event trigger firing when that variable contains true, no All Pages trigger, and Once per page. Neither TikTok’s TikTok Pixel template nor OpenAI’s own GTM template handles consent by itself.
TikTok and OpenAI code on the page
Mark each snippet with type="text/plain" and its own service name:
<script type="text/plain" data-usercentrics="TikTok Pixel">
// TikTok Pixel base code, unchanged (it ends with ttq.page())
</script>
<script type="text/plain" data-usercentrics="OpenAI Pixel">
// OpenAI Pixel snippet, unchanged, followed by:
oaiq("measure", "page_viewed", { type: "contents" });
</script>
The service names here are examples: use the exact names from your Admin Interface; without a matching name the script never runs. Once released, TikTok’s ttq.page() and your OpenAI page_viewed call send the page views.
To use TikTok’s consent mode instead, leave the TikTok script unmarked. TikTok’s base code then calls ttq.holdConsent() before ttq.load(), with "holdConsent", "revokeConsent", "grantConsent" added to its ttq.methods list (the standard snippet does not include them). Call ttq.grantConsent() from Usercentrics’ consent event (UC_CONSENT in the current Web CMP) when the TikTok service has consent.
Auto-blocking or the Smart Data Protector
Both only handle services you have added in the Admin Interface, and the Smart Data Protector only recognises technologies in its repository. Check in a private window that the TikTok and OpenAI scripts wait for consent; mark the OpenAI snippet manually if it is not recognised.
Common causes
Pixel fires before consent:
- The pixel’s script tag has no
type="text/plain", and neither auto-blocking nor the Smart Data Protector is active. - The auto-blocker or Smart Data Protector script loads after the pixel, or with
async. - The Meta tag in GTM fires on All Pages with no consent trigger.
- A plugin or app adds its own browser pixel next to yours.
Pixel silent after consent:
- The
data-usercentricsvalue or the GTM variable name does not match the service name exactly (for example “Meta Pixel” in the code and “Facebook Pixel” in the Admin Interface). Usercentrics notes that a mismatched variable always returnsfalse, so the tag never fires. - The Meta tag requires
ad_storagebut is only triggered by All Pages. - Auto-blocking and the Smart Data Protector are both active and interfere with each other.
How to verify
- Repeat the private-window test: no requests before you answer the banner, a
PageViewwithin a few seconds after you accept (on the same page), and nothing after you deny. - If you use GTM, open Preview, accept the banner and check that the Meta tag fires on a
consent_statusevent. Then reload: for a returning visitor who already accepted, the tag should fire without any click. - Re-run the check on IsPixelWorking.
Questions people ask
Is there a consent mode for Meta?
Meta’s counterpart is the pixel’s consent API: fbq('consent', 'revoke') before fbq('init', ...) pauses sending, and fbq('consent', 'grant') resumes it. The routes in this guide block the pixel until consent instead, so you do not need these commands with them.
What is the difference between Google Consent Mode and consent controls for the Meta Pixel?
Usercentrics states that Consent Mode only affects Google products. A Meta Pixel tag has no built-in consent check, so it needs its own control: the consent_status trigger in Google Tag Manager, data-usercentrics markup, or auto-blocking.
Can blocking the Meta Pixel affect ad tracking and performance?
Yes. While the pixel waits, Meta receives no pixel events from that visitor, and visitors who reject send none at all, so reported conversions, retargeting audiences and the data Meta optimizes on are smaller. That is why the setups above release the pixel on the same page as soon as the visitor accepts, not one page later.
Sources
- Usercentrics Support, How to Configure Google Tag Manager Tags to be Consent-Aware
- Usercentrics Support, Manual implementation and markup guide
- Usercentrics Support, The Smart Data Protector vs. Auto-blocking
- Usercentrics Docs, Script implementation (adjust third-party scripts)
- Usercentrics Docs, Smart Data Protector
- Usercentrics Docs, Google Tag Manager configuration
- Usercentrics Docs, consent_status event
- Google Tag Manager Help, Tag Manager consent mode support
- Meta for Developers, General Data Protection Regulation (consent API)
- Meta for Developers, Meta Ads Data Advisor (formerly Meta Pixel Helper)
- Usercentrics, Direct implementation (
type="text/plain",data-usercentricswith the exact service name) - Usercentrics, UC_CONSENT event
- TikTok API for Business, Pixel Cookie consent mode (
holdConsent,grantConsent,revokeConsent, queued events) - TikTok on GitHub, TikTok Pixel GTM template (no consent fields)
- OpenAI Developers, Measurement Pixel (consent defaults to
true, blocked events are not replayed,oaiq("consent", false)removes the pixel’s cookies) - OpenAI on GitHub, Ads Measurement Pixel GTM template (no consent call)
Fix guides for consent findings
- Meta Pixel fires before cookie consent: how to fix it
- Meta Pixel not firing after cookie consent: how to fix it
- TikTok Pixel fires before cookie consent: how to fix it
- TikTok Pixel not firing after cookie consent: how to fix it
- OpenAI Pixel fires before cookie consent: how to fix it
- OpenAI Pixel not firing after cookie consent: how to fix it