Connect Facebook Pixel with Google Tag Manager

1. 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.

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

2. 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.

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

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

4. 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.

5. 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.