Affiliate link clicks and revenue tracking using Google Analytics

If you own a site, where you post affiliate links, generating revenue paid per click, you want to know which channels bring you most of your revenue and which of your visitors click more links, generating more revenue, to optimize your marketing efforts.


This is totally possible, but you can face a couple of challenges.

First, if you try to use Google Analytics goals to track clicks, you will be disappointed as GA tracks only one goal fire per session and as one user can click many links, your statistics will not be inaccurate.

To overcome this you need to use custom metrics feature (here's a tutorial).

The second challenge you may face is that different links may generate different commissions and you probably don't want the amounts of revenue for each link to be visible to the public (even in the source HTML code).

To work this around you need to use a redirect script (if you don't do that yet) and send revenue data through measurement protocol (again to custom metric) in this script.

It will work like this: every ad on your site should link to a server-side script, which will be redirecting user to the advertiser's site at the same time sending click and revenue data to your Google Analytics account.

Here's a tutorial about how to send custom metric data to Google Analytics.

If you feel this solution can help some other type of online businesses, write a comment below, so that I can add this info to the intro of the article.

If you like my articles,