Leading Consent Management Platform

Compliant with GDPR, CCPA, COPPA, LGPD, PECR, PDPA, PIPEDA, and more.

Meta Pixel Consent with UniConsent CMP

The UniConsent Meta Pixel consent tag connects the Meta Pixel to your UniConsent banner through the consent API of the pixel. The pixel waits until a visitor allows advertising, and stops again when the visitor withdraws consent, opts out in the US or sends a Global Privacy Control signal.

In your Meta Pixel code, add fbq('consent', 'revoke'); before fbq('init'):

// the Meta Pixel base code
fbq('consent', 'revoke');
fbq('init', 'YOUR_PIXEL_ID');
fbq('track', 'PageView');

2. Add the tag

Add this tag after the UniConsent tag, on every page with the Meta Pixel:

<script async src="https://cmp.uniconsent.com/v2/meta-consent.min.js"></script>

What it sends

UniConsent stateCall
ad_storage, ad_user_data and ad_personalization all grantedfbq('consent', 'grant')
Any of them deniedfbq('consent', 'revoke')

The tag calls the pixel only when the result changes, on page load and after every choice.

Notes

  • Google Consent Mode must stay enabled in your project, because the tag reads its values.
  • Without fbq('consent', 'revoke'); before fbq('init'), the pixel sends events before the visitor makes a choice.
  • The tag works whether the pixel loads before or after it, including from Google Tag Manager.
  • Events your server sends to the Meta Pixel conversions API are not covered: send them only for visitors who allowed advertising.

Still have questions?

Contact us: support@uniconsent.com