Counting Clicks: Using Google Analytics to Monitor Affiliate Traffic

As affiliates, many of us have accounts with multiple networks and independent programs. However, getting a quick snapshot of our daily clicks isn’t always the easiest task in the world and can be time consuming. Fortunately, with a slightly different approach to adding links to a website, we can give ourselves a one page overview of what got clicked today.

For the purposes of this example, I’ll utilize Google Analytics to monitor affiliate click outs. Start by logging into your account, and look under the Content heading. You’ll find a section called Events. Events differ from Goals in that they can happen without a URL being called. For instance, watching a video on your website could be an Event.

Luckily for affiliates, there’s the option to utilize Events to show clicks on affiliate links by adding some very simple code to your HTML. It’s called an “On Click” Event, and here’s how you can turn a standard link into a source of valuable information. If you’re new to Events, I suggest checking out Google’s official explanation to help familiarize yourself.

Customizing Your Links

A standard Avantlink affiliate link, for example, looks like this:

The XXXXXs in the URL represent your specific account info, and the CTC is something you can set up for a specific campaign inside Avantlink. Most networks provide this kind of tagging. So in HTML, your link structure would traditionally look like:

<a href=””>Buy Now</a>.

To trigger an event that gives you the tracking data we want, add the following:

<a href=”” onClick=”_gaq_push([‘_trackEvent’, ‘Category’, ‘Action’,’Label’,’Value’”]);”>Buy Now</a>

You’ll replace Category, Action, Label, and Value with specific terms that have meaning to you. Now going forward, data for that link will show up in Google Analytics under Events.

Integrating Links in Content

So let’s say you’re writing a blog post about a specific North Face jacket that’s on sale at an Avantlink merchant this week. We can do this:

onClick=”_gaq_push([‘_trackEvent’, ‘Affiliate-Click’, ‘Blog-Clickout’,’North-Face-Jacket’,’16.7’”]);”

Going back to the original link setup, we can see that the Category is Affiliate-Clickout, the Label is Blog-Clickout (especially if you want to separate blog clicks from datafeed clicks), and North-Face-Jacket is the Label. You’ll also note I used 16.7 as the Value.

For me, I like to put in the potential commission in the Value spot. Of course, I still don’t know if the transaction completed at the merchant site, but it will be showing potential earnings in Google Analytics. You may also want to use your average EPC for that merchant as the Value. It will give you a better estimate of your daily performance.

Reviewing Your Events

Viewing the results of your Events in Google Analytics works almost like any other screen, meaning you can select a Secondary Dimension. If you pull the drop down to indicate Source, you’ll get a list of all your Events, and what traffic source sent the visitors that are clicking your affiliate links. This parameter will tell you if Google is still your prime source of good traffic or if Facebook has taken first place.

If you’ve been looking for a straightforward way to measure your site traffic, using Events will help you get a better understanding of traffic that’s actually clicking through to your merchants. As an affiliate, that’s a huge leap forward towards making more money.

About Kevin Webster

Kevin Webster manages web analytics, SEO, and SEM accounts for He also assists in OPM duties there, and blogs on his own at Kevin has been in affiliate and online marketing since 2003, and web analytics since 2005. Over his career, he has worked in B2B lead gen, outdoors/recreational SEO and SEM, and in the manufacturing space.

18 Responses to Counting Clicks: Using Google Analytics to Monitor Affiliate Traffic

  1. Wilco says:

    Great way to track your clicks indeed! 

    Did you also know it’s possible to track the actual sales as well? In other words, have all the sales you generate (at the merchant) in your own Analytics-account (being the affiliate). It’s explained at (it’s a bit of a work-around..)

    • Wasn’t familiar with that at all.  Just to be clear, no personally identifiable information is being sent back to Google Analytics with that script, is there?

      • Wilco says:

        Nope, nothing more compared to an original E-Commerce transaction.

        • Read over your FAQ, and you indicate you store the VISITORS GA cookie in a database.  Is that accurate?

          • Wilco says:

            Yes, that’s correct. That’s why everyone should research for themselves whether they think it’s appropriate for them to use.

            What it does is read out all Analytics-data (umtz / umta etc), save that and (when the affiliate network reports a sale) send a E-Commerce transaction with the exact same data that would’ve been send to Google if the user would’ve placed an actual E-Commerce Transaction.

            So yeah, it’s a bit of a work-around.. Not perfect, but it does work.

          • You did a really nice job with that.  I’m just double checking that it doesn’t violate the Google TOS.  If it doesn’t, I’ll be using it to test.  Thanks Wilco.

          • Wilco says:

            Let me know! 🙂

      • Wilco says:

        Nope, nothing more compared to an original E-Commerce transaction.

  2. […] Just had a new article go up over at Revenews: Counting Clicks: Using Google Analytics to Monitor Affiliate Traffic […]

  3. Nick Loper says:

    Kevin, great info as always.  Do you think there’s any risk in giving Google this extra information, given their particular brand of “love” for affiliate sites?  Or maybe not since they probably are already tracking these clicks anyway?

    • Thank you VERY much, Nick.  My initial thought is that there’s no additional exposure or risk.  If it makes you feel better about it though (we all want to sleep at night) you can cloak your links, use a URL shortening service, and come up with “codes” for your events as opposed to “Affiliate-Clickout” etc.

      In fact, in many cases, I just use a merchants name as the Category.  That way, I can see what I’m leaving on the table.  If I send 400 clicks to merchant X with a potential commission value of $6680 (400 times the $16.70 in potential commissions), but I consistently only get $200 in commissions, I might want to explore other merchant options.

      The math in this comment is made up, obviously, but I think you can get a feel for it if you play a bit.

      • Nick Loper says:

        I’m with you.  I’ll think I’ll test it out on a smaller guinea pig site first, then see if it can be automated into the bigger datafeed site.  Thanks again for sharing.

  4. Indeed, thanks for this helpful info!

  5. […] Counting Clicks: Using Google Analytics to Monitor Affiliate Traffic, […]

  6. Greg Hoffman says:

    I’m sending this to several clients. Thanks Kevin. 

  7. Chris says:

    Darn good post Kevin …. I had absolutely no idea Google could track events in analytics.  A good project to get an outsourcer working on (adding this to links on sites).

  8. […] found an article by Kevin Webster on updating your Google Analytics links to capture the click through.  It’s geared towards affiliate marketers, and I believe you can benefit from the knowledge […]