Website Income

How to ACTUALLY set Up Google Analytics Click Tracking – Affiliate Links and External Clicks – Step by Step Guide

I need to be able to be able to record in Google Analytics each click on an affiliate or non-affiliate external link so that I can:

  • Identify the traffic sources for my highest converting visitors
  • Identify new content/affiliate program opportunities
  • Identify my affiliate links/pages that result in the highest click through rate

You would think the above would be easy but after several years online, visiting a lot of sites supposedly showing me how to do this and talking with lot of people I believe there are very few people online who can answer the following question about visitors to their website…

Where are your top 5 earning affiliate links located on your site and where do people that click on them come from(Google, Facebook, Twitter, Another Website)?

Using the steps outlined below I now can come closer than ever to answering that question. This tutorial uses only Free Tools and will hopefully show others how they can as well. We will be using 3 free tools for this…

  1. Google Analytics
  2. Google Analytics Plugin by Yoast
  3. Simple URL by Studiopress or Pretty Link plugin

Credit to Yoast for his article here, much of my strategy is based on his work and his excellent analytics plugin.

Also, if you are really interested in getting all the data you may want to see the paid services of GetClicky and HubSpot provide a lot of detailed lead and click tracking.


Why Track Outbound Non-Affiliate Clicks In Google Analytics?

By tracking outbound clicks you are able to understand what websites you are sending your visitors to and potentially identify a matching affiliate offers to send them to instead. Or it can generate post ideas knowing what information your visitors are going to when they leave your site.

For example if I learn 10 people per day are going to a website I linked to through a non-affiliate link about the best chequing bank account for students I can do one of two things

  1. Change the link out for an affiliate link to the best bank account for students
  2. Create a similar student bank account review post and direct them their

Once you understand where your customers are going when they leave your site you can do a better job of directing them to options that improve the total value for both parties (you & them).


Why Centrally Manage Affiliate Links?

Affiliate links are typically ugly long looking URL’s, like the example below, that can be unwieldy when you are copying and pasting them into different locations on your website. By using a URL shortner you can get an easier to use URL.

PLUS – You can handle affiliate program changes with ease! For example on my authority site (My Case Study Website URL is Now Hidden) I send people to a free credit check offer through an affiliate link. In the future the affiliate program I want to send people to may change and since I manage all my affiliate links from a central location I will only need to go back and change the destination URL for my shortened /click/credit-check. If I just entered the affiliate link directly into each article I would have to go back and find every instance of the link and change it.

This can be a huge time saver when an affiliate changes who they run their affiliate program through, this way you will only need to change to the new affiliate link in one location not potentially 100’s.

  • Original affiliate link =
  • Shortened affiliate link =


Why Cloak Affiliate Links?

SEO Benefit – I could put some words here but lets take it from someone smarter…

Yoast“Google will always say they won’t penalize you for affiliate links per se, but for thin content around it. I can make this into a long story, but let’s make it short: there’s very good reasons for me and several other highly respected SEO’s and affiliates around the world to think otherwise. “



How to Track Clicks in Google Analytics – Step by Step Tutorial

Set Up Affiliate Link and External Link Click Tracking With WordPress and Google Analytics

I am assuming you have WordPress installed and your Google analytics code, now follow the 3 part plan below…

  • Part 1 – Cloak Affiliate Links
  • Part 2 – Track Affiliate Link Clicks in Google Analytics
  • Part 3 – Track Non Affiliate Link Clicks in Google Analytics


Part 1 Cloak and Manage Affiliate Links


  • Install Simple URL Plugin or Pretty Link Plugin (I will use the Pretty Link Plugin)
    • Pretty Link Plugin


  • Decide on a prefix to use for all your affiliate links
    • I will be using the prefix “click”


  • Write down all the affiliate links you have on your site or plan to have on your site. I used a quick table in excel to think this through. Thinking through your affiliate offerings before your start making the links can really help in structuring the URLs in a logical way.


The settings I use for all affiliate links are as follows…

    • 301 Redirect
    • “No Follow”
    • Track Hits
    • Assign to a group if it makes sense for your tracking purposes 

Add Links

  • More Advanced Step (can be skipped) – The 301 redirect may still allow Google to identify the link as an affiliate, the “Nofollow” you selected in the step above should stop that from happening. However, if you want to be sure you can add a single line to your robots .txt file…
    • Disallow: /click/
    • Or instead of click use whatever pre-fix you are using for your affiliate links


  • Copy Link and insert it into your website as required (most time consuming step!)
    • TIP – SEO Smart Links plugin can do this automatically – I don’t use this but some people swear by it.
    • TIP – Entering a key affiliate link using the Quick AdSense plugin just above or below any ad block can be profitable

Adsense Ads

Part 2 Track Affiliate Links in Google Analytics



  • IMPORTANT Update the Google Analytics Plugin to Track Your New Affiliate Links
    • This plugin is great and makes it very easy to track links to an internal cloaked affiliate link. Simply do as the picture below shows and it will start tracking every time someone clicks on one of those affiliate links as an event in Google Analytics.

Affiliate Link

Part 3 Track External Link Clicks in Google Analytics


  • Ensure Google Analytics Plugin is set to track external link clicks


2 Findings from My New Data worth Potentially $1000’s!

You may be wondering why go to the effort above well now I can take the following actions…

  • FINDING – Facebook Converts Better than Anything Else! – Even though Facebook sends the 40th most traffic as a referral to my site it was the source that generated the 2ndmost affiliate link clicks.
    • ACTION – I had it on my to-do list to better utilize Facebook but based on the conversions I need to bump it up my to-do list and start soon.
    • I need to be careful since the sample size is relatively small and the statistical significance would be well under 95%+(but I don’t feel like doing a Chi Square test to confirm). After some more data comes in I will revisit to confirm.

Referral Traffic Sources:

Referral Traffic Sources

Event Tracking Conversions by Source

Event Category


  • FINDING – Missing Out On Affiliate Sales– In the last 30 days 51 people have clicked from my site to two institutions that provide student loans and I have no affiliate relationship with them.
    • ACTION – I will approach both to see if I can join an affiliate program and if not potentially look at replacing the link on the articles to an institution I have an affiliate relationship with(as long as it doesn’t affect user experience).


Final Tips

TIP – Jet Pack for WordPress can track external clicks but it does not have the same level of detail as Google Analytics.

TIP – Do not “no-follow” ALL your outbound links & Do not only have affiliate links on your website. Both of which are indications to Google of a low quality site.


This is my new method for tracking my affiliate link and non-affiliate link clicks.

I know there are people more advanced with more advanced systems set up and I would like to learn from them. If you have a system set up for tracking clicks, conversions, sources etc that puts mine to shame please share it in the comments!

About the Author Authority

Leave a Comment:

Add Your Reply