DEV Community

Meta Pixel firing before cookie consent: check and fix

Short answer: Clear cookies, load your site, and don't touch the banner. If DevTools shows requests to facebook.com/tr, or a _fbp cookie appears, the pixel runs before consent.

Fix: fire it only after the consent event, or call fbq('consent', 'revoke') before fbq('init') and fbq('consent', 'grant') on accept.

How do I check in 3 minutes?

Open a private window and DevTools, Network tab, filter on facebook. Load your homepage and a second page. Don't click the banner.

Look for www.facebook.com/tr (the events, usually ev=PageView) and _fbp under Application, Cookies. Reject cookies and repeat. Nothing should reach /tr.

Count /tr hits, not fbevents.js loads: the script can load and send nothing.

Which events the pixel sends after consent, and on what trigger, is a second check: Meta Pixel Lead event in GTM.

How many sites load a Meta Pixel without a consent setup?

On 5 Nov 2026 we read the public homepage code and GTM containers of 1,727 sites (Tranco list: 1,201 B2B SaaS, 255 ecommerce, 271 agencies).

Seen in public code, 5 Nov 2026 B2B SaaS Ecommerce Agencies
Meta Pixel loaded 56% (673 of 1,201) 35.3% (90 of 255) 49.8% (135 of 271)
Consent tool detected 62% (745 of 1,201) 58.8% (150 of 255) 42.8% (116 of 271)
Google Consent Mode signal 52.3% (628 of 1,201) 39.6% (101 of 255) 39.9% (108 of 271)
Ad tag with no consent tool and no Consent Mode signal 18.2% (165 of 908) 17.7% (28 of 158) 36.9% (72 of 195)

265 of the 1,261 sites with an ad tag showed neither a consent tool nor a Consent Mode signal. Agencies showed none about twice as often as SaaS sites (36.9% against 18.2%).

Limits: a consent tool on the page does not prove it blocks the pixel, and this is a code read, not a browser test. The check above settles it for your site.

Why does the pixel fire before consent?

  • GTM tag on All Pages, no consent condition. It runs before the banner.
  • Meta is not a Google tag. Consent Mode doesn't reach a Custom HTML Meta tag unless you require ad_storage in its consent settings.
  • Hardcoded pixel in the theme or a plugin, or a second copy outside the gated one.
  • A banner that only records the choice and blocks nothing.

How do I hold the pixel until consent?

Find every copy: fbq( in the page source and GTM tags that load it. Remove duplicates.

Gate it in GTM. Fire it on a custom event your banner pushes on accept, or require ad_storage in the tag's consent settings.

Or use Meta's consent API. fbq('consent', 'revoke') before fbq('init', '…'), then fbq('consent', 'grant') on accept.

Retest all three paths in the table below.

Retest path (fresh private window) Requests to facebook.com/tr _fbp cookie
Ignore the banner, visit two pages None Not set
Click reject, visit two pages None Not set
Click accept, visit two pages Yes, from the accept onward Set after the accept

A hit in the first two rows means a copy is still outside the gate: back to step 1.

What does it cost to leave it?

In the EU and UK, marketing pixels generally need prior consent, and regulators have fined sites for setting tracking cookies before it. This is not legal advice.

For Google tags: is Google Consent Mode working?

After the fix Meta gets fewer events. Conversions API has to respect the same choice. Nobody can check that from outside, us included. The free scan reads containers, not timing, so it can't tell if a pixel waits for consent.

Updated 7 Nov 2026: shorter, same numbers. 6 Nov: retest table, corrected what the free scan shows.

Data: the 1,727-site study (platforms, consent banners, Consent Mode signal), scanned 5 Nov 2026. First published 4 Nov 2026. How we scan: method.

FAQ

Does Google Consent Mode cover the Meta Pixel? No. Consent Mode controls Google tags. A Meta Pixel in GTM needs its own consent condition or an accept-only trigger.

How many sites have an ad pixel but no consent setup? On 5 Nov 2026, 265 of 1,261 sites with an ad tag in our 1,727-site study (21%) showed no consent tool and no Consent Mode signal in their public code.

Originally published on fireshift.ai. We built Fireshift, a free scan that reads what a site sends to Google Ads and GA4 from the outside.

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.