SEO

Facebook Pixel Code Template – Custom Tag Template

A Facebook pixel, also known as a Facebook Social Pixel, is a small snippet of code added to a web page that helps Facebook understand what people on the page are doing and track their activity.

Pixels help you to create, test, and analyze customized Facebook advertising that’s relevant to your target audience.

Facebook Social Pixel enables companies to build audience-based, ad-friendly Facebook advertising campaigns. Facebook pixel is designed to simplify the process of gathering data about audience activity and help companies make more educated decisions about their campaigns and target those campaigns to individual audiences.

Facebook Pixel Code Template

The following Pixel code template is useful in case you have only Pixel ID but not the full-fledged code to install on the website.

All you have to do is replace your 16 digit pixel ID number at highlighted locations within quotes but without any brackets.

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

Alternatively, you can get a full-fledged Facebook Pixel code from Events Manager page on your Facebook account.

Show More

Related Articles

Leave a Reply

Back to top button