- This topic has 13 replies, 2 voices, and was last updated 5 years, 9 months ago by Tom.
-
AuthorPosts
-
July 11, 2018 at 6:40 am #621019Rizki
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 ?
July 11, 2018 at 11:11 am #621330TomLead DeveloperLead DeveloperHi there,
How are you adding the pixel to your website?
July 11, 2018 at 11:25 am #621343RizkiBetween <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.
July 11, 2018 at 8:38 pm #621618TomLead DeveloperLead DeveloperInstead of using that method, try adding it to GP Hooks within the
wp_head
hook.July 11, 2018 at 8:45 pm #621621RizkiI just realized, since upgrade into GPP 1.7 Beta 1 my Hook’s module was gone, is that true ?
July 11, 2018 at 9:17 pm #621646TomLead DeveloperLead DeveloperYes – it’s been improved greatly in 1.7. You can learn more here: https://generatepress.com/gp-premium-1-7/
July 18, 2018 at 8:42 am #626713RizkiI’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 )
July 18, 2018 at 9:54 am #626782TomLead DeveloperLead DeveloperWhat’s the exact code you’re adding?
July 18, 2018 at 5:35 pm #627057RizkiDefault 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>
July 18, 2018 at 8:00 pm #627117TomLead DeveloperLead DeveloperLooking 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”.
July 18, 2018 at 8:04 pm #627126RizkiYes, 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 ?
July 18, 2018 at 8:07 pm #627133TomLead DeveloperLead DeveloperHmm, 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?
July 18, 2018 at 8:14 pm #627137RizkiI 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.
July 19, 2018 at 10:04 am #627679TomLead DeveloperLead DeveloperMight be worth contacting their support just to make sure ๐
-
AuthorPosts
- You must be logged in to reply to this topic.