Skip to content

Cookie consent

Meta Pixel and the GDPR: how to get consent right

By the Kiescy teamUpdated 6 min readChecked against the official text on

The Meta Pixel is the snippet that tells Facebook and Instagram who visited your site and what they did: viewed a product, added to cart, bought. It's what makes retargeting and conversion tracking work, and it's one of the trackers privacy regulators look at first.

This guide explains when the Pixel needs consent in Europe and the US, three ways to hold it back until visitors agree, what to do about the Conversions API, and how to check it's working.

The short version

In the EU and UK, yes: the Meta Pixel sets advertising cookies and sends visitor data to Meta, so it needs opt-in consent before it loads. In California and other US states with privacy laws, you usually don't need consent first, but sharing data for cross-context ads gives visitors the right to opt out, so you need a "Do Not Sell or Share" choice. Hold the Pixel back with a consent banner, or use Meta's fbq('consent', 'revoke') and fbq('consent', 'grant') calls.

Words you'll see in this guide (4)
Meta Pixel:
Meta's tracking code (formerly the Facebook Pixel). It loads from connect.facebook.net and reports page views and events to Meta.
_fbp and _fbc:
Cookies the Pixel uses on your domain. _fbp holds a browser ID; _fbc holds the click ID from a Facebook or Instagram ad.
Conversions API (CAPI):
A way to send the same events from your server to Meta instead of, or as well as, the browser.
Joint controller:
When two organisations decide together why and how personal data is collected. The EU's top court said a site with a Facebook plugin can be one, together with Meta.
On this page
  1. Does it need consent
  2. How to set it up
  3. Conversions API
  4. Pixel cookies
  5. Your privacy policy
  6. Test it
  7. Questions
  8. Sources

Does the Meta Pixel need consent?

Where your visitors areRuleWhat you need
EU and EEAePrivacy Article 5(3) for the cookies, the GDPR for the data sent to MetaOpt-in consent before the Pixel loads
United KingdomPECR and the UK GDPROpt-in consent before the Pixel loads
CaliforniaCCPA: sharing personal information for cross-context behavioural advertisingA "Do Not Sell or Share My Personal Information" link, and honour Global Privacy Control
Other US states with privacy lawsOpt-out of targeted advertisingAn opt-out, often with Global Privacy Control
IndiaDPDP Act: consent for processing not covered by a legitimate useOpt-in consent for ad tracking

The EU case is also about responsibility. In Fashion ID (C-40/17, 2019), the Court of Justice of the EU ruled that a website that embeds a Facebook plugin is a joint controller with Facebook for collecting and sending visitors' data. In plain words: if the Pixel is on your site, you share responsibility for what it collects, and you're the one who has to ask the visitor first.

Example

A Lisbon shoe store runs Instagram ads with the Pixel on every page. A visitor from Madrid opens a product page. Without consent handling, the Pixel has already sent a PageView and a ViewContent event to Meta and set the _fbp cookie before the visitor has seen the banner. With the Pixel held back, nothing reaches Meta unless the visitor accepts advertising cookies.

3 ways to make the Pixel wait for consent

Diagram: the page loads with the Pixel script in the head, the consent banner holds it back with no cookies or requests. If the visitor allows the category, the script runs and cookies like _fbp are set. If they reject, the script never runs and nothing is sent to the vendor.Page loadsPixel / analytics script in <head>Consent banner holds it backScript waits, no cookies, no requestAllows categoryScript runsRejectsScript never runsCookies such as _ga or_fbp are set from hereNo tracker cookies,nothing sent to the vendor
Whichever method you use, the Pixel shouldn't run until the visitor allows advertising.

1. Let your consent banner block it (easiest)

A banner that blocks scripts by category can hold the Pixel back without any code changes. Kiescy does this automatically: connect.facebook.net and facebook.com are in its advertising category by default, so the Pixel's script doesn't run until the visitor allows advertising, then loads normally. If you installed the Pixel through a Shopify or WordPress app, that still works, because Kiescy intercepts the script whichever plugin adds it, as long as Kiescy's script comes first in <head>.

2. Use Meta's consent calls

Meta's own developer guide shows a two-call pattern. Call revoke on every page before init, so the Pixel is paused, then call grant once the visitor agrees:

Meta Pixel consent calls
fbq('consent', 'revoke');        // first, on every page
fbq('init', 'YOUR_PIXEL_ID');
fbq('track', 'PageView');

// later, when the visitor accepts advertising cookies:
fbq('consent', 'grant');

Meta says revoke pauses sending Pixel fires to Meta. Its guide doesn't say the Pixel's script or cookies are kept off the page, so in the EU the cautious choice is still to not load the script at all until consent (method 1 or 3).

3. Google Tag Manager

If the Pixel runs as a Custom HTML tag in GTM, give it a trigger that fires only after your banner's consent event, or set the tag's Additional consent checks to require ad_storage. Don't fire it on All Pages without a consent condition: GTM's built-in consent checks apply to Google's own tags, not to Meta's.

Tip: With Kiescy you can also run code when a category is allowed: pira.when('advertising', () => { /* load or grant the Pixel */ }). Useful when a developer loads the Pixel from a JavaScript bundle.

Does the Conversions API get around consent?

No. The Conversions API sends events from your server instead of the browser, which avoids ad blockers, but the legal question is about the person and the data, not the route. If a visitor in the EU said no to advertising, sending their purchase from your server to Meta for ads still needs a legal basis, and consent is the one that fits.

  • Send server events only for visitors who allowed advertising, and pass the same consent state your banner recorded.
  • Use the same event ID for browser and server events so Meta can remove duplicates.
  • Hash customer details as Meta requires, and only send what you need.

The cookies the Pixel sets

CookieWhat it holdsSet when
_fbpA browser ID: a version, a timestamp and a random numberThe Pixel loads and no _fbp exists yet
_fbcThe click ID (fbclid) from a Facebook or Instagram ad; Meta recommends a 90-day expiryA visitor arrives from an ad link with fbclid in the URL

List both in your cookie policy under advertising or marketing. The free cookie policy generator has a Meta Pixel preset, and GDPR cookie categories explains where they belong.

What your privacy policy should say

Name Meta, say you use the Pixel for advertising and measuring ads, which events you send (page views, purchases), that it runs only with consent where the law requires it, and how to opt out. If you run lead ads too, see privacy policies for Facebook lead ads. For California visitors, link your "Do Not Sell or Share" choice from the policy and the footer; what Global Privacy Control means explains the browser signal you must honour.

How to check the Pixel waits

  1. Open your site in a private window and open DevTools → Network. Filter for facebook.
  2. Before choosing anything, there should be no request to connect.facebook.net or facebook.com/tr.
  3. Check Application → Cookies: no _fbp yet.
  4. Accept advertising cookies. The Pixel script, a PageView request and the _fbp cookie should now appear.
  5. Start again and choose Reject: none of them should appear, on any page.

Meta's Pixel Helper browser extension also shows whether the Pixel fired. The free website check runs the first-visit test for you.

Questions

Is the Facebook Pixel illegal in the EU?

No, but using it without prior consent is a problem. Load it only after the visitor accepts advertising cookies, and explain it in your privacy and cookie policy.

Can I use the Meta Pixel without cookies?

The Pixel is built around cookies such as _fbp. Even without cookies, it sends visitor data to Meta, which needs a legal basis in the EU. Treat it as needing consent.

Do I need consent for the Pixel on a Shopify store?

For EU and UK visitors, yes. Shopify's own customer privacy settings or a consent banner can hold the Pixel back; make sure only one tool is in charge.

Does Meta's Limited Data Use setting replace consent?

No. Limited Data Use is Meta's setting for US state privacy laws. It doesn't create consent for EU or UK visitors.

Does the Meta Pixel need consent in the US?

Usually not beforehand, but in California and other states with privacy laws, people can opt out of sharing for targeted ads, and you must honour Global Privacy Control.

Sources

The facts in this guide come from these official sources, last checked on . We review the guide whenever they change.

  1. Meta for Developers: Meta Pixel and the General Data Protection Regulation
  2. Meta for Developers: ClickID and the fbp and fbc parameters
  3. Court of Justice of the EU: Fashion ID, C-40/17 (29 July 2019)
  4. ePrivacy Directive 2002/58/EC, Article 5(3) (EUR-Lex)
  5. California Consumer Privacy Act, Civil Code §1798.120 and §1798.140 (California Legislative Information)

Does your Pixel fire before consent?

Our free check opens your site like a first-time visitor and shows whether the Meta Pixel loads before anyone agrees.

Open the free tool

This guide explains the law in general terms and isn't legal advice. Laws change and how they apply depends on your situation; for high-risk processing, ask a lawyer.

Keep reading

All guides

Get compliant this afternoon, not this quarter.

Set up your policies, banner and request form in one place. Free while Kiescy is in early access.