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 users 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.
API calls
Meta provides two API calls to manage consent:
fbq('consent', 'revoke');
fbq('consent', 'grant');
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.
CookieHub integration
- ✅ Default revoke handled manually in the Pixel script
- ✅ CookieHub adjusts consent automatically based on user choice
- ✅ Works with both HTML and GTM implementations
- ✅ Always in sync with CookieHub categories
Implementation options
HTML integration
- Add the CookieHub script in your site’s
<head> - Add
fbq('consent', 'revoke');in your Meta Pixel code beforeinit - Enable Meta Pixel under Integrations in the CookieHub dashboard
- CookieHub automatically updates consent status
GTM integration
- Use the CookieHub CMP template from the GTM Community Template Gallery
- Enter your CookieHub domain code
- Add a custom HTML tag for Meta Pixel including
fbq('consent', 'revoke');beforeinit - Set the trigger to Consent Initialization – All Pages
- Save and publish
Parameter mapping
| CookieHub Category | Meta Consent Mode Action |
|---|---|
| Marketing | grant or revoke |
| Analytics | – Not applicable |
| Preferences | – Not applicable |
| Necessary | Always allowed |
When is Meta Pixel Consent Mode required?
You should enable Meta Pixel Consent Mode if:
- You use Meta Pixel in the EEA, UK, or Switzerland
- You must comply with GDPR or Meta’s cookie policy
- You want to ensure tracking and ads only run with user consent
Summary of features
| Feature | CookieHub Support |
|---|---|
| Meta Pixel Consent Mode integration | ✅ Yes |
| HTML script integration | ✅ Yes |
| GTM integration with template | ✅ Yes |
| Automatic grant/revoke updates | ✅ Yes |