Skip to main content
All CollectionsSettingsGeneral
Create Google Tag Manager tags to track Facebook ad data (GTM)
Create Google Tag Manager tags to track Facebook ad data (GTM)

Learn how to create Google Tag Manager tags to track Facebook ad data (GTM)

François P. avatar
Written by François P.
Updated over a year ago

Once your Facebook Pixels account and Google Tag Manager are linked, you will now be able to create GTM tags, linking them to a Pixel to track activity on Facebook Pixels. To learn how to link both accounts, check this article.

First things first:

To allow Pixels to track events that happen on the bsport platform, you need to go through Google Tag Manager. That's why you connected Google Tag Manager and Pixels in the previous step.

You also need to make Google Tag Manager understand the events that happen on the bsport platform so that it can send them to Pixels.

It is necessary to create a variable on Google Tag Manager which corresponds to the bsport event.

Find all the bsport events here: https://pastebin.pl/view/23083ef7

We are now going to create the variable for a bsport event to be sent to Pixels.

For this example we will choose the click on add to cart event.

Let's create the variable. In Google Tag Manager, go to Variables > New.

Then create a new variable > Data Layer Variable.

Put "data" in the name of the data layer variable. Name the variable, for us it will be "dlv - data".

So we have this for the configuration:

We can now move on to configuring the tag.

In the Google Tag Manager platform, you can go to "Add a tag".

Then you can go to "Configure tag" and then to "Discover other types of tags".

Then you have to look for the "Facebook Pixel", and you can easily configure Pixels in GTM this way and not go through the manual code.

Then you have to configure the Pixel by naming it, putting an ID, choosing the event.

We will choose the Add to Cart event.

In the same way, you must configure the triggering of this tag. Go to "Trigger" at the bottom and configure it.

You need to create a trigger, to do this you need to click on the "+" at the top right and create a trigger. Then you have to configure a "Custom Event".

In "Object Properties", you must add the variable created earlier.

So add "dlv-data".

Then you have to configure the triggering of this tag. Go to "Trigger" at the bottom and configure it.

You need to create a trigger, to do this click on the "+" at the top right and create a trigger. Then you have to configure a "Custom Event".

From here we can name the trigger. "Add to Basket" for our example will work fine.

In "Item Name" we need to enter the bsport event we want to pull up. Our item being the add-to-cart, in the file attached higher in this form we know that the bsport event that corresponds to that is: bsport:basket:add-to-cart:pass

Don't forget to check the "Use regular expression matching" box.

The configuration is finished! You can save and switch to preview mode in Google Tag Manager. Google Tag Manager's preview or "debug" mode allows you to see the tags that are triggered on a website page. There is also the Chrome extension, Google Tag Assistant.

Go to your bsport marketplace and click on an add to cart of your platform.

In the GTM "Debug" you can see that the tag has been triggered.

You can also check if the Pixel has been activated with the Facebook extension Pixel Helper.

You can also check in the Facebook Pixel Event Manager:

There you go, you can now set up Google Tag Manager events related to your platform and pull them up in Pixels.

For more information regarding how to use the Facebook Pixels and Google Tag Manager, please visit this article

Did this answer your question?