Track Clicks On Outgoing Links with Google Analytics

By | January 27, 2009

Google analytics has been my one of the top website analysis tool that I often use to track not only my site(s) traffic but also find out how visitors are navigating through my content. I have been using it for over a year now and so far it has helped a lot in making my content placement even better. I can easily find out how many hits I get to a particluar page and various other stats.


This post is all about how you can easily track clicks on your site outbound links i.e the links placed on your site that point to other sites. These can be any links for example ,text links within your web page body, blog roll links in sidebars, image banner links etc. By default Google analytics does not povide number of clicks on outgoing links so we have to add a little piece of JavaScript to the links that we want to track so that whenever those links are clicks, analytics is notified and it tracks that link. For example we want to track click(s) on text link which has the HTML code : 

<a href=”http://www.outlink.com”>OutLink</a>

After adding the tracking JavaScript code, the above link becomes this :

<a href=”http://www.outlink.com” onClick=”javascript: 
pageTracker._trackPageview(’/Links/outlink.com’);”>OutLink</a>
See the text (‘/Links/yourlink.com’) . This is your custom tracking text that you will later use to track the above link. For example the above link is in my blog roll so I make the text (‘/Outgoing/Blogroll-Link.com’). If you have various different locations that you want to track make sure you assign them names that you can remember easily. Now that you have added the code log in to your Google analytics account and the left menu click Content>Top Content. This will open that stats of you your top conetent pages. Now go to the bottom where it says Find page as shown in the image below :    

Finding Outgoing Link Stats with Google analytics

In the search box enter the text ‘/Outgoing/Blogroll-Link.com and it will show you stats on all the links that you have added the JavaScript code. Remember that Google analytics does not show realtime stats and stats are updated after 24 hours so you will be able to see the click report after a day or two.

One thought on “Track Clicks On Outgoing Links with Google Analytics

  1. mev

    with onClick you may lose some information. If you click the right button and select the context menu “Open in new tab” – event onClick does not work, Google Analytics will not count anything, you lose some visits or events. read about it here http://chenado.net/en/1040.html

    Reply

Leave a Reply

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