Omea Consent · Guides

Add the Meta Pixel to WordPress the GDPR-compliant way

Add the Meta (Facebook) Pixel to WordPress so it only tracks after Marketing consent – with the free plugin's Scripts or Pro's one-click integration.

Updated · Omea Consent 1.0.2

On this page
  1. With Omea Consent Pro (no code)
  2. With the free plugin
  3. Pixel added by another plugin?
  4. Own consent mode
  5. When a visitor withdraws

The Meta Pixel sets the _fbp cookie and sends page views to Meta. Under the GDPR and ePrivacy rules that needs consent – and the most common mistake on WordPress sites is a pixel that fires before the visitor has chosen anything. Here’s how to add it properly.

  1. Find your Pixel ID In Meta Events Manager, select your pixel (dataset) and copy its ID – a long number.
  2. Switch on the Meta Pixel integration In WordPress go to Omea Consent › Integrations, switch on Meta Pixel and paste the Pixel ID.
  3. Keep the default loading Leave After Marketing consent (recommended) selected. Click Save changes.
  4. Remove other copies of the pixel Delete the pixel from your theme, other plugins or Scripts, so it loads only once.
  5. Test it In a private window, check that no request goes to facebook.com/tr and no _fbp cookie appears until you accept Marketing. Then use Meta’s Pixel Helper or Test events.

Pro can also send conversions to the pixel – purchases, leads, sign-ups – and send the same events from your server through the Meta Conversions API, still only with consent.

With the free plugin

  1. Copy the pixel’s base code from Meta Events Manager.
  2. Go to Omea Consent › Scripts › Add script.
  3. Name it Meta Pixel, choose the Marketing category and Head location, choose Inline code and paste the snippet.
  4. Click Save script.

The pixel now waits for Marketing consent. See Add tracking scripts that wait for consent.

Pixel added by another plugin?

If a Facebook or WooCommerce plugin adds the pixel, it loads straight away. Either switch the pixel off in that plugin and add it through Omea, or turn on auto-blocking, which holds connect.facebook.net, fbevents.js and fbq( calls until Marketing consent.

Pro also offers Own consent mode for the Meta Pixel: the script loads at once with fbq('consent', 'revoke'), and Meta holds cookies and events until the visitor agrees. Meta still receives the visitor’s IP address and browser details before the choice, so it’s not the default. See Own consent mode for Meta, TikTok and UET.

When a visitor withdraws

If a visitor turns Marketing off later, Omea reloads the page and deletes _fbp and _fbc along with the other marketing cookies.