Startseite » Webanalytics » Google Tag Manager

What is Google Tag Manager?

Google Tag Manager is a tag management system (TMS) that enables tracking codes & much more on websites or in mobile apps can be integrated quickly and easily.

Simply put, you can integrate various tracking pixels, event & e-commerce tracking as well as third-party pixels like from Facebook and co. on your website via Google Tag Manager.

The service is available to anyone with a Google account.

Features include:

  • Tag Management Solution
  • Simplifies the integration of tracking pixels
  • Only 1 pixel needed in the code
  • Very powerful tool with the right know-how

On this page you will find an overview of the various functions of the Google Tag Manager.

If you are already interested in specific topics related to the GTM, you will find further content here.

An introduction to Google Tag Manager.

An all-purpose tool for online marketing professionals. In this article, I’ll explain the core features of Google Tag Manager (GTM) and how you can use it for your business.

Share article!

Marc Heiss

Author: Marc Heiss
Position: Management
Updated: 03.02.2021

How do I install the Google Tag Manager?

As with any Google service, a Google account is required. Just use the same with which you have already set up Google Analytics.

Once there, you need to create an account and in it a so-called container. Ideally, you have one account per domain where you then manage your containers.

You can reach the Google Tag Manager here.

In the next step, you will receive a tracking code as usual, which you will need to integrate on each of your web pages.

After you have done that, Google Tag Manager has been successfully installed on your website and you can set up your first tags.

The tracking code consists of 2 parts:

  1. The first tracking code must be placed as far as possible in the head section of the website. This code is mandatory for Google Tag Manager to work.
  2. The second tracking code must be placed right after the opening body tag. This code is optional.

Whenever JavaScript fails to load on the website, this noscript code is executed so that Google Tag Manager can continue to function in a limited way.

Ideally, you should always implement both codes directly on your website. The easiest way to do this is to send it directly to your developer or if you use WordPress you can use a plugin for it.

My recommendation for this: https://wordpress.org/plugins/insert-headers-and-footers/

Google Tag Manager Code

What are tags?

After the successful installation you get the possibility to create tags.

  • A tag is a code snippet that is used to send data to a system like Google Analytics.
  • After you create a tag, you can choose from a variety of predefined tags.
  • If there is no suitable tag, you can create a custom tag with HTML or image.

The first tag you will install is likely to be Google Analytics.

Since you now have the Google Tag Manager in use, you no longer have to integrate Google Analytics separately on your website, but can do this right away in the GTM.

gtm-tags

How does Google Tag Manager work?

Google Tag Manager works best when used in conjunction with a data layer. A data layer is a JavaScript object that is used to send information from your website to your Tag Manager container. You can then use this information to represent variables and to set up triggers in your tag configurations.

Examples:

  • Product data: Product name, price, category
  • Marketing campaign data: visitor source, medium
  • Transaction data: Value of the shopping cart, date of the purchase transaction
  • Customer data: New or returning customer

What is the data layer?

Using data layer variables, Tag Manager can read values from your data layer implementation and pass them to tags, triggers, and other variables.

Inserting data layer code into a web page

Have a developer help you set up the data layer by adding the following code snippet in the <head> section of the web page, above the container snippet:

<script>
dataLayer = [{
‘pageCategory’: ‘signup’,
‘visitorType’: ‘high-value’
}];
</script>

To check the existing data layer, call the Devoloper Console. (Ctrl+Shift +D – Google Chrome)

Open Console Tab and enter “dataLayer

datenschicht-gtm

How do I create a data layer variable?

It is important that the desired variable is already available in the data layer of the website. You can check this very easily with the Console in the Developer Tools.

If the variable exists, you can now perform the following steps in the GTM to make this variable usable in it as well.

  1. Click Variables.
  2. Under Custom Variables, click New.
  3. Click Configure Variable and select the variable type Data Layer Variable.
  4. In the Name field of the data layer variable, enter the key exactly as it appears in the code, e.g. visitorType
  5. In most cases, you should leave the value for Data Layer Version at the default value (version 2).
  6. Save the variable.
  7. Repeat these steps for all data layer keys that you want to be available as variables in Tag Manager.
  8. Publish the container.
variablen-gtm

What is a variable in the GTM?

A variable is a named placeholder for a value that will change. This can be, for example, a product name, a price or a date.

You can choose from the following variables:

  • Integrated variables ->variables defined by the system (no setup required)
  • User-defined variables -> here, among other things, the already described data layer variable is created.

Any variable that is present in the system can be used as a variable. This variable is compared to the rightmost value using the operator. The field for the value does not take variables. You can only enter fixed values there. But still, this field offers some flexibility. This is because a total of 18 different options come into question as operators.

variablen-operatoren-gtm

Trigger in Google Tag Manager

Each tag in Google Tag Manager needs a time or moment to be executed. To control this, assign a trigger to each day.

The only trigger that is available from the beginning in Google Tag Manager is the All Pages trigger. This trigger fires the assigned tag on every page load.

What is a trigger?

Technically, all triggers are based on events that are pushed to the data layer.

The moment the event is written to the data layer, Google Tag Manager checks all existing triggers to see if they respond to this event. If a trigger was found, the further rules or restrictions are taken into account, if necessary.

The All Pages trigger is triggered by the Page Call event. The page call has the event name gtm.js within Google Tag Manager. As a data layer event, it looks like this:

dataLayer.push({‘event’: ‘gtm.js’});

What are the triggers?

To respond to the automatic data layer events, we don’t need the event names, but we already have corresponding trigger types in Google Tag Manager.

All other events that we define ourselves we can catch with the trigger type Custom event.

To get an overview of the existing triggers or to find a newly created trigger, you can use the preview mode of Google Tag Manager.

It is important to know that an event does not necessarily trigger a trigger. An event only means that a push has been executed in the data layer. In cases where you push values into the data layer but the event field is not filled, only Message appears as the event name.

triggerarten-gtm

The preview mode of the GTM

Preview mode is one of the great ways to try out all the activities within Google Tag Manager in a “test environment”.

All you have to do is press the “Preview” button and enter the URL of the page.

A Tag Assisant tab will open in your browser where you can now check all tags, triggers, variables and the data layer.

In summary:

  • Easy way to control the integrated tags
  • Check if all tags fire correctly
  • Overview of the defined data layer variables

Finally, here is a summary of the main advantages of the GTM.

What are the advantages of Google Tag Manager?

  • Working together on the code
  • Fast implementation
  • Fewer errors – thanks to templates
  • Very easy testing of the changes (preview mode)
  • Clarity: One place for all tags
  • Time-controlled playout of tags
  • Multiple use of triggers and variables
  • Independent of the deployment of the website
  • Versioning of changes – changes can be easily undone
  • Multiple users and rights management

Also interesting for you