---
title: Google Tag Manager
slug: ref/google-tag-manager
docTags: 
createdAt: 2023-12-07T12:30:15.859Z
---

Google Tag Manager is a tag management system that allows you to quickly and easily update tags and code snippets on your website or mobile app, such as those intended for traffic analysis and marketing optimization. You can add and update AdWords, Google Analytics, Firebase Analytics, Floodlight, and 3rd party or custom tags from the Tag Manager user interface instead of editing site code.

:::CtaButton{label="Go to official web site for Google Tag Manager" externalHref="https://www.google.com/analytics/tag-manager/" openInNewTab="true"}

:::



***

With Google Tag Manager you have control which tags (like Google Analytics) are activated on the web skin. To setup Google Analytics with Google Tag Manager some configuration is required.

As the web skin is a single page application it does not automatically trigger pageviews in Google Analytics. It triggers virtual pageviews which need to be mapped to pageviews via the Google Tag Manager.

To achieve this, execute the following steps in the Google Tag Manager container configuration:

- Go to `Triggers` and click `New`. In the `Choose trigger type` step select `Custom Event` and name the event `Virtual pageview`. In the `This trigger fires on` step choose `Some Custom Events` and fill in: Event equals `virtualPageView`.
- Add a user-defined variable `Virtual url`. In the `Choose Type` step select `Data Layer Variable`. In the `Variable Configuration` step, fill in `virtualUrl` in the `Data Layer Variable Name`.
- Add the universal analytics tag.
  - The `Track Type` should be `Page View`.
  - In `Field to Set` fill in `page` in `Field Name` and select the `Virtual url` variable as the value.
  - In the `Ecommerce` step set `Enable Enhanced Ecommerce Features` to `True` and select `Use Data Layer`.
  - In the `Fire On` step select `All Pages` and also click `More` and select the `Virtual pageview` trigger we just created.
  - Save the tag
- Ensure that the container works by previewing it.
- Publish the container.

### Limitations

To ensure selling tickets via Ticketmatic is secure and stable the tags that can be activated via Google Tag Manager are limited. At this time only Google tags are allowed, including Floodlight (`flc`, `fls`). To see which tags are Google tags, [click here](https://developers.google.com/tag-manager/devguide#restricting-tag-deployment).

### Cross-domain tracking

It is possible to enable cross-domain tracking with Google Analytics. You can find more information about setting up cross-domain tracking with Google Tag Manager [here](https://support.google.com/tagmanager/answer/6164469). `apps.ticketmatic.com` should be one of the domains in the `Auto Link Domains` field.

### Enhanced ecommerce

Whenever a customer adds / removes tickets to their order, checkouts or purchases tickets, this information is pushed to Google Tag Manager. If required, this information can be pushed through to Google Analytic to track conversions, etc.

To activate enhanced ecommerce the following configurations should be executed in Google Tag Manager:

- Add a trigger `addToCart`. In the `Choose Event` step select `Custom Event`. In the `Fire On` step configure the condition that it fires whenever `Event` contains `addToCart`.
- Add a trigger `checkout`. In the `Choose Event` step select `Custom Event`. In the `Fire On` step configure the condition that it fires whenever `Event` contains `checkout`.
- Add a trigger `purchase`. In the `Choose Event` step select `Custom Event`. In the `Fire On` step configure the condition that it fires whenever `Event` contains `purchase`.
- Add a trigger `removeFromCart`. In the `Choose Event` step select `Custom Event`. In the `Fire On` step configure the condition that it fires whenever `Event` contains `removeFromCart`.
- Add a new tag `Universal Analytics - addToCart`
  - The `Track Type` should be `Event`.
  - The `Event Category` should be `Enhanced Ecommerce`.
  - The `Action` should be `addToCart`.
  - The `Google Analytics Settings` should be `{{Enhanced Ecommerce}}`.
  - The `Firing Trigger` should be the `addToCart` custom event.
- Add a new tag `Universal Analytics - checkout`
  - The `Track Type` should be `Event`.
  - The `Event Category` should be `Enhanced Ecommerce`.
  - The `Action` should be `checkout`.
  - The `Google Analytics Settings` should be `{{Enhanced Ecommerce}}`.
  - The `Firing Trigger` should be the `checkout` custom event.
- Add a new tag `Universal Analytics - purchase`
  - The `Track Type` should be `Event`.
  - The `Event Category` should be `Enhanced Ecommerce`.
  - The `Action` should be `purchase`.
  - The `Google Analytics Settings` should be `{{Enhanced Ecommerce}}`.
  - The `Firing Trigger` should be the `purchase` custom event.
- Add a new tag `Universal Analytics - removeFromCart`
  - The `Track Type` should be `Event`.
  - The `Event Category` should be `Enhanced Ecommerce`.
  - The `Action` should be `removeFromCart`.
  - The `Google Analytics Settings` should be `{{Enhanced Ecommerce}}`.
  - The `Firing Trigger` should be the `removeFromCart` custom event.

With this configuration active Google Tag Manager will push Enhanced Ecommerce data to Google Analytics.

### Data Layer Variables

There are two data layer variables active which can be referenced in Google Tag Manager:

- `virtualUrl`: The url of the current page
- `account`: The name of the account

