Site logo

Archived topic

Why My Facebook Pixel Was Duplicated ?

13 replies · Started by Rizki on July 11, 2018

Viewing posts 1–14 of 14

Hi there,

How are you adding the pixel to your website?

Between <head> and </head> as usual ( it's not the first time i do this ), i put the code on header.php in child theme.

If i'm using parent's theme everything looks normally on pixel helper extension.

Instead of using that method, try adding it to GP Hooks within the wp_head hook.

I just realized, since upgrade into GPP 1.7 Beta 1 my Hook's module was gone, is that true ?

I've tried entering through GP Hooks and the result is same, my Facebook pixel still duplicated ( only in homepage, when open other page like single post, pixel firing is normal )

What's the exact code you're adding?

Default code from Facebook pixel :

Header :

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

Body :

<script>
  fbq('track', 'ViewContent');
</script>

Looking in the source of your home page, I'm only seeing the code once.

You can test this by viewing the source of your home page, and searching for "facebook".

Yes, you're right. That is why I am confused :D I installed a pixel using the same way on my other site, and pixel helper detects only 1 pixel. Is it because I am using a child theme ?

Hmm, I don't see why that would matter.

I would trust the source code more than what a tool is saying. Is there another tool you can test with?

I only know pixel helper only ( chrome extension ), because it is a tool owned by facebook itself. Okay, maybe i will try to find more information. Thanks for your support Tom.

Might be worth contacting their support just to make sure :)

This archived topic is closed to new replies.