SEO friendly tracking of outgoing links

As a webmaster knowing exactly which external sites your website is driving the most traffic to, can be very useful. With this knowledge you can contact the most popular sites any maybe enter some kind of partnership, or just link even more to these sites, since your audience seems to like these sites.


One way of getting this knowledge is to create a redirect page that tracks the click in a database or text file, and then redirects the user to the right page.

track.php?id=415 tracks the click and redirects the user to

The advantage of this approach is that the tracked data can easily be used for a “Top partner” or “Top Links” page/list. However this approach also has a major disadvantage – the sites that you’re linking to, don’t get any SEO benefit. For some external sites this is OK, but for other sites eg. partners, the SEO benefit of links from your site might be very important

Google Analytics

One way of keeping outgoing links seo friendly, and get statistics on the outgoing links, is by adding a small piece of javascript to the links, so the clicks can be tracked in Google Analytics. This can be done since you can specify outgoing links a a “virtual page” in Google analytics.

Normal link:

<a href=””>Link to example</a>

Same link, but with Google Analytics click tracking:

<a href=”” onclick=”javascript: pageTracker._trackPageview(‘/outgoing/’);”>Link to example</a>

With the syntax from the example above, external clicks can be found in Google Analytics by filtering page views with “/outgoing/”.

Please notice that this only works with the latest tracking code (using the ga.js script ) for Google Analytics

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS
fold-left fold-right
About the author
Jørgen Nicolaisen has been passionately interested in everything online since 1995. His experience is based on working with small hobby projects as well as high volume websites. Jørgen is currently focused on the PHP based programming framework - Codeigniter, and WordPress naturally

One Reply to SEO friendly tracking of outgoing links

  1. found your site on today and really liked it.. i bookmarked it and will be back to check it out some more later

Comments are now closed for this article.