Cluster 15 · Ad Tech Gating · fbq('consent', 'revoke')

Meta Pixel Pre-Consent Gating Guide: fbq('consent', 'revoke') & _fbp Blocking

Stop Meta Pixel from setting `_fbp` cookies or firing `tr/` network beacons before user consent using `fbq('consent', 'revoke')` or strict GTM/script deferral.

100% Browser-Side · Zero User-Data Upload · Strict CSP

Compliance & Pre-Consent Control Specification

Control / Signal Compliant Baseline Engineering & Privacy Rationale
Pre-Consent Call fbq('consent', 'revoke') Must execute BEFORE `fbq('init', ...)` and `fbq('track', 'PageView')` — or defer loading fbevents.js
Blocked Cookie _fbp / _fbc Meta Pixel must not drop `_fbp` first-party cookies prior to marketing consent
Consent Grant fbq('consent', 'grant') Call inside your CMP marketing-opt-in handler, or dynamically inject `fbevents.js` on grant
GPC / CCPA fbq('dataProcessingOptions', ['LDU'], 1, 1000) Enable Limited Data Use (LDU) and suppress Pixel when `navigator.globalPrivacyControl === true`

Strict Pre-Consent Meta Pixel Gating (Zero Pre-Consent Requests)

meta-pixel-consent-gate.ts
let metaLoaded = false;

export function grantMarketingConsentForMeta(pixelId: string) {
  if (typeof navigator !== "undefined" && navigator.globalPrivacyControl === true) return;
  if (metaLoaded) {
    window.fbq?.("consent", "grant");
    return;
  }
  metaLoaded = true;
  // Dynamically inject fbevents.js ONLY after explicit marketing consent:
  const s = document.createElement("script");
  s.async = true;
  s.src = "https://connect.facebook.net/en_US/fbevents.js";
  document.head.appendChild(s);
  window.fbq?.("init", pixelId);
  window.fbq?.("consent", "grant");
  window.fbq?.("track", "PageView");
}

Meta Pixel In-Script Revoke + LDU Fallback

meta-revoke-ldu.js
// If Meta Pixel base stub is already queued, revoke BEFORE init + track:
window.fbq?.("consent", "revoke");
if (navigator.globalPrivacyControl === true) {
  window.fbq?.("dataProcessingOptions", ["LDU"], 1, 1000);
}

Implementation Steps & Key Insights

  1. Audit your page before clicking Accept: neither `connect.facebook.net/en_US/fbevents.js` nor `facebook.com/tr/` nor `_fbp` should appear.
  2. Prefer dynamic script injection (only load `fbevents.js` when marketing consent is granted) for strict GDPR compliance.
  3. If using Meta's inline queue stub, call `fbq('consent', 'revoke')` strictly before `fbq('init', ...)` and `fbq('track', 'PageView')`.
  4. Check `navigator.globalPrivacyControl === true` before ever enabling Meta Pixel for US visitors.
  • Calling `fbq('consent', 'revoke')` AFTER `fbq('track', 'PageView')` still leaks the initial PageView beacon and user IP/User-Agent to Meta servers.
  • Removing the `<noscript><img src='https://www.facebook.com/tr?...'></noscript>` fallback pixel is essential — otherwise browsers with JS enabled/pre-fetched or non-JS scrapers leak hits unconsented.
  • Test live pre-consent `_fbp` cookies and third-party beacons via `consent.runglab.dev`.

Common Pre-Consent Pitfalls

  • Leaving `<noscript><img src='https://www.facebook.com/tr?...'>` active in `index.html`, bypassing JS consent gating.
  • Firing `fbq('init')` and `fbq('track', 'PageView')` in GTM on `Initialization - All Pages` without a Consent Check.
  • Ignoring `Sec-GPC: 1` / `navigator.globalPrivacyControl` on Meta Conversions API (CAPI) server relays.
Verify Live: Audit your production site on consent.runglab.dev or grab the $39 ConsentCheck Compliance Pack. Not legal advice.

More GDPR, Consent Mode v2 & GPC Implementation Guides

← Back to GDPR & Consent Mode v2 Hub · ConsentCheck Live Audit → · $39 Compliance Pack → · Cluster 4: Security Headers → · Cluster 11: PCI & SRI →

Frequently Asked Questions

Is `fbq('consent', 'revoke')` enough for strict GDPR compliance?

When called BEFORE `init` and `track`, `fbq('consent', 'revoke')` stops Meta Pixel from firing tracking hits or setting `_fbp`. However, strict EU guidance often prefers not even downloading `fbevents.js` until consent is granted.

Should I remove the `<noscript>` `facebook.com/tr` `<img>` tag?

Yes — `<noscript>` image tags cannot obey JS consent state and represent an unconsented tracking vector.

How can I check if Meta Pixel fires before consent on my checkout?

Scan your live URL on https://consent.runglab.dev/?ref=tool-consent-cluster to inspect pre-consent cookies and network trackers.