How To Setup Facebook Pixel Tracking With Tag Manager

The Facebook Pixel is a small piece of code that you need to install onto your website to make Facebook tracking work. In this article, we'll walk you through the process of setting up the Facebook Pixel with Google Tag Manager.

Before we begin, make sure you have the following:

  1. Google Tag Manager account
  2. Demo shop or website with Google Tag Manager installed
  3. Facebook Events Manager account

Setting Up Page View Tracking with Facebook Pixel

Activate Preview Mode in Google Tag Manager

First, put your Google Tag Manager account into preview mode. This allows you to test and debug your tags before deploying them on your website.

In your Google Tag Manager account, click "Preview" to activate the preview mode. If you don't have a published version yet, you may need to publish an empty version first. Then, connect Google Tag Assistant to your account.

Install the Facebook Pixel Template

In Google Tag Manager, click on "Tags" and then "New." Click on the tag configuration button and search for the Facebook Pixel template in the community gallery. 

Choose the template made by the Facebook Incubator and click "Add to Workspace." Accept the warning and add the template to your account.

Configure the Facebook Pixel Template

To configure the Facebook Pixel template, you'll need your Facebook Pixel ID. You can find it inside your Events Manager account. Copy your Facebook Pixel ID and paste it into the ID field in Google Tag Manager.

We recommend saving your Facebook Pixel ID in a variable, which is a placeholder that can be reused. Create a new constant variable for your Facebook Pixel ID and input the ID.

Next, go to the event configuration section. For this guide, we'll stick with the standard Page View event.

Configure The Event

In the Facebook Pixel template, select the standard Page View Event under the event configuration.

You can customize further settings depending on your website and country's consent requirements.

Set a Trigger for the Tag

Since the Facebook Pixel is a Page View Tag, deploy it on all pages using the pre-configured "All Pages" trigger. Give your tag a descriptive name that includes the tool (Facebook) and the event (Page View)

Name and Save Your Tag

Save your tag, then update the Preview mode in Google Tag Manager. You should now see your Facebook Page View Event firing on your website.

Test & Debug Your Tag

To ensure your Facebook Pixel is correctly installed, use the Facebook Pixel Helper extension to review the data being sent. Check for errors or inconsistencies.

For a more thorough test, go to your Events Manager and use the Test Events feature to verify that the Page View Event is being tracked correctly.

Deploy Your Tag

Once everything is working correctly in Preview mode, submit a live version of your Google Tag Manager setup.

This will deploy the Facebook Pixel on your website for all users. To confirm that the Pixel is active, visit your website without the Tag Assistant connected and verify that the Facebook Pixel is being deployed.

Reasons To Use Facebook Pixel

Facebook Pixel is a tracking and analytics tool used by businesses and marketers to gather data about their website visitors' actions and behavior.

This data is valuable for optimizing and personalizing advertising campaigns, increasing conversions, and understanding user behavior. Some of the key benefits of using Facebook Pixel tracking include:

  • Conversion tracking
  • Remarketing
  • Marketing data collection
  • Ad Tracking
  • Ad Optimization

Please see the rest of the benefits in our complete Facebook Pixel user guide.