Cookie preferences

Choose which optional cookies EndFrame may use on this site. Analytics and advertising tools load only if you allow them, and you can change your mind any time from “Cookie settings” in the footer. Whatever you choose, this tab keeps the campaign labels from the link that brought you, and they are saved with your account if you sign up. Read the Cookie Policy.

Needed for the site to work, such as remembering this choice. Always on.

Lets us load analytics tools through Google Tag Manager, including Google Analytics and Microsoft Clarity session recordings, to understand how the site is used.

Allows advertising tags to measure our ad campaigns. None run on this site today. It also keeps ad click IDs from the page address for this tab, and saves them with your account if you sign up.

Skip to main content

Meta Pixel Cookie Consent: How to Hold the Pixel Until a Visitor Agrees

A tool-neutral guide for marketers to holding the Meta Pixel until a visitor accepts cookies: Meta's consent API, consent checks in Google Tag Manager, what the Conversions API needs, Limited Data Use for US visitors and a browser test.

The EndFrame Team7 min read

If your site has visitors in the European Economic Area (EEA) or the UK, the Meta Pixel should not set its cookies or send events to Meta until the visitor has said yes to marketing cookies. There are two dependable ways to do that. The first is to load it in a paused state with Meta's consent API, fbq('consent', 'revoke'), and release it with fbq('consent', 'grant') when the visitor agrees. The second is not to load the pixel at all until your cookie banner reports consent. This guide covers both, explains why Google Consent Mode does not do this job on its own, and shows how to prove in your browser that the pixel really waits. It explains mechanisms, not legal obligations: ask your own adviser what your banner must say.

Why the Meta Pixel needs consent in the EEA and UK

The pixel is a script that loads from connect.facebook.net and sends each event, such as PageView or Purchase, to facebook.com/tr. Meta's documentation says the pixel automatically saves a unique browser identifier in a first-party cookie called _fbp, and stores the click ID from an ad click (the fbclid in the URL) in a cookie called _fbc. Our explainer on fbclid, _fbc and _fbp covers what each one is used for. In short, the pixel stores identifiers on the visitor's device and sends browsing data to an advertising platform.

The EU's official business guidance lists tracking cookies used for behavioural advertising among those that need consent, and says such cookies cannot be set when the page first opens: only after the visitor agrees. In the UK, the ICO's guidance on storage and access technologies, finalised in April 2026, says that using these technologies for online advertising requires consent, and that measuring campaign results is covered by that same consent rather than being exempt. The newer UK exceptions for analytics do not extend to advertising, which our guide to UK cookie rules explains. What a valid banner looks like is covered in our GDPR cookie banner requirements.

Two ways to hold the pixel

ApproachBefore consentWatch out for
Do not load the pixel until consent (consent platform blocking or a tag manager consent check)No Meta script, no _fbp cookie, no requests to MetaThe PageView on the page where the visitor clicks accept needs its own trigger
Load the pixel paused with Meta's consent APIThe pixel script downloads, but Meta says pixel fires are pausedRevoke must run on every page, and grant must be re-applied from the stored choice

Both depend on a banner that records the visitor's choice and makes it available to the page, usually through a consent management platform (CMP). Pick one approach per site, so there is one copy of the pixel and one set of rules.

Method 1: Meta's consent API

Meta documents this on its General Data Protection Regulation page for the pixel. The API has two calls, revoke to pause pixel fires and grant to resume them, and Meta states that you need to call revoke on every page. Set it up like this:

  1. 1In the pixel base code, add fbq('consent', 'revoke'); on the line before fbq('init', 'YOUR_PIXEL_ID');. Leave fbq('track', 'PageView'); after init as normal.
  2. 2Make sure this base code, with the revoke line, runs on every page, including checkout and thank-you pages on a different template.
  3. 3When the banner reports that the visitor accepted marketing cookies, call fbq('consent', 'grant');. Most CMPs offer a callback or a dataLayer event for this moment; your developer attaches the grant call to it.
  4. 4On every later page, read the stored choice from the CMP after the revoke line runs, and call grant straight away if the visitor already agreed. Without this, the pixel stays paused on page two.
  5. 5If the visitor withdraws consent through the banner, call fbq('consent', 'revoke'); again and stop calling grant on later pages.

Two limits are worth knowing. The script file still downloads from Meta's servers before consent, so the browser contacts Meta even though no events are sent. Meta's page also does not say whether the pixel creates the _fbp cookie while consent is revoked. Do not assume either way: the browser test further down shows you exactly what happens on your site. If you want nothing from Meta to load before consent, use Method 2.

Method 2: gate the Meta tag in Google Tag Manager

Many teams assume that setting up Google Consent Mode v2 covers every tag in the container. It does not. Consent Mode changes the behaviour of tags with built-in consent checks, which are Google's own tags. A Meta Pixel tag, whether it is a Custom HTML tag or a community template, has no built-in checks, so it fires whenever its trigger fires. To make the Meta tag wait, add a consent check to it:

  1. 1In Tag Manager, open the Meta Pixel base tag and go to Advanced Settings, then Consent Settings.
  2. 2Under Additional Consent Checks, choose Require additional consent for tag to fire. The tag then fires only if every consent type you list is granted when it is triggered.
  3. 3Add ad_storage, or the custom consent type your CMP uses for its marketing category if it does not map choices to Google's consent types.
  4. 4Repeat for every Meta event tag, such as Lead or Purchase, so no event slips through on its own trigger.
  5. 5Because the check happens when the trigger fires, a visitor who accepts on their first page would otherwise get no PageView there. Add your CMP's consent update event as a second trigger on the base tag, and set Tag firing options (under Advanced Settings) to Once per page so the PageView cannot be sent twice on one page.
  6. 6Publish, then turn on the consent overview (Admin, Container Settings, Enable consent overview). The Consent Overview icon in the Tags list then groups any tag still marked Consent Not Configured, which is a quick way to catch Meta tags nobody gated.

This gate stops the pixel loading before consent, but it cannot unload a pixel that is already running if the visitor withdraws consent mid-visit. Calling fbq('consent', 'revoke'); from the CMP's withdrawal event covers that gap on the current page.

The Conversions API needs the same decision

If you also send events to Meta from your server through the Conversions API, the visitor's choice still applies to that data. Moving collection to a server does not change what the visitor agreed to, as our article on whether server-side tracking is GDPR compliant explains. Meta's list of server event parameters has no field for EU consent: the only processing option it documents is data_processing_options, which is for Limited Data Use. So the decision is made by what you send. Record the consent choice with the visit or order, forward server events only for visitors who agreed, and do not pass _fbp or _fbc values collected without consent.

The same applies to any tool that forwards conversions for you. EndFrame, for example, sends conversions server-side to the Meta Conversions API, but it is not a consent tool and does not replace a banner: whether its snippet runs for a visitor, and so whether that visitor's conversions reach Meta, should follow the choice recorded by your banner.

US visitors: Limited Data Use instead of a gate

For US state privacy laws, Meta's tool is Limited Data Use (LDU), documented on its Data processing options for US users page. Instead of holding the pixel, you flag events so Meta restricts how it processes them. For the pixel, call fbq('dataProcessingOptions', ['LDU'], 0, 0); before fbq('init'), where the two zeros ask Meta to work out the visitor's location. For the Conversions API, add data_processing_options set to ["LDU"] with data_processing_options_country and data_processing_options_state set to 0. Meta's page lists the states where LDU applies, 14 at the time of writing, from California and Colorado to Maryland and Rhode Island; check it, as Meta updates the list. Our guide to Meta Limited Data Use explains when to send the flag only for visitors who opted out.

How to check the pixel waits for consent

  1. 1Open a private browser window, so there are no stored cookies or consent choices, and open the developer tools (F12, or right-click and Inspect).
  2. 2In the Network tab, type facebook in the filter box, then load a page on your site and leave the banner untouched.
  3. 3Before consent, there should be no requests to facebook.com/tr. With Method 2 there should be no request for fbevents.js from connect.facebook.net either.
  4. 4In the Application tab (Storage in Firefox), open Cookies for your domain and confirm there is no _fbp cookie. This is how you find out what Method 1 does on your site.
  5. 5Accept marketing cookies. A request to facebook.com/tr for the PageView should appear, and _fbp should now be set.
  6. 6Click through to a second page without touching the banner. The pixel should fire straight away, which proves the stored choice is re-applied.
  7. 7In a fresh private window, reject cookies and browse several pages, including a form or checkout. No facebook.com/tr requests should appear at any point.

Common mistakes that let the pixel fire early

  • The pixel is hard-coded in the theme as well as in the tag manager. The banner gates one copy and the other fires regardless. The free pixel inspector lists pixels in a page's initial HTML, so a Meta Pixel it finds there is hard-coded and worth checking; it cannot see tags your tag manager adds after consent.
  • A plugin or platform integration installs its own copy of the pixel outside the banner's control.
  • The banner only hides itself when clicked, and nothing tells the pixel.
  • Consent is applied on the first page but not re-applied on later pages, so the pixel stays paused for visitors who agreed, or runs for visitors who did not.
  • Consent Mode is set up and assumed to cover every tag in the container, including Meta.
  • Server events go to the Conversions API for every visitor while the browser pixel respects the banner.

Repeat the browser test after any theme change, new plugin or CMP update, because those are the moments a second copy of the pixel tends to appear.

Frequently asked questions

Does Google Consent Mode control the Meta Pixel?

Not by itself. Consent Mode changes the behaviour of Google tags that have built-in consent checks. The Meta Pixel has none, so with Consent Mode switched on it still fires as normal. You have to gate the Meta tag yourself, either with an additional consent check in Google Tag Manager, with your consent platform's script blocking, or with Meta's own consent API.

Is fbq('consent', 'revoke') enough to be compliant?

It is only the switch. Meta's documentation says it pauses pixel fires until you call grant, and that it must run on every page. You still need a banner that asks for affirmative consent and records the answer, and the pixel's script file still downloads before consent. Whether that early download is acceptable is a question for your own legal adviser.

Will my Meta results drop after I add a consent gate?

Expect fewer browser events in Events Manager, because visitors who refuse or ignore the banner are no longer measured, and campaigns then optimise on the conversions that remain. Size the drop by comparing Meta's figures with orders or leads in your own system over the same dates, rather than assuming the pixel broke.

Do I need consent for the pixel on a site with no EU or UK visitors?

The opt-in rules in this guide come from EU and UK law, which apply where those visitors are. For US traffic Meta offers Limited Data Use, a flag that restricts how Meta processes data from people in certain states, instead of a consent gate. Other countries have their own rules, so check the law for each market you sell into.

Try EndFrame

Add a server-side path for your conversions.

EndFrame collects events first-party and forwards conversions server-side to Meta, GA4, TikTok, and webhooks with event-ID deduplication — then credits each conversion to its campaign, with the visit-to-conversion path you can audit.

No credit card required

Keep reading