# FB Pixel With Google Tag Manager

#### Introduction:

Integrating Facebook Pixel with Google Tag Manager unlocks powerful insights into your website’s user behavior and ad performance. By seamlessly connecting these two robust tools, you gain the ability to track events, optimize ads, and retarget visitors on Facebook with precision. This streamlined integration simplifies the implementation process, allowing you to focus on leveraging valuable data for targeted marketing strategies. Stay ahead in the digital landscape by seamlessly merging Facebook Pixel with Google Tag Manager.

## Configuration:

#### Setup fb pixel:

Check this guideline of facebook business ‘How to set up and install a Meta Pixel’ to set up your Facebook Pixel. By following this guide setup pixel and collect script code. Safely store this code for future use.

Here’s a sample script for your reference. Your customized version will look like this:

#### Setup google tag manager:

Go to https://tagmanager.google.com/ affter creating an account, set up a new container for your website. Enter your website details and choose the platform Web for your container.

After setup done will the find the GTM ID on top-right of your Tag Manager dashboard like below:

Get this unique identifier and set it into your environment configuration file

    GTM_CONTAINER_ID=“GTM-P6ZD”

Your seutp is done now you can set trigger events based on our data layer.

For fb pixel connect with tagmanager you can get idea from this doc
https://www.facebook.com/business/help/1021909254506499

#### Data Layer:

Here has event name page url and example dataset with key you can use this to set your event on tag manager

Product Page: (you_site_url/product/*)

    'event': 'ViewProduct',
    'Product': {
    'sku': 'test-sku’',
    'title': 'test-title',
    'categories': [‘category_1’, ‘category_2’],
    'price': 33,
    'user_id': 3,
    }

Cart Page: (you_site_url/cart)

    'event': 'CartProducts',
    'cartProducts': {
    'sku': 'test-sku’',
    'title': 'test-title',
    'categories': [‘category_1’, ‘category_2’],
    'price': 33,
    'user_id': 3,
    }

Wishlist Page: (you_site_url/my/wishlist)

    'event': 'WishlistProducts',
    'wishlistProducts': {
    'sku': 'test-sku’',
    'title': 'test-title',
    'categories': [‘category_1’, ‘category_2’],
    'price': 33,
    'user_id': 3,
    }

Order Success: (you_site_url/order/)

    'event': 'PurchasedProduct',
    'purchasedProducts': {
    'sku': 'test-sku’',
    'title': 'test-title',
    'categories': [‘category_1’, ‘category_2’],
    'price': 33,
    'user_id': 3,
    }

Was this page helpful?
Yes No

### How can we improve this documentation?

### Leave Comment Cancel reply

You must be logged in to post a comment.