Site logo

Archived topic

Where do I install my Facebook pixel?

12 replies · Started by Lainey on March 30, 2017

Viewing posts 1–13 of 13

Hi! I am looking at the GP Hooks option. Which of these boxes do I use to insert my Facebook pixel? Thank you!

The wp_footer hook should do the job :)

Sorry, I should have provided this additional information... the instructions from Facebook are:
"Copy the base code below and paste it between the header tags on every page of your website." I wasn't sure if that meant in the wp_head, Before Header, Before Header Content, After Header Content or After Header box in the GP Hooks. Just curious, if I used the wp_footer hook, would that mean the person would need to have scrolled down to the footer before the pixel would consider it engagement on that page? Thanks!

In that case, you would want to place it in the wp_head hook :)

I'm just doing this too, can I ask if the execute PHP box needs to be ticked?

Sorry what's 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', '115238572459790'); // Insert your pixel ID here.
fbq('track', 'PageView');
</script>
<noscript><img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=115238572459790&ev=PageView&noscript=1"
/></noscript>
<!-- DO NOT MODIFY -->
<!-- End Facebook Pixel Code -->
>

Nope, no PHP in there :)

Thanks- all done and working now.

Glad we could help :)

Hello there! Do I have to chose a location in display rules for it to work?

If I select "Entire Site", the site partly goes down.

Thank you!

Hi there,

yes a display rule is required. I am not sure what you mean by:

If I select “Entire Site”, the site partly goes down.

Can you explain or provide a link to the site to show the issue?

Is there a video tutorial showing how to install or add the FB Pixel into the site? I don't know how to access hooks from my Wordpress dashboard. If there isn't a video tutorial, can someone walk me through the process.

1) Where do I go in WP to access hooks?
2) What kind of hook do I use - obviously wp_header - but how does this work with FB's pixel code?

Thanks.

This archived topic is closed to new replies.