Track Mailto Clicks As Key Events In Google Analytics 4 Events Using Google Tag Manager

As we work with clients on reporting, we must set up a Google Tag Manager account for them. Google Tag Manager isn’t just a platform to load all your website’s scripts; it’s also a robust tool to customize where and when you wish to trigger actions within your site using any scripts that you’ve included.

Providing a monitored email externally on your site is a great way to make it easier for visitors to drop your sales team an email. Here’s what that HTML anchor tag looks like:

<a href="mailto:[email protected]">[email protected]</a>

Google Analytics (GA4) Events offer the opportunity to measure events within a site. Events are necessary for measuring interactions like clicking calls to action, starting and stopping videos, and other interactions within a site that don’t move the user from one page to another. Conversions are now known as key events in Google Analytics and are measured similarly.

Event Tracking In Google Tag Manager

The solution is to employ the advanced capabilities of Google Tag Manager. As long as Google Tag Manager is implemented on your site, you never have to touch your content or code to deploy event tracking like this. The steps to do so are as follows:

  • Trigger – Set up a trigger executed when a site visitor clicks on an email (mailto🙂 link.
  • Tag – Set up an event tag that is processed each time the trigger is executed.

Part 1: Set Up Your Click Trigger

  1. Within your Google Tag Manager Account, navigate to Triggers on the left navigation and click New
  2. Name your Trigger. We called ours Click to Email
  3. Click in the Trigger Configuration section and choose the trigger type Just Links
Google Tag Manager Trigger for mailto: links

Part 2: Set Up Your Event Tag

  1. Navigate to Tags
  2. Click New
  3. Name your Tag; we named ours Mailto Click Event
  4. Select Google Analytics: GA4 Event
Google Tag Manager GA4 Event Trigger
  1. Add Your GA Measurement ID (Recommend that you add this as a Variable).
  2. Name your event; we named ours click_to_email.
  3. Click the Triggering Section and select the Trigger you set up in Part 1.
Google Analytics GA4 Tag for Event for Mailto Click

Step 3: Google Analytics 4 Key Event

Formally called Conversions, if you’d like to monitor how many users are clicking this link within your analytics as a conversion, you’ll want to add it as a Key Event.

  1. Navigate to Admin > Key Events
GA4 Key Events (Previously Conversions)
  1. Add the event name that you set up in step 10 above for the Key Event (click_to_email)
  2. If you only want to allow one of these events per session, you’ll want to click the 3 dots to the right of the event and select that.
GA4 Key Events Once Per Session

Now, regardless of the page of your site, if a user clicks the mailto link any time within a session, a key event in Google Analytics will be recorded when someone clicks the email link!

Tip: Google Analytics doesn’t track events typically in real-time for your site so if you are testing the site and going back into your analytics platform, you may not observe the event being recorded. Check back in a few hours.

If you’d like to set this up for phone number clicks, read our other article:

Track Click to Call LInks as Key Events in GA4 With Google Tag Manager

©2024 DK New Media, LLC, All rights reserved.

Originally Published on Martech Zone: Track Mailto Clicks As Key Events In Google Analytics 4 Events Using Google Tag Manager