Analytics

Mailto links are sometimes the only option available for visitors who wish to initiate contact with a business via their website.

With this in mind, it’s vital that these interactions are traceable within website performance monitoring tools such as Google Analytics.

In this post, I’ll explain how to track mailto links within Google Analytics using Tag Manager.

What are Mailto Links?

It’s almost standard practice for commercial websites to display contact email addresses. In many cases these are coded into the website as mailto links.

This means that the email address effectively becomes a hyperlink. When clicked, it allows users to send an email to a specific address without the need to copy and paste it into an email client.

Our website contains mailto links within the footer. By viewing the source of the page you can see how this is coded:

mailto link code

The Problem with Mailto Links

Although I appreciate why mailto links exist, I have two main problems with them.

First, depending on your operating system or browser, mailto links will have a default email client that opens when clicked. This is problematic if you don’t have the default client installed, or if this client isn’t your preferred choice to send and receive emails. This of course can be changed, but not everyone knows how to do this, or even that this is possible.

Second, mailto links pose a challenge for digital marketers when it comes to tracking and measuring KPIs and website performance. Mailto links leave a lot to speculation. Even if someone clicks on the mailto link, there is no certain way to be sure that they successfully managed to compose and send the email.

In terms of measurement, it’s better to use embedded contact forms. You can measure the completion of contact forms much more accurately and effectively within Google Analytics via Event Tracking, Goals, or a mixture of the two.

On our website, we use both mailto links and contact forms because we want to make sure that we cater to everyone’s preferences. However, our contact forms are given much more prominence and we prefer to steer our visitors towards them. They are easier to complete, they capture all of the information we require, and they provide us with much more useful information with Google Analytics.

With all that said, if there are no other contact points on the website and mailto links are the only option, there is a way to measure interactions with these email addresses within Google Analytics using Google Tag Manager.

This post assumes that you have a knowledge of what Google Tag manager is, that you have it set up for use with your website, and that you know how to use it.

If you’re new to Tag Manager, or if you need a refresher, read our introduction to Tag Manager.

Tracking Mailto Links using Tag Manager

What follows is a step by step guide to setting up mailto link tracking using Google Tag Manager.

The first thing you will need to do once you have logged in to Tag Manager is create a trigger. In this example I have named the trigger “Mailto Click”:

new trigger

Then select the “Click” Event Type:

click event

Next you need to choose when tag manager should “listen” for these link clicks. This will depend on which pages contain mailto email address.

In this example the email address is in the footer of our site. It therefore appears across all pages of the site.

This can be targeted by selecting the “Page URL matches RegEx  .*” within the “Enable When” section. This will ensure that all pages listen out for the link click trigger:

enable when page url matches regex

The next step is to define when you would like your trigger to fire. We of course would like the trigger to fire each time someone clicks on a mailto link on our website.

To achieve this, select “Click URL” – “contains” – “mailto” as shown below and save the trigger:

Fire On click url containts mailto

The next step is to fire the “Event” to Google Analytics. For this you will need to create a new Tag and connect it to the previously created trigger.

Name your tag appropriately. In this example I have opted for “Mailto Click Event”:

google analytics tag

Select Google Analytics. Then, with “tag type” set universal Analytics and specify your tracking ID.

You will then need to configure the tag by first setting the “Track Type” to “Event”, and then by defining the Event Category, Action and Label as shown below. The {{page path}} variable will enable you to gain information in relation to on which page of the website the mailto link click occurred.

If you wouldn’t like your link click to affect your bounce rate metric, you can set the “Non-Interaction Hit” to “true”. However, as the link click is an interaction, I prefer to leave this as “false”:

configure tag

Once you have clicked continue, you will then need to select a firing trigger. This has of course been previously created and so you will need to select if from your “existing Click Trigger” list:

save previously created trigger

Click save to create the tag. All being well, the trigger will now fire each time someone clicks on a mailto link:

save tag

Tag Manager allows you to preview and debug your tags to test that triggers are firing correctly:

preview and debug

Open up preview and debug mode. Visit your website and click on a mailto link. You should then see that upon this Event the tag fires your “Mailto Link Event”:

preview and debug click

As an additional check I always like to view the Event within the Real Time area of Google Analytics:

double check in real time

The final step is to set up a Goal within Google Analytics to track the mailto link click event. To do this, create a new custom goal up and select “Event” as the goal type:

mailto event goal

Ensure that the Event conditions are correct as per your previously defined Event within Tag Manager. Once saved, this will ensure that any Events are also tracked and recorded as Goals for your mailto link clicks within Google Analytics:

mailto event goal

Google Tag Manager is a great tool that removes the reliance on development resources to track interactions across a website. It provides great flexibility to those with little coding or technical knowledge who are looking to track website performance.

In relation to mailto links, all websites using them should follow this guide and start tracking visitor interactions. This is particularly important if this is the only way visitors have of getting in touch via written message!

I’d also strongly recommend that you look to implement embedded contact forms within your website to capture data in relation to enquiries, leads, quotes etc. This will provide much more accurate picture of website performance when hooked up to Google Analytics.

If you have any difficulty in setting up the tracking detailed in this post, then please don’t hesitate to leave a comment below and we will get back to you.

2 responses to “How to Track Mailto Clicks within Google Analytics Using Tag Manager”

  1. Luca says:

    hi, the only thing I would like to address is when you verify the goal in GA and GA tells you “This Goal would have a 0% conversion rate based on your data from the past 7 days”..we know there are clicks to mailto, how can GA be wrong and not report it?

  2. Jonathan Ellins Jonathan Ellins says:

    Hi Luca,
    Event tracking goals do show up a percentage of people who have triggered them within 7 days. Either there hasn’t been any event tracked over the past 7 days or the event tracking code isn’t setup fully. Try the tips in our blog here on the topic: https://www.hallaminternet.com/using-google-analytics-event-tracking/

Leave a Reply

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