The latest script version for Google Analytics enables you to track clicks on outbound links. By manually tagging each link to other sites using a javascript function, data on these clicks will be gathered in the content reports.
Before trying out this technique, please be sure you’re using the latest ga.js script and not the legacy urchin.js version of the script. The updated Google Analytics code can be found by editing the targeted website’s profile in the welcome screen and by clicking ‘Check Status’ at the top right corner of your website profile. Both urchin.js as well as ga.js based code is provided here.
Each outbound link on your site will look something like this, in HTML: <a href=”http://www.othersite.com”>Other site</a>. All you need to do is add a few parameters to enable tracking of outbound links, which will make it look like the below example – basically telling the Google Analytics script to treat the click as a page view, with a specific label.
<a href=”http://www.othersite.com” onClick=”javascript: pageTracker._trackPageview(’/outgoing/LinkToOtherSite’);”>Other site</a>
As you might’ve noticed, there’s a tag set inside the code named LinkToOtherSite. This tag is an artificial page name which identifies that particular link and will show up that way in the reports. You can change this tag for each individual link, making it easier for you to identify clicks on outgoing links. Adding a folder structure (‘/outgoing/’ in this example – customizable also) allows you to group click data with one recognizable phrase.
In the Content reports within Google Analytics, these outgoing clicks will be marked with the /outgoing/ phrase, but you can easily filter these out by using the exclude/include filter at the bottom of the reports.
Including clicks to outbound links in your reporting means they will be counted as page views, which means that will skew your data. To avoid this problem you can opt to open a separate website profile to collect these outbound clicks. In the website’s profile you can apply a filter which can be set to exclude traffic to a specific folder (‘/outgoing/’ in the above example), whilst in the new website profile you can set Google Analytics to only collect data from traffic to /outgoing/.