How to track email link clicks with Google Tag Manager

Author:

Tracking email link clicks with Google Tag Manager (GTM) allows you to monitor interactions with links that contain an email address (mailto: links). By setting up a tracking system in GTM, you can gain insights into how often users click on email links, which is particularly valuable for businesses that want to monitor engagement with their contact options.

Here’s a step-by-step guide to set up tracking for email link clicks in Google Tag Manager:

Step 1: Create a Trigger for Email Link Clicks

The first step in tracking email link clicks is to create a trigger that detects when an email link (mailto:) is clicked on your website.

  1. Open Google Tag Manager:
    • Log in to your Google Tag Manager account.
    • Select the container for the website you want to track email link clicks on.
  2. Go to Triggers:
    • In the GTM sidebar, click on Triggers.
  3. Create a New Trigger:
    • Click on the New button to create a new trigger.
    • In the trigger configuration panel, click on Trigger Configuration and choose Click – Just Links (this type of trigger will activate when any link is clicked).
  4. Configure the Trigger:
    • In the trigger settings, click on Some Link Clicks.
    • Under the Conditions section, set the condition to target mailto links:
      • Choose Click URL as the variable.
      • Set the condition to contains.
      • Enter mailto: as the value (this is the standard prefix for email links).

    Your trigger will now fire whenever a user clicks a mailto link on your site.

    Example:

    • Click URL contains mailto:
  5. Save the Trigger:
    • Give your trigger a name, such as “Email Link Click Trigger,” and click Save.

Step 2: Create a Tag to Track the Email Clicks

Now that you have a trigger to detect email link clicks, you need to create a tag that will send the click data to your analytics platform (such as Google Analytics) or another tool.

  1. Go to Tags:
    • In GTM, navigate to Tags in the sidebar.
  2. Create a New Tag:
    • Click on New to create a new tag.
    • Choose a tag type depending on your analytics tool. For example, if you’re using Google Analytics, select Google Analytics: Universal Analytics as the tag type.
  3. Configure the Tag:
    • Set the tag type to Event.
    • Fill in the event fields:
      • Category: Email Link Clicks (this is a customizable name that helps you identify the event in your analytics platform).
      • Action: Click (indicates the action of clicking a link).
      • Label: You can use the built-in variable {{Click URL}} to dynamically capture the email address that was clicked. This will allow you to see which email address was clicked in your reports.
        • For example, set the label to {{Click URL}}.

    Example configuration for Google Analytics:

    • Category: Email Link Clicks
    • Action: Click
    • Label: {{Click URL}}
  4. Set Up Google Analytics Tracking ID:
    • Make sure to specify your Google Analytics Tracking ID (or use a Google Analytics settings variable if already configured).
  5. Assign the Trigger:
    • Under the Triggering section, click on the Choose a trigger field and select the trigger you created earlier (e.g., Email Link Click Trigger).
  6. Save the Tag:
    • Name your tag (e.g., “Track Email Link Clicks”).
    • Click Save.

Step 3: Test Your Tag and Trigger

Before publishing the changes, it’s important to test your configuration in GTM’s Preview Mode to ensure that the email link click tracking works correctly.

  1. Activate Preview Mode:
    • Click the Preview button in the top-right corner of GTM.
    • Enter your website’s URL in the Preview Mode setup and click Start.
  2. Test the Email Link Clicks:
    • On your website, click on an email link (mailto: link).
    • In the GTM Preview Mode panel at the bottom of your screen, check the Tags and Triggers sections to ensure that your tag fires when the email link is clicked.
    • You should see your tag firing and sending data about the clicked email link to Google Analytics (or whichever analytics platform you’ve configured).
  3. Check in Google Analytics:
    • Open your Google Analytics account and go to Real-Time > Events to see if the email link click event is being tracked in real time.
    • You should see the Category, Action, and Label values you set up in your tag configuration (e.g., Email Link Clicks, Click, and the email address clicked).

Step 4: Publish Your Changes

Once you have verified that everything is working correctly, you can publish your changes:

  1. Publish the Container:
    • In GTM, click on the Submit button.
    • Add a version name and description (optional), then click Publish.

Advanced Customizations

While the basic setup allows you to track clicks on email links, there are some advanced customizations you can implement:

  1. Track Different Types of Email Links: If you have multiple types of email links (e.g., “contact us” email, “support” email), you can further customize your trigger or use custom JavaScript variables to distinguish between them. For example, you can target links with specific email addresses or classes.

    Example:

  2. Track Additional Variables: You can also track other information about the link clicked, such as the button or text content. This would require setting up custom JavaScript variables to capture this additional data and passing it to the tag.
  3. Send Data to Multiple Platforms: If you want to send the email link click data to multiple platforms (like Google Analytics, Facebook Pixel, or a CRM), you can create additional tags that fire on the same trigger, each sending data to a different platform.

Conclusion

Tracking email link clicks with Google Tag Manager is a powerful way to gain insights into user behavior and interaction with contact links on your website. By setting up a simple Click – Just Links trigger and creating an event tag to track the clicks, you can monitor how often users click on email addresses and improve engagement with your contact forms. As with any tracking setup, always make sure to test thoroughly in Preview Mode before publishing your changes.