Facebook Ads provides marketers with a significant number of advanced tracking features, but you can’t access any of these without properly using the Facebook pixel. In fact, accurate placement of Facebook’s tracking and conversion pixels is so important that we don’t recommend advertising on Facebook until the pixel is properly placed.

Placing the pixel on your website can be a challenge for some advertisers, so use the guide below to ensure that you place the pixel correctly and begin collecting valuable data as soon as possible.

Login Page from Facebook

Make sure you are taking advantage of the Facebook Pixel to drive ad success. Image via Pixabay.

Why You Need the Facebook Pixel


The Facebook pixel provides crucial information regarding account performance and includes:

  • Measuring cross-device conversions – When the same user searches on their mobile device and goes to their home computer and converts, this is a cross-device conversion. Google Analytics can’t measure across devices, making this reporting paramount for accurate attribution.
  • Custom audiences – Without the Facebook pixel placed on your site, you cannot create website based custom audiences based on website activity. This will allow you to create remarketing audiences (critical for performance) and to leverage Facebook lookalike audiences, which are the basis of most successful Facebook prospecting efforts.
  • Dynamic Product Ads (DPAs)/Dynamic Remarketing – If you’re an ecommerce business, DPAs are some of the most profitable ads to run on Facebook. At their core, DPAs use the Facebook pixel to track what products a user views for remarketing using those specific products. Be aware that there is extra set up to run DPAs outside of the base Facebook pixel!

Pixel Base Code

The Facebook pixel has two distinct parts – the first, an all-site pixel that must be placed in the header on every page of your site. You can do this either through a master template from your site, or more quickly through a tag management platform like Google Tag Manager.

Event Code

The second distinct aspect of the Facebook pixel is the Event code. Event codes give Facebook additional information regarding actions that users take on your site, including purchases or other conversion events. These are small snippets of code that tell Facebook whether someone hit the cart page, purchased, filled out a lead form, etc. It’s important to note that recently Facebook has begun creating some of these events automatically, but we still recommend placing the code yourself. Why do we recommend this? We have seen instances where too many events are coming through like purchases on pages that aren’t the order confirmation page. We expect Facebook will improve this over time, but at the time of this post, it’s best to place the code yourself and ensure you’re tracking effectively.

Facebook provides the opportunity to track a number of standard events, with everything from a visitor using the search functionality on the site all the way through to a completed conversion such as a purchase or lead form fill.


If these events do not cover everything your business needs to track, Facebook also allows up to 100 Custom Conversion events based on URL rules. If you are already using Google Analytics to track custom events based on URLs, for example, you can utilize many of the same URLs in Facebook as well.

Put it All Together


  1. Your Website’s Code
  • This will only change if you are hard-coding the pixel into a template on your website. In the header of your website, you will have lots of other code – like the GA tracker, website navigation features, etc. You will place the Facebook pixel here as well.
  • If you are using Google Tag manager, you will not need to update your site’s code, as your tag container should already be in the header

2. Facebook Base Pixel

  • This is the base pixel detailed above that will need to be on every page of the site. If you’re hard-coding, it should go just above the </head> tag to ensure it fires appropriately in the header.
  • If you are using Google Tag Manager, set this portion of the code to fire on all pages.

3. Facebook Event Pixel

  • This pixel should only fire when a site visitor completes an action you want to count as a conversion, like completing a purchase or submitting a lead form, or any micro-conversion events you track, such as putting items into a shopping cart. Add the single line of fbq(‘track’, ‘Event’); inside the Facebook pixel before the </script> tag. It will end up looking like the picture below:
  • If you are using Google Tag Manager, add a new Custom HTML tag that will fire just the Event snippet. Then, under advanced settings, select the option to fire this tag after your base code. Facebook provides additional instructions for Google Tag Manager in their help documentation.

Without the Facebook pixel, you will not have access to features such as audience creation, bid optimizations, and down-funnel tracking. Implementing the Facebook pixel, even though it requires a few steps, is a wholly worthwhile investment that unlocks numerous opportunities in the Facebook ads platform and allows you to make the most of your advertising investment. Once you’ve got it ready to go and need help getting Facebook Ads to deliver profitable return and new customers for your business, you’re ready to contact us!