Skip to Content

Meta Pixel Consent Mode

Meta Pixel Consent Mode allows you to control whether the Meta Pixel is active based on user cookie consent. This ensures that data is only sent to Meta when a visitor has granted consent, helping you comply with GDPR and other privacy regulations.

CookieHub fully supports Meta Pixel Consent Mode as of version 2.8.12. It can be enabled under Integrations in the Settings tab of your CookieHub dashboard. Once enabled, CookieHub automatically updates the Pixel’s consent state when visitors accept or deny the Marketing category.


Consent Mode defines how Meta Pixel behaves before and after user consent:

  • Revoke: Pixel fires are paused and no marketing cookies are set.
  • Grant: Pixel resumes tracking and can send data to Meta.

This ensures the Pixel is only active when a user has accepted marketing cookies.


Important: Add default revoke

You must add the following line to your Meta Pixel script before initializing the Pixel. This ensures tracking is disabled until CookieHub applies the correct user preference:

fbq('consent', 'revoke');

Example:

// Revoke consent before Pixel initializes fbq('consent', 'revoke'); fbq('init', '<your pixel ID>'); fbq('track', 'PageView');

CookieHub will then automatically call grant or keep revoke based on the user’s cookie selection.


Implementation methods

HTML implementation

  1. Add the CookieHub script to the <head> of your website.
  2. Add the default revoke before fbq('init', ...) in your Meta Pixel code.
  3. Enable Facebook/Meta Pixel Consent Mode under Integrations in your domain’s Settings tab, and click Save & publish.

Google Tag Manager (GTM) implementation

  1. Go to your GTM container.
  2. Add a new tag and choose the CookieHub CMP from the Community Template Gallery.
  3. Enter your CookieHub domain code.
  4. Set the trigger to Consent Initialization - All Pages.
  5. In the Custom HTML tag for your Meta Pixel, add the default revoke before fbq('init', ...).
  6. Save and publish.
  7. Enable Facebook/Meta Pixel Consent Mode under Integrations in your domain’s Settings tab, and click Save & publish.

Parameter mapping

CookieHub CategoryMeta Consent Mode Action
MarketingGrant or revoke
Analytics– (not used by Meta)
Preferences– (not used by Meta)
NecessaryAlways allowed

Meta Pixel Consent Mode is required if:

  • You use the Meta Pixel for visitors in the EEA, UK, or Switzerland
  • You must comply with GDPR or Meta’s cookie policy
  • You want to make sure tracking and ads only run with visitor consent

Summary

FeatureCookieHub Support
Meta Pixel Consent Mode integration✅ Yes
HTML script integration✅ Yes
GTM integration with template✅ Yes
Default revokeAdded manually in the Pixel code

Last updated on