Consent tool guide · Complianz
Meta Pixel and Complianz: fire only after cookie consent
For the findings “Meta Pixel fires before cookie consent” and “Meta Pixel does not fire after cookie consent”. See also the general guide.
What goes wrong with Complianz and the Meta Pixel
A working setup does two things: the Meta Pixel (still often called the Facebook Pixel) sends nothing while the Complianz banner is waiting for an answer, and it sends a PageView right after the visitor accepts marketing cookies, on the same page. Broken setups usually fail in one of two ways:
- The pixel fires before consent. The pixel reaches the page by a route Complianz does not control: a Google Tag Manager (GTM) tag on “All Pages”, a plugin that loads the pixel from its own JavaScript file, or a banner that treats the visitor’s region as opt-out.
- The pixel stays silent after consent. The pixel is blocked correctly, but its GTM tag waits for the wrong event, or GTM is added outside Complianz so the consent events never reach it.
In our scan of showcase sites, one of the four Complianz sites with a Meta Pixel sent pixel data before the visitor answered the banner. Four sites is far too few for a rate, so treat this only as a reminder to test your own setup.
We report technical behaviour only; we cannot tell you whether your setup is legally compliant. This guide covers the Complianz plugin for WordPress.
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 a fresh private window, deny cookies. No
facebook.com/trrequests should appear.
Meta Ads Data Advisor (formerly Meta Pixel Helper), Meta’s Chrome extension, shows the same events. Before consent it may report “We detected event code but the pixel has not activated for this event, so no information was sent to Meta”. Complianz explains that this is expected: it keeps the pixel code on the page as text/plain and only runs it after consent.
How to fix it
First find every copy of the pixel: search the page source for fbevents.js and fbq(, and check your GTM container, theme settings and plugins. Choose one of the routes below and remove the other copies.
Pixel in Google Tag Manager
- Let Complianz add GTM. In Complianz > Wizard > Consent > Statistics, choose Yes, and Google Tag Manager fires this script, then enter your container ID under Statistics configuration. Complianz needs this to send its consent events to GTM correctly. Remove any GTM snippet you added by hand; if you use the GTM4WP plugin, switch its container off and disable its integration under Complianz > Integrations > Plugins.
- For Google Consent Mode, add the Complianz template from GTM’s Community Template Gallery on the Consent Initialization - All Pages trigger. (Complianz’s Consent Mode guide says its steps require Complianz Premium.)
- Give the Meta tag a Custom Event trigger for
cmplz_event_marketing(import Complianz’s GTM container or create the trigger yourself), and remove All Pages. - Under Advanced Settings > Tag firing options, choose Once per page, so a visitor who changes their choice does not send a second
PageView.
Why this works: Consent Mode only adjusts Google tags with built-in consent checks, so a Meta tag needs its own consent condition. In most consent tools that would be GTM’s Consent Settings with ad_storage, but Complianz states that it does not support these additional consent checks and that non-Google tags should rely only on its custom event triggers. The cmplz_event_marketing event fires once marketing consent is given, so the tag fires right after the click instead of being checked once on page load.
If you use the simple Accept/Deny banner instead of categories, Complianz says the Accept choice can be picked up with cmplz_event_0 and/or cmplz_event_marketing. Check in GTM Preview which event your Accept button sends.
Pixel in your theme or site code
- Let Complianz block it. In Complianz > Wizard > Consent > Services, answer yes to “Does your website contain embedded social media content, like buttons, timelines, videos or pixels?” and select Facebook. Complianz then keeps the pixel code as
text/plainuntil the visitor accepts marketing cookies. - Or move it into the Script Center. Under Complianz > Integrations > Script Center, use Add a third-party script, paste the pixel code without the opening and closing
<script>tags, and choose the Marketing category. Complianz then adds it only after consent. Delete the original copy from your theme. - Or block it where it is. Use Block a script, iframe or plugin with a unique part of the pixel code, such as
connect.facebook.net, and the Marketing category. Avoid terms so broad that they also block other scripts.
The pixel has no visible element, so it needs no placeholder; placeholders are for embeds such as videos and maps.
Pixel added by a plugin
Complianz ships integrations for a number of pixel and shop plugins. Check that yours is listed and enabled under Complianz > Integrations > Plugins. If the plugin supports the WP Consent API, install the WP Consent API plugin so it can read Complianz’s marketing consent. Two cautions from Complianz’s documentation:
- Without a consent plugin setting the consent type, the WP Consent API reports every category as allowed.
- A plugin that builds the pixel inside a bundled or minified JavaScript file can hide the pixel’s address, so blocking by URL may not catch it.
Common causes
Pixel fires before consent:
- The pixel is in the theme or a code-snippet plugin, Facebook is not selected in the wizard, and the Script Center has no rule for it.
- The Meta tag in GTM fires on All Pages.
- Complianz treats the visitor’s region as opt-out. In opt-out regions, Complianz triggers all categories before consent by default.
- A pixel plugin is not integrated with Complianz and does not use the WP Consent API.
Pixel silent after consent:
- GTM is added by hand or by another plugin instead of through the Complianz wizard, so the Meta tag waits for events that do not arrive.
- The Meta tag waits for the wrong event, for example a category event your banner does not use.
- A caching or optimisation plugin delays JavaScript, which Complianz warns can affect consent tracking. Exclude Complianz’s scripts from those features.
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
cmplz_event_marketingappears and the Meta tag fires on it. 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?
Google Consent Mode passes the visitor’s choice to Google tags, which adjust their own behaviour. A Meta Pixel tag has no built-in consent check, and Complianz does not support GTM’s additional consent checks, so in Google Tag Manager the Meta tag relies on Complianz’s cmplz_event_marketing trigger. Outside GTM, Complianz blocks the pixel script itself.
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
- Complianz, Integrations: Script Center, Plugins and Services: https://complianz.io/help/wordpress/configuration/integrating-plugins/
- Complianz, Definitive Guide to Tag Manager and Complianz: https://complianz.io/help/wordpress/integrations/definitive-guide-to-tag-manager-and-complianz/
- Complianz, Simplified Guide to Google Consent Mode v2: https://complianz.io/help/wordpress/integrations/simplified-guide-to-google-consent-mode-v2/
- Complianz, Consent Mode for Complianz 7: https://complianz.io/help/wordpress/configuration/consent-mode-for-7-0/
- Complianz, WP Consent API and Complianz: https://complianz.io/help/wordpress/integrations/wp-consent-api/
- Complianz, “We detected event code but the pixel has not activated for this event”: https://complianz.io/help/wordpress/faq/we-detected-event-code-but-the-pixel-has-not-activated-for-this-event-so-no-information-was-sent-to-meta/
- Google Tag Manager Help, Tag Manager consent mode support: https://support.google.com/tagmanager/answer/10718549
- Meta for Developers, General Data Protection Regulation (consent API): https://developers.facebook.com/docs/meta-pixel/implementation/gdpr
- Meta for Developers, Meta Ads Data Advisor (formerly Meta Pixel Helper): https://developers.facebook.com/docs/meta-pixel/support/pixel-helper