Step by Step: Outbound Link Tracking in Google Tag Manager
Following up on last week’s post on event tracking, I thought it would be a good idea to deep dive on outbound link tracking. Outbound link tracking is super easy to setup using Google Tag Manager and the insights you can gain by understanding the most common paths to leaving your website are definitely worth the minimal effort to implement. So, without further ado, here is a step by step guide to setting up outbound link tracking via Google Tag Manager.
Before you being, be sure you’ve enabled the necessary pre-defined variables in Google Tag Manager.
Step 1: Create a new tag in Google Tag Manger.
– Select ‘Google Analytics’ as the tag and Universal Analytics as the tag type
– Choose ‘Click’ for what triggers the tag to fire
Step 2: Create a new trigger
– Select ‘Click’ as the event.
– Configure the trigger by naming (I’d recommend naming it ‘Outbound Link Click’) and choosing the trigger type. In this case, the trigger type should be ‘Link Click’
– Enable this when the ‘Page URL matches RegEx .*’ (this means it will be enabled on all of your pages)
– Since you’ll only want the trigger to fire on outbound links, you’ll need to set the filter to fire when ‘Click URL does not contain www.mydomain.com’ (otherwise it will fire on all link clicks, including clicks to other pages on your own website)
Step 3: Configure the tag. This is where you will add your property ID and name the event tracking parameters
– Name the tag. I’d recommend ‘GA – Outbound Link Click’ as it’s clear this is a Google Analytics tag and it’s tracking outbound link clicks. If you have a lot of tags in your container, you’ll appreciate a naming structure like this as you’ll be able to differentiate between GA, AdWords, Doubleclick, and other tags with a quick glance.
– Choose a track type of ‘Event’
– Add your tracking parameter specifics:
Action: Page URL (this is a pre-defined variable which gathers the page URL where the link was clicked from)
Label: Click URL (this is a pre-defined variable which gathers destination URL where the link click takes the user)
Step 4: Save the tag, then preview & debug. Be sure to test this out on an outbound link to ensure the tag fires when you click an outbound link from your website. Once you’ve confirmed this, publish the tag!
The final tag should look like this: