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.
What does Meta Pixel Consent Mode do?
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
- Add the CookieHub script to the
<head>of your website. - Add the default revoke before
fbq('init', ...)in your Meta Pixel code. - Enable Facebook/Meta Pixel Consent Mode under Integrations in your domain’s Settings tab, and click Save & publish.
Google Tag Manager (GTM) implementation
- Go to your GTM container.
- Add a new tag and choose the CookieHub CMP from the Community Template Gallery.
- Enter your CookieHub domain code.
- Set the trigger to Consent Initialization - All Pages.
- In the Custom HTML tag for your Meta Pixel, add the default revoke before
fbq('init', ...). - Save and publish.
- Enable Facebook/Meta Pixel Consent Mode under Integrations in your domain’s Settings tab, and click Save & publish.
Parameter mapping
| CookieHub Category | Meta Consent Mode Action |
|---|---|
| Marketing | Grant or revoke |
| Analytics | – (not used by Meta) |
| Preferences | – (not used by Meta) |
| Necessary | Always allowed |
When is Meta Pixel Consent Mode required?
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
| Feature | CookieHub Support |
|---|---|
| Meta Pixel Consent Mode integration | ✅ Yes |
| HTML script integration | ✅ Yes |
| GTM integration with template | ✅ Yes |
| Default revoke | Added manually in the Pixel code |