Google Tag Manager

If you are new to Google Tag Manager, you may be wondering what kind of useful things you can do with it. One of the simple things to set up is link-click tracking on your website, which can push events into your Google Analtyics and thus be tracked as Goals & Conversions, as well as providing you with information on your website performance and interactions.

We’ll cover how to set up such tracking for email links, such as someone clicking on your email address similar to contacting us: mailto:contactus@aillum.com, as well as phone number clicks, which are especially handy for tracking on mobile devices, where users can interact with your phone number directly to dial.

Setting up your Google Tag Manager Tracking

Configuring either of these is very easy to set up, only requiring a single trigger, and single tag each. It is also code-free, so no need to delve into custom HTML events with programming either.

Let’s start with the Email Tracking. First of all, create your Trigger. Name it whatever you desire, if you have your own naming conventions, or feel free to copy this example. We’ll be calling ours Email Link Click – Trigger. You’ll see below the settings we’ve used. The Trigger Type is a Click – Just Links, and we’ll only have the Trigger fire on Some Link Clicks.

Email Link ClicK Trigger

For our Condition to fire the Trigger, we’ll be firing when the [Click URL contains mailto:], so that GTM will only do anything if someone clicks on a link that contains ‘mailto:’ (an email link). Save your Trigger, and we’ll move onto the Tag.

The Tag is also very straightforward to set up. Begin by naming it, we’ve called ours Email Link Click – Tag and select it’s Tag Type, which is Universal Analytics. Below this, you’ll want to enter your Analytics tracking ID. It’s common practice to have your tracking ID saved as a constant variable so that it’s easy to input, ours is called (a very bog-standard) gaProperty, but you’d want to enter your own ID here of course.

Now it’s time to set up the Track Type. We want to send an Event to Google Analytics, so select Event from the drop down, and the fields below will change to match. You’ll see below in the image what we have used for the Event Tracking Parameters.

Email Link Click Tag

For our Category, we’ve named it simply Email Click. This is mostly just for keeping things tidy in Analytics. Below that, our Action is {{Click URL}}. If this doesn’t appear for any reason, you’ll have to open your Variables page in GTM, and tick the pre-defined variables (it’s really quick) to enable them for your tags. Using {{Click URL}} will send the URL of our link (in this case, mailto:contactus@aillum.com) as the Action in Analytics, so that we know what email link was clicked, as you may have several across your website. Lastly, the Label is {{Page URL}}, which will tell us what page of the website that your link was clicked. You can leave the other fields alone, they’re not required. Finally, select the Email Link Click – Trigger for the Trigger at the bottom, and save your Tag.

Now while that example specifically focused on Email Links, setting it up the same way works for other Links too, such as Phone or Social Media. Aside from the obvious Trigger/Tag name changes, the only real adjustment you need is to update the Condition inside the Trigger, as follows:

Phone Click : [Click URL contains tel:]
Social Facebook Click: [Click URL contains facebook.com]

Similar to the Email Links, these will push the same information as events straight into Analytics. Remember to Preview/Publish if you wish to test or make it live, of course!

Why set up Tracking this way?

So why would you bother setting up these types of Triggers and Tags? Well, it doesn’t require you to go into your website code and create events for these occurances individually. More importantly, it doesn’t require you do that for every single page that you have these links on your website. If you have a clickable link to your phone number, or email, or your twitter/facebook/etc on multiple pages, you would have to set up events up for each link, which is time consuming and prone to error if a mistake is made in any of them. And if a link or phone number is updated, they’ll all have to be updated individually to compensate.

Using GTM removes all that hassle, as no matter what the links are, or change to, those triggers and tags will cover your entire website, and report precisely what and where each link was clicked.

If you understand how this works now, you can imagine that there really is all kinds of tracking you can do using this simple trigger and tag setup. The information really is invaluable, not just for tracking, but also measuring your performance of your website by being able to see where and what your visitors are actually clicking.

Related blog posts ...

Leave a Reply

Your email address will not be published. Required fields are marked *