Tracking Outbound Links Using Google Analytics


Like many webmasters, you probably use Google Analytics to track your website visitors, where they came from and what actions they perform on your site. Many adult webmasters are also heavily reliant on outside affiliate programs for revenue and drive traffic to other sites. What many Google Analytics users don’t know is that you can use the same software to track outbound links and match that data up with your affiliate program reported stats. It is rare that these stats will match up exactly because of the way that Google Analytics tracks your data (using a javascript snippet which is not 100% accurate), but you can get decent relative metrics on which links are more popular than others and how moving links and ads around the page can change your click thru rates.

Here are the steps to setup and track outbound links on your site:

Google doesn’t have it’s code on the outbound site, so you need to assign a snippet of javascript to the outbound link itself that assigns the link a page on your site. Then this link will show up in pageviews as the page that you defined it as. The code is pretty easy:

Suppose your oubound link is www. and you want it to show up under pageviews as outbound/

You would place the following code on that link:

<a href=”” onClick=”javascript: pageTracker._trackPageview(‘/outbound/′);”>

If you had another page called and you wanted it to show up as /outbound/

you would place the following code on that link:

<a href=”http://www.” onClick=”javascript: pageTracker._trackPageview(‘/outbound/′);”>

and so on. Google Analytics takes 24-48 hours to collect quality marketing data, so just place the code, wait a day and check in your top content report. You should see the pageviews showing up with the name for the link that you defined. You don’t have to name it /outbound/, we just picked that name because it is the easiest for a large number of links. You could name it /outboundlinks/ or literally anything you want. It is best to make a logical directory structure though, so you can easily sift through a large number of outbound links in your top content report. Here we could just search for the text outbound on the top content report and we would see all outbound links that we are tracking. If we searched for the text on the top content report we would see all the outbound links going to

Any more questions? Give us a shout and we would be happy to help here: 

Leave a Reply

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