How to Track Outbound Links From Your Website (for the Non-Developer)

I can sing the praises of Google Analytics all day long…but there are a few places where it falls short. Outbound link tracking is one of those places.

For websites that rely on outbound linking to sponsors, partners, etc., it’s crucial to have the statistics for those sponsors/partners to back up the validity of said partnership. For other websites, tracking clicks to outbound links may be important for a particular campaign you’re running or simply as a statistic of interest.

Regardless of the reason, it’s easy for even the non-developer to track these links. (Developers, there are also plenty of extra ways for you to track outbound links. You can find instructions here to auto-track your links.)

For those of us who are non-developers and willing to manually track links, here’s what you’ll need to do.

1. Tracking code

Be sure that you’re using the new Universal Analytics (analytics.js in your tracking code). If you’re using the old Analytics tracking code (ga.js), you’ll need to follow this tutorial instead.

2. Add your code

Start by editing the page where your link is located. If you’re using WordPress or another CMS, you’ll need to go into the “Text” or HTML tab.

For a text-based link, here’s an example of the code you’ll need to input.

<a href="http://www.example.com" onclick="ga('send','event','Sponsor Links','Example.com')" target="_blank">Learn more about Example.com by clicking here.</a>

The only things you’ll need to change in this example are:

  • “http://www.example.com”: enter the link you’re sending people to here
  • ‘Sponsor Links’: this is the name of your Event campaign as you will see it in Google Analytics. For each individual campaign, use a different name.
  • ‘Example.com’: this is the name of your Event, so be as specific as possible here
  • Learn more about Example.com by clicking here.: include your unique content here; this is what visitors will see before they click your link.

Important: Once you input this code into your Text tab in WordPress, you must always edit that page in the “Text” tab. If you go back to the “Visual” tab, your code will be lost.

3. Check your Google Analytics

Once your code has been applied, you’ll be able to track clicks on your outbound links under Behavior > Events.

If you have a sponsor or partner, simply click down to that company’s name and download the PDF report to send to them. You can also set up auto-emails to send weekly or daily.


Happy coding!

Want to get more amazing digital marketing tips?