Track your Affiliate link click stats with Google Analytics

Google Analytics is free web analytics system.Most of the websites use Google analytics for tracking their website traffic stats.You can use it to check your affiliate link click statistics as well using simple steps.This does not require any additional code addition and can be achieved in simple steps as mentioned below.

  • The first step is copying your Affiliate link code.Affiliate code can be image or text link.You can use any of them without any major issue.
  • Below is format of Affiliate link codes (I have shown both text link code and image link code to explain the process).Your code will look very similar to one of them below

Example Text Link code

<a href="http://www.udinra.com/affiliates/affiliate.php?id=udinra" target="_blank">Signup Today</a>

Example Image Link code

<a href="http://www.udinra.com/affiliates/affiliate.php?id=udinra" target="_blank"><img border="0" src="http://www.udinra.com/affiliates/banners/125x125.gif" width="125" height="125"></a>
  • In the code shown above look for the tag.In your code as well try to locate this tag combination.Now the real fun begins
  • Copy the code shown below.You will need to add this code to your affiliate links to track them using Google Analytics event tracking functionality.
onClick="_gaq.push(['_trackEvent', 'Affiliate', 'link-identifier',,, false]);"
  • In above code you can change Affiliate and link-identifier.I would recommend to keep Affiliate as it is but change link identifier to something which helps you recognize the link getting clicked.For example if you are using udinra.com affiliate link (we do not have one)then you can use Udinra in place of link-identifier.
  • Now all you need to do is add this code in your affiliate links.To do this lets take example of affiliate link example code.The modified affiliate link ad code will be
<a href="http://www.udinra.com/affiliates/affiliate.php?id=udinra" target="_blank" onClick="_gaq.push(['_trackEvent', 'Affiliate', 'link-identifier',,, false]);"><img border="0" src="http://www.udinra.com/affiliates/banners/125x125.gif" width="125" height="125"></a>
  • Lets have a look at modified code.Add I have done is to add tracking code just before > tag in affiliate code.The > tag is end tag of <a tag.
  • You can log into your Google Analytics account and see the click statistics under Events in Content area of dashboard.

Feel free to share your experience and queries.

Leave a Comment