Tracking Outbound Links in Google Analytics

Can we make something easier than Google Tag Manager?

Google Analytics is a powerful tool. I think it’s often underrated and overlooked due to some of it’s UX challenges (though they are actively working on that). So I started investing more time with it. I wrote another post about tracking custom events and I’ve discovered ways to automatically track events with a short snippet of JavaScript.

This tool I’m building is called Telepathic Black Panther. It’s open-source and completely free to use. So you’re very much welcome to it, but just keep in mind that it’s still a work in progress. I will post about it more in the future as it evolves.

Today, I’m just very quickly writing about one tiny facet of web analytics. One that I feel is important: tracking outbound links. Your content likely has many links out to other sites, but do you know which ones are being clicked on the most? This might help you determine a few things, keeping in mind that clicking on a link is an engagement:

  • What your readers are really interested in
  • How much traffic you’re sending someone’s way
  • What keywords and calls to action work well and get people to click

One prescribed way of tracking outbound links is through Google’s Tag Manager (help here). I’ll tell you why I’m not a fan of this though.

It’s a fairly involved setup when you think about it because you’re led to apply that function to every link on your page. So the more clever JavaScript coder would say, “Put a listener on all the links.” Ok, that works, but what if it’s not outbound? “Then check the URL in the click event callback.” Ok, but now we have one last problem; what if my link opens in a new window?

The example Google shows us will always take the visitor to the URL in the same window. That’s really bad if you want to keep people on your site. It could provide poor UX depending on your site and the needs of your visitors.

A lot of extra JavaScript needs to be written in order to handle this properly. Telepathic Black Panther does this for you automatically and triggers another click event which will take the visitor to the URL in a new window, the same window, a popup, or whaever target was originally set. This maintains the expected behavior.

This is a much more graceful and flexible approach that doesn’t degrade the user experience or limit you. Best of all, one short line of JavaScript code will set this up for you if you use Telepathic Black Panther.

Here’s what you’re left with in your Google Analytics reporting dashboard:
(note in this case I’m only tracking the domains, but I could track the full URL)

Google Analytics Outbound Link Tracking

Tags// , ,
comments powered by Disqus