Quick Setup: Outbound link tracking with Google Tag Manager

As an internet marketer, it’s very important that you understand your visitor navigation patterns. Are your website pages doing what they should be, or are you costing yourself a conversion from a distracted buyer?

These are things you should be aware of, and today we’ll be covering a small trick on how to be better prepared.

A few quick reasons why you should monitor outbound link clicks:

  1. Conversion funnel leaks – Do you have an outbound/external link on your check out page? It could be costing you conversions.
  2. Optimizing Click Throughs – Do you have a content page with the sole purpose of driving external link clicks? Perhaps it’s an affiliate website? Tracking external link clicks allows you to know which links are being clicked, and with what anchor text. This is great for split testing link placement and anchor text.

Method: Track External Link Clicks With Google Tag Manager

This method will allow you to view outbound link click data as a Google Analytics event. You can then utilize either custom segments or custom reporting to overlay the event dimension with other dimensions and metrics to understand your data better. We’ll provide an example after the setup tutorial.

This method can 100% be implemented directly from Google Tag Manager and requires no code changes on-site.

Step 1) Enable Default Variables

You can enable default built-in Google Tag Manager variables by clicking the “Variables” tab, and then the “configure button”. Once there I recommend enabling at the minimum Page URL, Page Hostname, Page Path, Referrer, Event, Click Element, Click Classes, Click ID, Click Target, Click URL, Click Text. These are variables we will use in later steps.

Screen Shot 2016-08-31 at 12.07.52 AM

Step 2) Setup your Google Tag Manager Trigger Configuration

This is where you will setup the trigger that causes our external link click monitoring.

  • Trigger Type: Clicks – Just Links
  • Wait for tags: Max wait time of 2000 milliseconds
  • Enable this trigger if all conditions match: Page URL matches RegEx (ignore case) .*
  • This trigger fires on some clicks: Click Url does not contain <root domain (ex: growthaddict.com)>

Outbound link tracking with Google Tag Manager

Step 3) Setup External Url Click Event Tag

In this step we will be setting up the actual tag used to collect the event data when our trigger (created in step 1) arguments are met.

  • Tracking Id: Add your Google Analytics ID here (side note: I recommend setting this up as a variable with type constant, then you can just reference it as {{GA ID}}.
  • Track Type: Event
  • Category: You can name this however you’d like. I’d recommend something such as “Outbound Link Clicks” or “External Link Clicks”
  • Action: You can set this to whatever you’d like, how I like to either use {{Page URL}} or {{Click Text}}. This allows me to see the page the click event happened and/or the anchor text that generated the click. You can concatenate these too by doing {{Page URL}} – {{Click Text}}. I like to use Page URL so that I can see it all within the event reporting interface, otherwise you can build a custom report to see events by page.
  • Label: Again, you can set this to whatever you’d like. I prefer to use {{Click URL}} so that I can see which external URL was clicked.
  • Non-Interaction Hit: I would recommend you set this to false. However, it’s important that you understand what this represents. When Non-Interaction Hit = false, an event that is triggered will alter the bounce rate and time based metrics. This is due to the way that Google Analytics calculates these metrics. When it is set to true, the event triggers, however the default bounce rate configuration is not altered. This is ultimately up to you based on your complete Google Analytics integration.
  • Advanced Settings: Tag firing options: Once per event. Essentially this means that this tag will only fire once per individual link click.
  • Firing Triggers: Select the trigger we created in step 1.

Screen Shot 2016-08-31 at 12.02.54 AM

Screen Shot 2016-08-31 at 12.03.06 AM

Step 4) Debug With Google Tag Manager Preview & Ga Debug Chrome Extension

This is a crucial step. Whenever you are pushing changes for data collection, it is extremely important that you go through a routine QC process. Mine typically entails Enabling GTM Preview and making sure the tag fires on the proper trigger and that the GTM variables are collected.

I also typically have the GA Debug Chrome Extension enabled in my Chrome developer tools console, and make sure that the event beacon is properly triggered.

If you want to take it a step farther (and I definitely suggest large sites do this), setup a replica Google Analytics Universal Profile for testing. Multiple UA tags will not cause conflict, and that way you are not putting your production profile at risk.

Screen Shot 2016-08-31 at 12.12.59 AM

Screen Shot 2016-08-31 at 12

Overall this is a pretty simple update, we completed in (including testing) in just 4 quick steps. You can customize this same setup to including monitoring element hovers, internal link clicks, etc. The possibilities are basically endless. If you have any questions, please post them in the comments!


Passionate about growth, analytics, and E-commerce. Life is about pushing the envelope.