Part 2: How do you set up outbound link tracking through GTM?

This is part two of the blog series on additional measurements in Google Tag Manager. In part 1 I already explained how to set up scroll tracking. With outbound link tracking, you measure all links that point from your website to another website outside your domains. For example, consider a Facebook link on a product page. Outbound link tracking is also one of the default settings in Google Tag Manager.

Setting up outbound link tracking in Google Tag Manager

Step 1: Create variable

You first create a variable that remembers the hostname of your url. You do this by choosing an “Auto-Event Variable,” with the type “Element URL.”.

Outbound link tracking

Step 2: Create Trigger

The next step is to create a trigger in which you specify that only the link clicks that do not include your own hostname will be measured. By doing this, you are measuring links navigating away from your website, but not your internal links. This looks like this:

Outbound link tracking

In this case, all link clicks are measured except clicks to webanalists.co.uk.

Step 3: Create Tag

In the tag, you specify the naming of this extra event. I chose to call the category “Outbound link” here. In the action, I specified that it is a click and in the label I specified which hostname it is.

Outbound link tracking

In Google Analytics, this comes in as follows:

Outbound link tracking

Again, test this well before putting these changes live. With the “Preview” function, you can test whether the settings are to your liking and you can adjust them if necessary before publishing the changes. For example, check with the plug-in data player Whether the events are coming in properly.

In the next part of the blog series, I will continue about additional measurements possible in Google Tag Manager.

Secret Link