If you want to track conversions, optimize for ads, and build audiences for your Facebook ads, you need to add a Facebook pixel to your website.


<aside> 💡 To add a Facebook pixel to your website, you first need to add Google Tag Manager (GTM). See how to do that here.

</aside>

  1. Log in to your Facebook Ad Manager and go to the Pixels section.
  2. Click on Create a Pixel and enter a name for your pixel.
  3. Click on the Set up Pixel button and choose Manually Install the Code Yourself.
  4. Copy (CTRL+C) the Pixel ID that appears in the box. You will need it later.
  5. Go to your Google Tag Manager account and create a new tag.
  6. Choose Custom HTML as the tag type.
  7. Paste the Facebook Pixel Base Code in the HTML field. You can find this code in your Facebook Ads Manager under the Pixels section.
  8. Replace the pixel ID in the code with the one you saved earlier.
  9. Set the Trigger to All Pages (or to the specific pages where you want to track the pixel).
  10. Save the tag and publish the changes.

That's it! You have successfully added your Facebook pixel to your website using Google Tag Manager. Now you can start tracking conversions and building audiences for your Facebook ads.