[Resolved] Why My Facebook Pixel Was Duplicated ?

Home Forums Support [Resolved] Why My Facebook Pixel Was Duplicated ?

Home Forums Support Why My Facebook Pixel Was Duplicated ?

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #621019
    Rizki

    When i use child theme, my Facebook pixel was duplicated, like this : https://www.dropbox.com/s/ei1ge0us48t8kx7/Image%20002.jpg?dl=0

    What’s wrong ?

    #621330
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    How are you adding the pixel to your website?

    #621343
    Rizki

    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.

    #621618
    Tom
    Lead Developer
    Lead Developer

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

    #621621
    Rizki

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

    #621646
    Tom
    Lead Developer
    Lead Developer

    Yes – it’s been improved greatly in 1.7. You can learn more here: https://generatepress.com/gp-premium-1-7/

    #626713
    Rizki

    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 )

    #626782
    Tom
    Lead Developer
    Lead Developer

    What’s the exact code you’re adding?

    #627057
    Rizki

    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>
    
    #627117
    Tom
    Lead Developer
    Lead Developer

    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”.

    #627126
    Rizki

    Yes, you’re right. That is why I am confused ๐Ÿ˜€ 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 ?

    #627133
    Tom
    Lead Developer
    Lead Developer

    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?

    #627137
    Rizki

    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.

    #627679
    Tom
    Lead Developer
    Lead Developer

    Might be worth contacting their support just to make sure ๐Ÿ™‚

Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.