How to set up Facebook with Google Tag Manager
How to set up Facebook with Google Tag Manager
Install your Facebook pixel with Google Tag Manager
If you use Google Tag Manager to manage your tags, you can add your Facebook Pixel to your Google Tag Manager account to measure and optimize your ad results
Creating the Facebook pixel variable
1- Log into your Google Tag Manager account and select your container.
2 - Click on Variable then in the User defined Variable window, click on New.
3 - Name your variable Facebook Pixel.
4 - Click on Configuration of the variable and click on the variable type Constant
5 - In the value field, enter the ID of your Facebook pixel**.
6 - Click on Save
Creating the Facebook pixel tag
1 - Click on Tags then New.
2 - Name your tag Facebook Pixel - Pageview.
3 - Click on Tag configuration then Discover other types of tags in the community template gallery.
4 - Search Facebook to filter tag types and select the Facebook Pixel tag type
5 - Click on Add to the workspace
6 - Then click on Add
7 - Once the tag type is correctly added, in the field Facebook Pixel ID(s) click on the lego icon and select the Facebook Pixel variable.
8 - Click on Trigger and select the virtual\_page\_view trigger.
9 - Click on the + icon at the top right of the Trigger window to add a second trigger. Select the trigger GA\_page\_view.
The triggers virtual\_page\view and GA\_page\view were previously created in the article Installing Google Analytics with Google Tag Manager_.
10- Your tag is finalized, click on Save
11 - Click on Send and Publish the container.
Create a tag for e-commerce actions
1 - Click on Tags then New.
2 - Name your tag Facebook Pixel - ecommerce.
3 - Click on Configuration of the tag then select the type of custom tag Facebook Pixel.
4 - In the Facebook Pixel ID(s) field click on the lego icon and select the Facebook Pixel variable
5 - Check the Enhanced Ecommerce dataLayer Integration box
9 - Click on Trigger and select the addToCart trigger.
10 - Click on the + icon at the top right of the Trigger window to add a second trigger**. Select the order.confirmation trigger
The addToCart and oder.confirmation triggers were previously created in the article Installing Google Analytics with Google Tag Manager_.
11- Your tag is finalized, click on Save
12 - Click on Send and Publish the container.
Updated on: 24/01/2023
Thank you!