How to Track Outbound Links in Google Analytics

Track Outbound LinksWe’re as big an advocate of data-based marketing as anybody out there. In order to make informed marketing decisions, it’s important to track more than what a basic Google Analytics set up will give you. Did you know that with a combination of Analytics and Tag Manager it’s possible to track the engagement of almost any element on your website?

If you want to move beyond basic pageview analytics, one thing you may want to track is clicks on outbound links. Wouldn’t it be nice if Analytics just told you which external links people clicked on your site that took them away? While Analytics doesn’t do it natively, we can easily set it up in Google Tag Manager.

This will give you an idea of what types of content people are interested in and will let you evaluate if external resources you’ve linked are useful to your audience. It can also let you see if anyone clicks on things such as your social media links. Finally, if you’re working with an external partner on your content, tracking outbound links will give you data to show if you were able to drive traffic to their site.

Outbound Link Tracking Using Google Tag Manager

Before you get started tracking external links you’ll need to make sure you have Google Tag Manager set up on your site. Then you’re going to set up some new variables and create a new tag and trigger set.

Step 1: Set Up Tag Manager Variables

Now we move into Google Tag Manager (GTM) for the rest of this setup. We’re going to ensure that the click variables we need are enabled and also set up a Google Analytics settings variable.

  1. In GTM, navigate to the Variables section.
  2. The top part of the Variable section is for Built-In Variables. In this section click the Configure button.
  3. In the menu that opens; scroll down and check:
    1. Page URL
    2. Page Path
    3. Click URL
  4. Next, you’ll want to create a user-defined variable to connect your Analytics account.
  5. In the User-Defined Variables section, click on the New button
  6. Name the variable GA – Settings
  7. For the variable type, scroll down to Utilities section and select Google Analytics Settings
  8. For the Tracking ID, enter the tracking ID from your Google Analytics property
  9. Click Save

 

Google Analytics GTM Settings

Step 2: Create a trigger

In Google Tag Manager you’ll need to get up a new trigger to indicate when an external link was clicked so that the tag can be sent to Google Analytics.

  1. Click on Triggers in the left-hand menu and then click on the New button.
  2. Name the new trigger External Link Click and click in the Configuration box to set it up
  3. Choose Click – Just Links as your trigger type
  4. In the configuration box check both checkboxes
  5. Enable the trigger for all pages
    Page URL matches RegEx .*
  6. Select the Some Link Clicks radio button
  7. Fire the trigger when Click URL
    1. Does not contain mailto:
    2. Does not contain tel:
    3. Does not contain your domain
  8. Save the trigger

External Link Click Trigger

Step 3: Create a tag

  1. Click on Tags in the left-hand menu and then click on the New button.
  2. Name the new tag External Link Event and click in the Configuration box to set it up
  3. Select Universal Analytics as your tag type
  4. For track type, choose Event
  5. Category: External Links
    Action: {{Click URL}}
    Path: {{Page Path}}
  6. Under Google Analytics settings, choose your existing GA settings variable
  7. Save the tag

External Link Click Tag

You’ve now completed setting up external link tracking on your site. Publish your changes and soon you’ll see data start to populate Google Analytics. You can now use these events in dashboards and to set up conversion goals.

If you have any questions tracking outbound links in Google Analytics, please get in touch.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.