Connect Facebook Pixel with Google Tag Manager

Business Benefits

Target site visitors on Facebook and improve your conversion rates by audience remarketing.


Open your Facebook Ads account and select a business manager account. Click on Business Settings > Data Sources > Pixels in the side menu, then click on Add.

  1. Enter a friendly name, such as your website name.
  2. Enter your domain name.
  3. Click on Continue.

To set up the connection automatically, click on Set up the Pixel now and Add code using a partner integration, select Google Tag Manager, and click on Continue.

  1. Select Turn On Automatic Advanced Matching and click on Continue.
  2. Log in to your Google account if requested.
  3. Select an account and container in your Google Tag Manager setup.
  4. Click on Finish Setup and Continue.

To set up the connection manually, click on Manually add pixel code to website and Install base code on website, and enable Automatic Advanced Matching.

You don’t need to complete this step if you set up the Pixel connection automatically.

  1. In Google Tag Manager, select the account and container where you want to install the pixel.
  2. Click on Workspace and Add a new tag.
  3. Click on Custom HTML under Choose Tag Type, when you click on the Tag Configuration.
  4. Paste the Facebook Pixel code from the previous step under HTML field.
  5. In the Triggering window, select All Pages and click on Save.
  6. Enter a name for the tag - for example, Facebook Pixel Tag Acme Computer Company - and click on Save.
  7. Click Submit to publish the tag to the live website.

In Google Tag Manager, select the account and container you used earlier, click on Workspace and Tags, and verify the Facebook Pixel ID and Last Edited matches with your changes in Facebook Ads.

In Facebook Business Manager, click on Pixels under Data sources and click on the pixel you just created. Check that a green dot is displayed next to the pixel name.