Google Tag Manager – Event and Conversion Tracking

conversion tracking with Google Tag Manager GTM

Last updated on September 4, 2021, 11:48 AM

Google Tag Manager – Event and Conversion Tracking

Conversion tracking is a cornerstone of an efficient online marketing setup. A conversion is a specific action that a user should perform on our website. This can be, for example, signing up for a newsletter, contacting us via a form, clicking on a phone number, or making a purchase in an online store. As savvy online marketers, we naturally want to measure these conversions and then evaluate the data in order to optimize our campaigns. A well-functioning conversion tracking is also essential for growth hacking.

With the Google Tag Manager, Google has developed a sophisticated system to bring some overview and structure into the wild turmoil of event tracking and thus also conversion tracking. In this blog post I try to explain what conversion tracking is and how you can set up simple conversion tracking with Google Tag Manager.

Table of contents:
What is the benefit of conversion tracking
Tracking an event using Google Tag Manager
Track mailto email events with Google Tag Manager
Track contact form with Google Tag Manager
Track successful purchases in the web store with the Tag Manager
Define goals in Google Analytics catching events from Google Tag Manager

What is the benefit of conversion tracking?

In short: Conversion tracking gives me the knowledge of which advertising channel has brought me the most. In online marketing, a conversion is the achievement of a specific goal. Usually it is the purchase of a product by a customer, but it can also be a new lead/contact. The big advantage in online marketing compared to traditional marketing is the measurability and linking of multiple channels and the precise measurement of certain actions of users. This makes it possible to determine exactly where this conversion came from (via which channel), or which means (which ad, which keyword, which search term, …) this conversion could be achieved by, and almost most importantly, how much money the advertising cost me to achieve a conversion.

With a seamless tracking setup, you can draw valuable conclusions and continuously optimize your online marketing efforts. So I can do growth hacking and set up a nice marketing automation. But back to the Google Tag Manager tutorial on conversion tracking setup.

Tracking an event using Google Tag Manager

A conversion is usually based on a specific event. Events are events that represent a certain action and can be measured on the website / app. As mentioned above, this depends entirely on the website / app and what you can actually do there as a user, or what we want to track. Not to get too theoretical here, an event can be, for example, the click on an external link to the Facebook fan page of the company / the product, or a click on the “newsletter registration” button, or the last click on the “buy” button in the ordering process in the online store. As you can see, there is a whole bunch of events that could be tracked.

Using Google Tag Manager, I can now add a nice “tag” (aka loop) to an event to process it perfectly in Google Analytics. This “marking” and “description” of my events is done in the GTM (Google Tag Manager) by means of a tag. And so that a tag is also read by Google Analytics, it still needs a trigger in GTM, which triggers this tag.

So that the confusion is not too big now, I explain this best with an example :)

Track mailto email events with Google Tag Manager

On almost every website there is the contact option to write something to the website operators by e-mail. Behind these contact “links” is usually simply a HTML mailto:email-address xy call, so that the standard email program opens immediately to keep the user experience high :)

This mailto event can also be tracked very nicely with the GTM. For this you have to create 2 things like so often. A tag to send the information you want to track to Google Analytics and a trigger that triggers this tag.

So a trigger for “measuring” the mailto event might look like this:

mailto e-mail event tracken mit GTM google Tag Manager - trigger

So we create a trigger, which reacts as a trigger type only on clicks. To prevent it from being triggered every time a user clicks, we restrict it even further and set the condition that the click URL must contain a certain mailto HTML code. In this example it is the “mailto:[email protected]” code that is behind the contact links on my website.

html code kontakt mailto GTM tag trigger

In the associated tag, we can now specify what we want to pass to Google Analytics when a user has clicked on my contact link.

The tag for the mailto event measurement:

Here we define an event for Google Analytics and select “Google Analytics – Universal Analytics” as tag type and can thus define an event category, an event action and an event label.

tag für mailto event tracking GTM

In this case I defined my event category as “Mailto Click”, because I track other mailto link clicks on the page and can then also assign the same category to them. For the Event Action I have chosen “Mailto office”, because there are other Actions which I can then give a different value in the configuration to be able to distinguish better later in GA. For the Event Label I give 2 predefined variables to GA.

This doesn’t make much sense on a small site like mine, but it’s interesting to try it out. For example, if you have the contact option on many blogposts (or in the footer), you could use this info in the event label (more precisely via the page path variable) to identify exactly which blogpost you have received the most contact requests :)

For triggering you have to select the previously created trigger, otherwise the tag will never be “triggered”. And you are done with your mailto email event tracking in GTM.

Track contact form with Google Tag Manager

Since many websites also work with contact forms, there is also a nice possibility to track the interaction of the user with the form via GTM. GTM has already integrated a variety of variables that are constantly being expanded. In the case of form tracking you can use these variables like Form ID, Form Classes, Form Element, … can be used very well to “recognize” the right form.

However, the variables are not enabled right out of the box, so you have to add them first. You can do this by simply clicking on “Variables” or “Variables” in the left sidebar and activating the respective variables.

Form Variablen GTM

But now back to the trigger that is supposed to trigger the tag with our info about the users’ activities with the form.

The trigger in GTM for form tracking:

formular tracking - google Tag Manager GTM trigger klein

Here you can select as trigger type: Form Submission. This way GTM will do the work for you and check automatically if a form on the website has been submitted by clicking the “Submit” button. Another important field is “Check Validation”, because here you can decide if you want the trigger to fire every time a user clicks on the “Submit” button, or only if everything is filled out correctly in the form and there are no more errors.

And if there are multiple forms on your website, you can set up a condition again and work with the form ID variable to monitor only the correct form with this trigger and tag combination. Here I know that in the HTML code the form ID for this contact form is named / set as “form1_kontakt”. Therefore, I can use it as an identifier for just this one form. As is often the case, if you don’t know exactly how to identify a particular form, right-clicking the mouse and selecting “Show source code” will help.

Our tag for form tracking in GTM:

Here the Tag Type is again “Google Analytics – Universal Analytics” because we again select “Event” as Track Type to send this info as Event to GA. And as before with email mailto tracking, we can again specify an Event Category, Event Action and Event Label. Since I have a form ID for each form in the example on the website, I also give this identifier to Google Analytics in the Event Label field.

formular tracking - google Tag Manager GTM tag klein

And as trigger our previously created “form submitted trigger” is used. So I can track in GA exactly how often a form was submitted. And the nice thing about this event tracking in Google Analytics is that I can use this event as a Goal.

Track successful purchases in the web store with the Tag Manager

The most important metric is probably the successful purchase of a customer on the website / in the webshop. This metric is the most important and should be defined as a goal in Google Analytics. This means that every campaign in Google Ads and other systems can be optimized for precisely these sales.

Tracking conversions via thank you page

If there is a “thank you page” after the successful completion of the purchase, i.e. a web page to which the user is redirected to say thank you for the purchase, tracking is relatively easy. Here you only have to define a trigger that recognizes a certain link target.

For example, if the thank you page has the following URL: www.my-shop.com/thank-you.html and this URL is called only as the last step after the customer’s purchase, we define the trigger as follows:

danke seiten trigger - google tag manager event und goal tracking

This way the trigger is triggered every time the “thank you page” is called. The calls that you cause yourself during testing must then be excluded :)

The corresponding tag to send the info to GA could look like this:

danke für den Einkauf Tag - google Tag Manager Events und Goal tracking

This means that Google Analytics “rings” every time there is a purchase and a user has reached the “Thank you page”. This event can then be set as a Goal in GA.

Define goals in Google Analytics catching events from Google Tag Manager

To stay with the form tracking example, I define a goal in Google Analytics with the event information that I now track using Google Tag Manager. This conversion is thus nicely measurable and I can use it as a goal in my Google Ads or Facebook Ads, or xyyxy Ads campaigns.

GA Goal Ziel definition mit custom events

And voila, the conversion tracking setup is ready and nothing stands in the way of marketing automation. 😎

More reading tips here on the site: 

To the newsletter registration for the freshestweb newsletter.