How to Track Email Clicks Using Google Tag Manager

Analysts, it’s time to stop struggling with capturing mailto click data. If you’re one of the many analysts out there who use Google Analytics, you may have completely deleted all of your mailto links and replaced them with a single Contact Us form. But for those of you who kept at least one mailto link on your site or decided to not bother recording who clicked on the link(s), thankfully you won’t have to disregard those mailto links anymore.

For the longest time you probably had to use workarounds, as Google Analytics missed out on capturing email link click data. But thankfully Google Tag Manager comes to the rescue. Whether it’s to see how many people clicked the email link on a specific page or to see how many potential emails you lost with an incorrectly spelled email address, email link tracking using Google Tag Manager comes in handy.

So let’s get into the details of mailto click tracking in Google Tag Manager!

 

Preparing your website for email link tracking

If this is the first time using Google Tag Manager for your website, make sure you check out how to set up Google Tag Manager before continuing with this article. Secondly, double check that all your mailto links are spelled correctly and properly set up. For example, your mailto links should look something like this: mailto:content@bayleafdigital.com

 

Setting up key elements in Tag Manager

Now that all the prep work is out of the way, let’s get into the three steps you must take to successfully track email clicks.

Create a variable
To create a variable, go to the far left column and select “Variables.”

Left Navigation in Google Tag Manager Variables

From there, scroll all the way to the bottom of the page where it says “User-Defined Variables.” Click “New.”

User Defined Variables

Then you’ll see a screen like the one below. Fill out both steps with the following:

Name of the variable: Element URL – Email (or something that’s easy for you to remember and recognize what this variable does)

Choose Type: Auto-Event Variable

Variable Type: Element URL

Component Type: Full URL

Element URL Email

 

Create a trigger
Now let’s create a trigger. Go back to the main Google Tag Manager dashboard, go to the far left column, and select “Triggers.”

Left Navigation in Google Tag Manager Triggers

Then you’ll see a screen like the one below. Fill out the four steps with the following:

Name of the trigger: Click – Email mailto (or something that’s easy for you to remember and recognize what this trigger does)

Choose Event: Click

Configure Trigger Targets: Just Links that waits for tags at a max wait time of 2000 milliseconds

Enable When: Page URL matches RegEx .*

Fire On: contains mailto:

Click Email mailto

 

Create a tag
The final step is to create a tag. Go back to the main Google Tag Manager dashboard, go to the far left column, and select “Tags.”

Left Navigation in Google Tag Manager Tags

Then you’ll see a screen like the one below. Fill out the four steps with the following:

Name of tag: Event – Email Click (or something that’s easy for you to remember and recognize what this trigger does)

Choose Product: Google Analytics

Choose a Tag Type: Universal Analytics

Configure Tag:

Tag Type: Universal Analytics

Tracking ID: Your Google Analytics UA ID

Track Type: Event

Category: Email

Action: Click

Label: {{Your variable}}

Fire On: Click using your recently created trigger

Event Email Click

Event Email Click - Click Trigger

Event Email Click - Fire On

Testing your Tag Manager tracking

All three parts (tag, variable, and trigger) are now set up and ready to be used on your site and recorded in Google Analytics. But before you go live with your email link tracking, let’s test it out first.

Go to the top right of your screen where it says “Publish.” Click the dropdown arrow and select “Preview.”

Preview Email Click Tracking

Your page will refresh and say that you’re in Preview Mode. To see if your email click tracking works, navigate to the site where the email tracking will occur.

You should see a window at the bottom of your screen with all the Google Tag Manager tags firing. Once you click one of your mailto links, look in the summary section of the window for “Tags Fired on this Page.” If you see the message below, then you’ve successfully implemented email click tracking on your website!

Tags Fired on Page Email Click

Now, go back to the Google Tag Manager dashboard and select “Publish” from the top right. Your email click tracking is now live! Congrats!

Publish Email Click Tracking

Looking for some Google Tag Manager help? Check out our Google Tag Manager consulting services.