Exclude a page from Facebook Pixel

Hello,

I have a Facebook Pixel installed via custom code, I know there is another way but it works. What I need is to exclude a certain page of the website from Facebook Pxiel.

This is the code:

<!-- Facebook Pixel Code -->
<script>
  !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', '304631076745344');
  fbq('track', 'PageView');
</script>
<noscript><img height="1" width="1" style="display:none"
  src="https://www.facebook.com/tr?id=304631076745344&ev=PageView&noscript=1"
/></noscript>
<!-- End Facebook Pixel Code -->

It is possible?

Thank you!

IF you are loading this code in the project settings it applies to all pages. The alternative is to load only in page settings.

1 Like

I thought about that, but was thinking it could lead to more trouble if I put the code on each page head. It would not affect the website in a negative way?

No. Actually it would be no different than how it is now, just harder to maintain if you made a change.

1 Like

Thank you, I will use this solution, the website is not that big and the Facebook Pixel it does not change very often.