The process to track mailto clicks as events in Google Tag Manager is easy using the auto-tag events. Google’s less detailed resource to track mailto clicks as events in Google Tag Manager can be found here. When looking to track mailto clicks as events in Google Tag Manager I had difficulty finding a good, thorough resource that didn’t have me include a bunch of unnecessary rules. You need the mailto click listener tag and the tag tying this to an event. One tag can capture multiple mailto clicks as events and separate them.
What You’ll Need to Track Mailto Clicks as Events in Google Tag Manager
- You’ll first need your GTM container, code, created and placed on your site pages
- You’ll also need a tag for your standard Analytics tracking code with an “all page” rule
How to Track Mailto Clicks as Events in Google Tag Manager
1. Create a “click listener” tag. Create a new tag and name it something descriptive like “Mailto Click Listener:
2. Set tag as “click listener.” Select Tag Type > Event Listener > Click Listener:
3. Set rule to fire tag on all pages. This is a default tag in Google Tag Manager. Firing Rules + Add > All Pages > Save
4. Set rule to fire event upon ONLY mailto: link clicks in Google Tag Manager. Firing Rules + Add > Name Mailto Clicks > {{event}} equals gtm.click > + > {{element url}} contains > mailto > save:
5. Save your Mailto Click Listener tag.
6. Create new tag. Name something descriptive like “Mailto Click Event.”
7. Set Universal Analytics as Tag Type (Classic if you’re using the old code). Tag Type > Analytics > Universal Analytics
8. Paste your UA # under tracking ID. Include “UA-xxxxxxxx-xx”
9. Track Type – Event.
10. Set your Category, Event and Label. Mailto event tracking category can be “Mailto” action, “click” and use {{element URL}} as the label in case you have multiple “mailto” addresses this will specify within Analytics reporting.
11. Add one rule for tying to the mailto event trigger. The same rule created in step 4. Firing Rule > + Rule > Whatever You Named the Rule > Save:
12. Save your tag.
13. Create version and publish your latest Google Tag Manager draft.
** Swap “mailto” in the rule in step for with any other internal link to track it.
That’s how to track mailto clicks as events in Google Tag Manager. The “Element URL” in the label will differentiate all “mailto” clicks on your site in Analytics. Check out your real time report to confirm, but you’re done!
Hello,
Thanks for this great tutorial. We have tried and its working! It works on GTM 2.0
Keep on going 🙂
Thank you Adrian, I have the mailto events tracked, is there anyway that I can run a report to see the domain of the email sender?
Not via Google Tag Manager because it takes a user to the mail client, which is outside of the parameters of your site. Depending on your form, you may be able to write a script to extract the email field and strip everything from @ and prior.