Tracking outgoing links in Google Analytics
Imagine you have an affiliate website, you have added Google Analytics so you now know where your traffic is coming from. This information is great and will help you target your marketing campaigns whether that be SEO or PPC to the areas which are generating leads for your site.
There is however one problem, how do you track outgoing links? For an affilate website this is very important. You need to know where your traffic is going to after it arrives on your site. If you started tracking outgoing links you would then be able to know which of your affiliate sites is receiving the most traffic, and where users are clicking on your site.
From this information you can move your adverts around to generate the most traffic to the affiliate you want. Usually the one that pays the best commission!
But how do you achieve this? Please see steps below:
Step 1
Add the tracking code to the links you want to track, in the example below the links are being tagged as affiliate program-1.
<a href="http://www.example.com" onclick="javascript:
pageTracker._trackPageview('/out/affiliate-program-1');">Step 2
Next you will need to move your original analytics tracking code to appear before the above code. It is good practice in this case to add the code to the header of the page.
Step 3
Well thats it! This will now fake a page view in your Google Analytics interface. To make tracking the links easier you should add the fake page view into a Goal (see image below)
![]()
Now each time a users clicks on any affiliate 1 tagged links a goal will be recorded. This makes it easy to track how many clicks each of your affiliate links is receving. The same principle can be used to track any type of out going links












Leave your response!