How to track Internal and Outbound link clicks in Google Tag Manager

By 30th Jun 2019Blog, Google Tag Manager
How to track Internal and Outbound link clicks in Google Tag Manager

In this post I’ll show a method to track Internal and Outbound link clicks using Google Tag Manager. This will allow you to see which links your website visitors are clicking on and how they navigate on your site.

You can also check out the next post; How to measure Internal and Outbound link clicks in Google Data Studio. In that article I look at how you can monitor these link clicks using Google Data Studio.

Before we begin, just to make sure we’re clear on the definitions;

  • Internal links – an internal link is one that points to another page on the same website.
  • Outbound links – an outbound link is one that points to a page on a different website.

The method to set them up in Google Tag Manager (GTM) is similar, and I’ll go through them one by one.

Creating an Internal Link Tag in GTM

First click to create a new tag.

Google Tag Manager - Add a New Tag

Then choose a Google Analytics type tag.

Google Analytics tag type in Google Tag Manager

Then set up your tag as the following;
Track Type = Event
Category = Navigation
Action = Internal Link Click
Label = {{Click URL}}
Google Analytics Settings = Your GA tracking code

PS – you may need to configure the Click URL variable in order to add it to this tag.

Google Tag Manager tag - Internal Links. Internal and Outbound link clicks.

And now we need to create our Internal Links trigger.

Google Tag Manager create a trigger

We need to choose the Click > Just Links trigger type. Then you should set it up to fire on ‘Some Link Clicks’.

Then set the following conditions; Click URL > contains > [your website URL].

Setting up a trigger in Google tag manager for tracking Internal and Outbound link clicks

We can name this trigger “Internal Link Clicks“. Now we have our tag, which I have named “GA – Event – Internal Link Clicks“.

Internal and Outbound link clicks

Once you’ve set up the trigger, we now have our Internal Link click tag fully created and ready. Next step is to create one for external links.

Creating an Outbound Link Tag in GTM

Follow the same steps as you did in setting up the Internal Link tag. Also choose to create a Google Analytics Event tag.

Google Tag Manager tag - Outbound Links.  Used for tracking Internal and Outbound link clicks

Then set up your tag as the following;
Track Type = Event
Category = Navigation
Action = Outbound Link Click
Label = {{Click URL}}
Google Analytics Settings = Your GA tracking code

Then create a Click > Just Links Trigger. Set it up as shown below.

We can name this trigger “Outbound Link Clicks“. Now we have our tag, which I have named “GA – Event – Outbound Link Clicks” and our trigger to measure these clicks.

Internal and Outbound link clicks

We now have our both our internal and outbound link tags set up. The next step is to test them.

Testing your Internal and Outbound link click tags

The first thing to do is to enter Preview Mode in Google Tag Manager.

preview mode in GTM

Now go and click on an outbound and an internal link on your website. You should see both tags firing in Google Tag Manager.

Google Tag manager - Internal and Outbound link click tags firing. How to track Internal and Outbound link clicks in Google Tag Manager

The next step is to confirm that the data is appearing correctly in Google Analytics.

Go to Google Analytics (preferably to an unfiltered view where your own IP address is not excluded) and click on Real Time > Events.

Google Analytics - Real Time - Events

Then click on some outbound and internal links. If everything is working correctly you should see them appear in Google Analytics.

Internal and Outbound link click firing shown in Google Analytics real time. How to track Internal and Outbound link clicks in Google Tag Manager.

Hope you enjoyed this post tracking Internal and Outbound link clicks using Google Tag Manager.

Visit the next post to see how to measure these link clicks using Data Studio.

If you liked this article you might like my other blog posts.

Or you can follow me on Twitter!

Michael

Author Michael

More posts by Michael

Join the discussion 6 Comments

  • very useful article thank you, Michael. Would it be possible to do this only on the home page ?

    • Michael says:

      Thanks Nicolas! Yes. You could set the tag to fire only on specific pages, then choose only the homepage. So on your Link click trigger, you could set the conditions to include only fire when the page URL = homepage.

  • Faith Taylor says:

    Great guide, Michael – very helpful. Is it possible to exclude certain pages? Example – the ones I’ve set to noindex. Thanks

    • Michael says:

      It should be possible to exclude certain pages in Google Tag Manager when creating the tag. But I haven’t tried that myself.

  • Sandy Ken says:

    If you have several outbound links on a particular page and you want to see which of those links are being clicked, is it possible to set up? Thanks.

Leave a Reply