How to Set up Facebook Pixel using Google Tag Manager

Author:

Setting up Facebook Pixel using Google Tag Manager (GTM) allows you to easily deploy and manage your Facebook Pixel tracking across your website without directly editing the site’s code. Here’s a step-by-step guide on how to set it up:

1. Create a Facebook Pixel

Before setting up the Facebook Pixel in GTM, make sure you have a Facebook Pixel created in your Facebook Business Manager account:

  • Sign in to your Facebook Business Manager account.
  • Go to the “Events Manager” section.
  • Click on “Connect Data Sources” and select “Web.”
  • Choose “Facebook Pixel” and follow the prompts to create your Pixel.
  • Copy your Pixel ID, which you’ll need to set up the Pixel in GTM.

2. Set Up Facebook Pixel Tag in GTM

Now, let’s configure the Facebook Pixel tag in GTM:

  • Sign in to your Google Tag Manager account.
  • Navigate to the container for your website.
  • Go to “Tags” and click on the blue plus button to create a new tag.
  • Choose a tag type. For Facebook Pixel, select “Custom HTML” as the tag type.
  • Paste the Facebook Pixel base code into the HTML field of the tag. Replace ‘YOUR_PIXEL_ID’ with your actual Pixel ID.
  • Configure the trigger to fire the tag on all pages by selecting a trigger type and choosing “All Pages.”

3. Test Your Facebook Pixel Setup

Before publishing your changes, it’s crucial to test your Facebook Pixel setup to ensure it’s working correctly:

  • Enable preview mode in GTM to test your tags without affecting live data.
  • Navigate to your website and verify that the Facebook Pixel fires in the GTM preview mode.
  • Check the Facebook Pixel Helper browser extension or Facebook Events Manager to confirm that the Pixel is recording page views.

4. Publish Your Changes

  • Once you’ve tested your Facebook Pixel setup and confirmed that it’s working accurately, publish your changes in GTM to make them live on your website.

By following these steps, you can successfully set up Facebook Pixel tracking using Google Tag Manager, allowing you to track and measure conversions, optimize ad targeting, and create custom audiences for your Facebook.