Integrations
Meta PixelMeta Pixel
preset documentationDocumentation

CookiePilot Meta Pixel preset: _fbp and events only after consent

Hold Meta Pixel until marketing consent. The preset covers common Meta traces such as _fbp, _fbc, connect.facebook.net and facebook.com/tr, plus testing before and after acceptance.

Consent behaviour

Category: marketing.

Common cookies: _fbp, _fbc.

Common requests: connect.facebook.net, facebook.com/tr.

Setup steps

Remove hardcoded pixel code if it fires before the CMP.

Start Meta after marketing granted.

Check product and checkout in a clean session.

Example snippet

Example snippet
<script>
window.addEventListener('cookiepilot:consent', function (event) {
  var consent = event.detail || {};
  if (!consent.marketing || window.__metaPixelLoaded) return;
  window.__metaPixelLoaded = true;

  !function(f,b,e,v,n,t,s){
    if(f.fbq)return;n=f.fbq=function(){n.callMethod?
    n.callMethod.apply(n,arguments):n.queue.push(arguments)};
    if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
    n.queue=[];t=b.createElement(e);t.async=!0;
    t.src=v;s=b.getElementsByTagName(e)[0];
    s.parentNode.insertBefore(t,s)
  }(window, document, 'script', 'https://connect.facebook.net/en_US/fbevents.js');

  fbq('init', 'META_PIXEL_ID');
  fbq('track', 'PageView');
});
</script>

Test checklist

No _fbp before consent.

No facebook.com/tr after Reject.

After Accept, the pixel starts once without duplication.

Related integrations

See the setups that most often appear together with this integration.

Ready to configure it?

Start CookiePilot, choose the right integration and verify that tags wait for user consent before they run.