thenewinquiry / tni-core-functionality

Contains the site's core functionality.
GNU General Public License v2.0
2 stars 0 forks source link

Include facebook pixel code #19

Closed frnsys closed 7 years ago

frnsys commented 7 years ago

This goes in the <head> tag:

<!-- 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', 'FACEBOOK_PIXEL_ID'); // 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=FACEBOOK_PIXEL_ID&ev=PageView&noscript=1"
/></noscript>
<!-- DO NOT MODIFY -->
<!-- End Facebook Pixel Code -->

there are two places where we specify the facebook pixel ID (would need to create an admin setting for this).

misfist commented 7 years ago

Maybe we consider a plugin, like this one.

https://wordpress.org/plugins/facebook-conversion-pixel/

frnsys commented 7 years ago

That makes sense. Reading the description, it sounds like we should go with: https://wordpress.org/plugins/pixelyoursite/

misfist commented 7 years ago

Ha! I was about to send you the same suggestion. :) https://wordpress.org/plugins/pixelyoursite/

misfist commented 7 years ago

I'll add it to staging and you can see if it works for you.

misfist commented 7 years ago

This is on staging now. Have a look and see if it'll meet your needs.

frnsys commented 7 years ago

This looks good - let's deploy it to production!

misfist commented 7 years ago

OK. When I deployed to staging, it worked seamlessly, so hopefully it'll be the same for producing. :)