How to implement GLAMI Pixel in Google Tag Manager (GTM)?

The guide explains how to implement GLAMI Pixel in Google Tag Manager by following four basic steps. The implementation process requires filling in information such as API key, country code and cookie consent value for each of the four tags.

Add GLAMI Pixel template into your workspace

First, add the GLAMI Pixel template into your workspace. It can be found in the Community Template Gallery:

There are four types of events tracked by the GLAMI Pixel:

PageView Called on every page
ViewContent Called every time a customer views a products list (category page) or a single product (product page)

AddToCart

Called every time a customer adds an item to their cart
Transaction Called when the order is complete
  • To create a new tag, go to the "Tags" page in your Tag Manager and click "New".
  • Every Tag consists of two parts - Tag Configuration which tells it what to do and a Trigger which tells it when to do it.

GLAMI Pixel - PageView (event 1/4)

Name the first Tag “GLAMI Pixel - PageView” and as a tag type select “GLAMI piXel”.
To get started, you need to fill out four pieces of information:

  • API key - You can find this in your GLAMI Dashboard. Navigate to Settings > GLAMI Pixel
  • Country code - This is a two-letter code that identifies the country. You can find it as an Alpha-2 code on this website: https://www.iban.com/country-codes.
    Examples: Czechia -> CZ, Italy -> IT, Romania -> RO
  • Cookie consent value - This is a variable containing the cookie consent.
  • Track type - Choose which of the four event types it will be.

Next, you need to select a trigger. For this tag, you can use one of the default triggers called "All Pages." This will ensure that the pixel is active on every page.

GLAMI Pixel - ViewContent (event 2/4)

Name the second Tag “GLAMI Pixel - ViewContent” and as a tag type select “GLAMI piXel”.
There are four basic information to fill:

  • API key - You can find this in your GLAMI Dashboard. Navigate to Settings > GLAMI Pixel
  • Country code - It’s a two letters code that identifies the country. You can find it as a Alpha-2 code on this website https://www.iban.com/country-codes
    Examples: Czechia -> CZ, Italy -> IT, Romania -> RO
  • Cookie consent value - Variable containing cookie consent.
  • Track type - Which one of the four event types will it be.

There are also two variables specific to this Tag:

  • Content type - Select if the page content is a specific product or a category.
  • Product IDs - ITEM_ID of the viewed product. Make sure the IDs are the same as in the product feed.

To proceed, you need to add a trigger to this tag.

  1. Choose the type "Page View - Window Loaded".
  2. Select "Some Window Loaded Events".
  3. Choose "Page URL" and "contains".

The last part will vary based on your website. It should be something that appears in the URL for the order confirmation page. Here are some examples:

Please note that the exact Triggers and the Data Layer Variable Names shown in the video are just an examples and should be adjusted to your website.

GLAMI Pixel - AddToCart (event 3/4)

Name the third Tag “GLAMI Pixel - AddToCart” and as a tag type select “GLAMI piXel”.
There are four basic information to fill:

  • API key - You can find this in your GLAMI Dashboard. Navigate to Settings > GLAMI Pixel
  • Country code - It’s a two letters code that identifies the country. You can find it as a Alpha-2 code on this website https://www.iban.com/country-codes
    Examples: Czechia -> CZ, Italy -> IT, Romania -> RO
  • Cookie consent value - Variable containing cookie consent.
  • Track type - Which one of the four event types will it be.

There are also four variables specific to this Tag:

  • Product IDs - ITEM_ID of the added product.
  • Product names - Name of the added product.
  • Product price - Price of the added product.
  • Product price currency - Currency of the product price.

Because viewing the cart is often optional and users can go directly into checkout, this tag should be triggered when a user adds the product to the cart.

This can be done with the Trigger type “Click - All Elements”.

Please note that the exact Triggers and the Data Layer Variable Names shown in the video are just an examples and should be adjusted to your website.

GLAMI Pixel - Transaction (event 4/4)

Name the final Tag “GLAMI Pixel - Transaction” and as a tag type select “GLAMI piXel”.
There are four basic information to fill:

  • API key - You can find this in your GLAMI Dashboard. Navigate to Settings > GLAMI Pixel
  • Country code - It’s a two letters code that identifies the country. You can find it as a Alpha-2 code on this website https://www.iban.com/country-codes
    Examples: Czechia -> CZ, Italy -> IT, Romania -> RO
  • Cookie consent value - Variable containing cookie consent.
  • Track type - Which one of the four event types will it be.

There are five additional variables in this Tag:

  • Transaction ID - Number used to identify the transaction.
  • Order value - Total value of the transaction.
  • Order currency - Currency of the order value.
  • Product names - Names of all purchased items.
  • Product IDs - ITEM_IDs of all purchased items. Make sure the IDs are the same as in the product feed.

Trigger can be done similarly to the ViewContent one.

  1. Choose the type "Page View - Window Loaded".
  2. Select "Some Window Loaded Events".
  3. Choose "Page URL" and "contains".

The last part will vary based on your website. It should be something that appears in the URL for the order confirmation page. Here are some examples:

Please note that the exact Triggers and the Data Layer Variable Names shown in the video are just an examples and should be adjusted to your website.

Congratulations!
GLAMI Pixel is now implemented. Don't forget to publish your container.

We recommend testing it with a preview mode.


How to check the implementation?

To enable preview and debug mode for the current workspace:

  1. Click Preview in the top right of your workspace.
  2. Enter your site's URL.
  3. Some sites or pages might be broken by an additional debug parameter added to the URL. If so, you can uncheck the box Include debug signal in the URL.
  4. Click Connect. Your site opens in a new window and displays as Connected in the bottom right.
  5. Click back on the Tag Assistant tab and click Continue to access the debug interface.

The top navigation bar lists options to access information about Tags, Variables, and the Data Layer, and the left navigation Summary bar shows a list of events.

  • Tags: Click Tags to see which tags fired and which tags did not fire. Click a tag to view the tag's properties and associated triggers. When an event is selected in the left column, the Tags tab will show the status of tags for that event.
  • Variables: The Variables tab will display detailed information about variables in the selected event, including the type of variable, the type of data returned, and the resolved value. Select an event in the left navigation to view the status of variables at the time the event fired.
  • Data Layer: The Data Layer tab will show the exact message as it was pushed to the data layer for the selected event, and what the data layer looks like after the message transaction is complete. Select an event in the left navigation to view the status of the data layer at the time the event fired.

FAQ

Can I implement the Pixel for multiple markets in one domain?

It is not possible to use the GTM template to implement multiple instances of the Pixel in one domain.

How to make a new variable?

For this example, we will create a transaction ID variable. First, navigate to the “Variable” page in your Tag Manager and click “New”. You can name it “Transaction ID” and choose the type “Data Layer Variable”. In the Data Layer Variable Name, you need to write the path to this data, for example: "ecommerce.transaction_id"

How to check my Data Layer Variable Name?

Open preview and debug mode in Tag Manager and select the "Data Layer" Tab.
Here you will see the information that was pushed into the data layer.
For more information you can visit Google Support article, available under the following link: https://support.google.com/tagmanager/answer/6107056

How to create a GTM variable from a dataLayer array? / How to send multiple IDs in a single variable?

Product IDs can be split into two variables.
The first one will be called “transactionProducts” with the type “Data Layer Variable”. For the Data Layer Variable Name, select all the products, for example: ecommerce.items
The second one will be called “transactionProductsIds” with the type “Custom JavaScript”. This will open a new text field in which you can paste the following code:

function () { return .map(function(a) {return a.id;}); }

In the “GLAMI Pixel - Transaction”  Tag, you can connect the second variable “transactionProductsIds”.

Do I have to implement all tags/events?

No. It is highly recommended to implement all Tags as each of them provides us with valuable information that allow us to better optimize the campaigns and deliver great performance. However, for the very basic functionality of the Pixel, only PageView and Transaction are mandatory.

Do I have to connect all variables to the tags?

No. It is highly recommended to send all variables as it allows us to better optimize the campaigns and deliver great performance.

Why do I need cookie consent?

The consent parameter allows participating stores to adjust the behavior of GLAMI PiXel based on users' consent to the use of cookies. If consent exists (value 1) or the consent parameter is not set, GLAMI processes the data in full. If there is no consent (value 0), the data will be processed anonymously, without using data about a specific user.

GLAMI PiXel is crucial for the optimal functioning of your e-shop on GLAMI. Therefore, it now supports the Consent parameter, with which the partner e-shop provides GLAMI with information on whether the user has expressed consent to the creation of analytical cookies.