Event tracking, bounce rate and affiliate marketing

Bounce Rate and Event TrackingApparently, the way event tracking tracking works in Analytics, and how it impacts bounce rate, is still not understood as widely as I expected it to be, and I’m not the only one to think that. So let me explain to you how bounce rate is influenced by (properly set up) event tracking, and how to do that setup.

How event tracking influences bounce rate

My buddy Avinash tweeted a link to a comment he left on a post that’s actually an interview with him on the Bruce Clay blog. In the comment he talks about for whom bounce rate is a good metric. Michael Gray, an “old time” SEO and affiliate, who apparently hasn’t learned much about analytics in all that time ( just kidding Michael ;) ), tweeted:

“As an affiliate or adsense publisher I want u to come and leave as quickly as possible how is that not a bounce.”

Let me state this very clearly: it is not a bounce. A bounce is a visit to your website that doesn’t result in a second pageview or a desired action. If you’re an affiliate, the outbound click might very well be your desired action. To be able to properly optimize your campaigns, you should track these outbound clicks. The “proper” way to do that is to either track them as pageviews, with the benefit of being able to tag them as goals but with the disadvantage of inflating pageviews, or as an event.

Or, as the Google Analytics documentation describes it:

“[…] a “bounce” is described as a single-page visit to your site. In Analytics, a bounce is calculated specifically as a session that triggers only a single GIF request, such as when a user comes to a single page on your website and then exits without causing any other request to the Analytics server for that session.”

So, if you track your outbound affiliate clicks as events they wouldn’t counted as a bounce. This way, these outbound clicks would be counted as a separate action, making the visit into a “non bounce” or, which is maybe a better name, an “engaged visit”. This is independent of whether you use Google Analytics or another package, you could for instance use Clicky, a very good alternative for those of you with tin foil hats.

How to implement event tracking for affiliate links

In the examples below I’ll assume you’ve properly hidden your affiliate links with a redirect:

Google Analytics

For those of you who use Google Analytics and are not smart enough to use WordPress and my Google Analytics plugin, you should be tagging your outbound affiliate links in a way similar to this:

<a href="https://yoast.com/out/vps/"

This example uses the asynchronous tracking method, if you want reliable tracking of outbound clicks like this, you should be using that, as it’s a lot more reliable than the old synchronous method.


In Clicky outbound link tracking of links like this is ridiculously simple, you don’t even have to know javascript:

<a class="clicky_log_outbound" href="/out/vps/">


In conclusion: please don’t think you have a high bounce rate because you have an affiliate site. You have to tag your links properly, if you want to do serious analysis. The minute you do, you should be seeing these clicks appear in your analytics and your bounce rate go down, and you no longer have to claim visits that aren’t bounces as bounces.

36 Responses to Event tracking, bounce rate and affiliate marketing

  1. Jesper Jørgensen
    By Jesper Jørgensen on 27 October, 2010

    Hi Yoost

    Goo dpoints. I myself prefer to track such external clicks as virtual pageviews as it allows me to measure goals and conversion rates on different traffic sources. If you care for your pageview / session rate, you can set up a profile that filters out the external clicks.

    I am experimenting in making an eCommerce transaction for each outbound click, which allows me to put a monetary value on each click, just as you can with trackEvent. If it will work with tens of thousands of external clicks a day is still an open question though. By the way I also stuff in a tracking code for Google Adwords conversions for better monitoring in Adwords, which is actually possible on a onClick event if you do some hacking.

  2. James
    By James on 26 October, 2010


    I installed your GA plugin and implemented Event Tracking. Unfortunately the only outgoing URLs where the tracking code was inserted were the clean (non-aff) ones (that I didn’t really want to track as events). Why was the code not added to the others? Could it be because they are nofollowed, use the title attribute, or are contained within a table (td and tr elements)?

  3. John
    By John on 21 October, 2010

    Hi Joost,

    Quick question.

    Taking your Google example code – would it be ok to implement it as follows? (removed the ‘/out/vps/’ bit)

    I’m using a template so installation is easy, however each outbound URL is unique.


  4. Michael Geneles
    By Michael Geneles on 21 October, 2010


    I agree with you point about measuring the right stuff for your site, and I think your Google Analytics plugin does a fantastic job at that. However, I have to side with Michael Gray on the idea that it is best to mask and obfuscate your affiliate efforts as much as possible.

  5. Peter Hamilton
    By Peter Hamilton on 19 October, 2010

    We just added a new feature on the HasOffers tracking platform called “Goals.” This feature allows you to place separate pixels in the conversion funnel and track various user actions for a single tracking session. This also allows you to incentivize (or pay affiliates) for each of these “Goals.” This is really great for learning about how people interact with your site when moving toward a conversion, and it is definitely helpful in studying bounce rates. Our system also records the time the session starts and the time each “Goal” (or conversion) is reached and tells you these differences. Pretty cool :) HasOffers Affiliate Tracking Platform
    ps, you can also pass GA pixels back through our pixels :)

  6. Nicholas Zeitler
    By Nicholas Zeitler on 18 October, 2010

    Thanks again for the help. Do you know of any reason why this would happen? Meaning why would Visits go up the exact same amount when adding in outbound tracking?

    • Joost de Valk
      By Joost de Valk on 18 October, 2010

      Can I have a look at that complete function exactly as it is in your code?

  7. Nicholas Zeitler
    By Nicholas Zeitler on 18 October, 2010

    One quick question for you. Is outbound event tracking for the Asynchronous code in Analytics supposed to show up as additional page views? Seems a bit strange, but maybe that is how it is supposed to work. Let me know! Thank you!

    • Joost de Valk
      By Joost de Valk on 18 October, 2010

      No, if you use the code above it would show under Content -> Event Tracking -> Categories, to dig deeper you could then click on “aff” and see where all the clicks went.

      • Nicholas Zeitler
        By Nicholas Zeitler on 18 October, 2010

        Thanks for the response. I am using the method that Google suggests onClick=”recordOutboundLink(this, ‘Outbound Links’, ‘Keyword’);return false;” and it added to my site visits, almost the exact same amount as what is being tracked with this event tracking method. So, your tracking method might cure this issue?

        • Joost de Valk
          By Joost de Valk on 18 October, 2010

          If you’re referring to the recordOutboundLink function as described here, this would do exactly the same (though in less code) and NO it would not add pageviews to your stats whichever of the two you choose.

          • Nicholas Zeitler
            By Nicholas Zeitler on 18 October, 2010

            Sorry I meant Visits not page views. I will have to research this more. Thank you!

  8. rishil
    By rishil on 18 October, 2010

    I was having this exact argument with someon at A4U – they keopt complaining their site was high in SERPs but the bounce meant they are losing conversions – the crux was they werent tracking outbound.

    The lady was going to send insane cash to redesign the site to reduce the bounce, but i kept telling her she isnt looking at the “real” bounce rate.

    Thanks for this Joost, I can now send this off to her to look at (I am hopeless at explaining analytics…)

    • Joost de Valk
      By Joost de Valk on 18 October, 2010

      Glad to be of assistance Rishil :) If you’ve got more stuff like this you’d like to see in a post: let me know :)

  9. Luc
    By Luc on 18 October, 2010

    Hi Joost,

    Nice post. I use the redirection plug-in to mask all (hundreds) of my affiliate links. What is the easiest way to add event tracking without modifying all my post. All links are set up like /out/amazon/

    Is it possible to add a (.htacces) rule that all /out/ links also hit the eventtracking in GA?

    • Joost de Valk
      By Joost de Valk on 18 October, 2010

      Hey Luc, check out my Google Analytics plugin, it has an option to do exactly that, if you enable outbound link tracking you’ll be able to track all links to /out/, for instance, as outbound, and give them a specific label that’s suffixed to the location they were clicked in, so you’d get outbound click tracking that’d be categorized as ‘outbound-widget-aff’, ‘outbound-article-aff’ etc.

  10. Luciano
    By Luciano on 18 October, 2010

    Hi Joost,

    very good post but I wonder how we can track clicks on Adsense with event tracking in order to reduce bounce rate. Is it possible?


  11. TheAffairLady
    By TheAffairLady on 18 October, 2010

    Does bounce rate effect SERPS?

  12. Avinash Kaushik
    By Avinash Kaushik on 18 October, 2010

    It is always super wise, if you want to make intelligent decision rather than sit back on ancient knowledge, to stay in touch with the continuous evolution on the part of analytics vendors. One such cool thing is event tracking. It comes with many benefits one of the sweetest is clean tracking of bounce rates for sites with outbound links.

    Thank you so much for taking the time to share these instructions. They are super valuable (and a good add by Andre as well!).


  13. graywolf
    By graywolf on 18 October, 2010

    Yes I get that technically you can set up GA to track aff links so things don’t get recorded as a “bounce”. But thats all “voodoo math”. What do we think Google is REALLY doing with the user data they get from say things like the toolbar? If someone searches for “cheap hotel rooms NYC” lands on an aff page clicks a link and ends up on say expedia, do you think the data google has tells them your aff page was “good” or that they didn’t need to pass through your page in the first place? After talking with many Googlers they consider a return to the SERP page and a clicking a second time as a “failure”, so I don’t think they consider the middle man affiliate page a good thing either, IMHO they don’t see it any differently than they see a “bounce”.

    If you’ll notice whenever captain sprite gets asked does google use “bounce” data he is very cagey, chooses his words carefully, and tip-toes around the whole issue. If they affiliate industry wants to grow up and get around this issue they need to let aff’s create subdomains where customers can checkout without going to a new domain. My 2 drachmas.

    • Joost de Valk
      By Joost de Valk on 18 October, 2010

      Dude, I meant you particularly when I referred to Clicky and tin foil hats, of course :) . Let me, for once, be very ffing harsh:

      This is not about Google, I could care less about all the drama some affiliates (such as you) make. If you add value as an affiliate, you’ll be treated fairly by Google in most cases, if you don’t, you shouldn’t be in Google anyways.

      This is not about Google: this is about measuring the right stuff for your site. This is about knowing what a bounce is, and how you can use bounce rate, measured in whatever package you want, to optimize your site. The fact that you were ignorant of that is what ticked me off.

      I know your fear of Google and I laugh at it: all the time you spend worrying about it, I spend making more fun, money or plugins & websites and usually all of those.

      • graywolf
        By graywolf on 18 October, 2010

        I’ll respectfully disagree. You should build value independent of a search engine to be sure, but you have to realize you are playing in google’s playground, and when you ignore them it’s at your own peril.

        While they don’t hate aff websites, lets be honest they don’t trust them either, and IMHO aff websites have a higher bar to clear, so masking your intent as an affiliate is an extremely prudent move. If you don’t believe me take a look at the latest leaked quality raters guide, you’ll see they take a very dim vief of most affiliate websites.

        • Joost de Valk
          By Joost de Valk on 18 October, 2010

          We agree on hiding affiliate links; I think that’s even before their quality raters and I agree it’s not as nice as it should be. As Greg Boser once taught me though: “think of it this way: what would you do if you were them”. And to be honest, I’d punish affiliate links too. It’s an easy way of pushing a lot of crap down.

          The fact of the matter is, if you focus on adding value, this is not something to be worried about. If you focus on adding value, too, the bounce rate is an extremely useful metric in a lot of cases. That’s what this whole thing was about.

          If you don’t want to use Google Analytics, I’m totally fine with that, in fact, in some cases I’ve taken to using other products because of similar issues, and not while dealing with affiliate sites, but while dealing with VERY big spenders in Google AdWords.

          What I take issue with is making it all sound like one big conspiracy theory, like they’re out to get “us” or “you”. They’re not. They’ve got better things to do. Pushing pages down when they have certain attributes that a lot of affiliate sites share and other sites have not is probably a very simple way of cleaning up SERPs, so, yes, you have a “higher bar”: you need to make sure you don’t look like an affiliate.

          • Jeroen Bouserie
            By Jeroen Bouserie on 25 October, 2010

            Hi Joost,
            you CAN track real bounce rate in GA if you use gaAddons 2.0 by triggering an event after 30 seconds on a page (default).

            I’m not affiliated with Stéphane Hamels’ immeria but I do appreciate his work.


          • graywolf
            By graywolf on 19 October, 2010

            You call it being negative, I say I’m just being a realist. ;-)

            Let’s assume that I use google analytics and properly encode it so that it doesn’t show as a bounce there. But if google still counts it as bounce from say toolbar data which do you think matters?

            Indulge me for a moment, do you think google is using user metrics as a factor in ranking?

          • Joost de Valk
            By Joost de Valk on 19 October, 2010

            Yes I believe they are using user data, and it entirely depends on how fast you get people to click through. In Clicky, a visit is not measured as a bounce anymore if they’ve been on the page for more than 30 seconds, in Google Analytics there’s no such thing, and it’ll still be a bounce even though they spent 5 minutes reading your article. If they click through to another site after 2 seconds, I doubt you’ve added much value, if it’s 30 seconds or a minute though, of course you’ve added value and I see no harm in it.

          • graywolf
            By graywolf on 18 October, 2010

            I’ve lost too many sites that where aff sites that were obvious aff sites, some that where good enough to be chosen to be part of google pilot programs. They where killed right after the pilot program ended. So maybe I am a little extra wary and buy into the conspiracy theory but thats what my first hand experience has taught me. Remind me next time I see you and I’ll give you some of the details.

          • Joost de Valk
            By Joost de Valk on 18 October, 2010

            I know you have tons of experience and I thank you upfront for being willing to share that, my whole issue is: don’t be so ffing negative and on the warpath. It doesn’t help anyone, and it obviously gets in the way of your own learning sometimes…. Question for you: do you know how to use bounce rate and event tracking now? Will it help you optimize your sites even better? :)

  14. Rein Baarsma
    By Rein Baarsma on 18 October, 2010

    Thanks for the clarification. Google Analytics seems so bloated these days that I hardly get a good grip on what’s possible. Only recently started to use things like utm_campaign to get some more specific info on specific projects and links to my site. But I feel like an ignorant fool when I read your posts on Analytics ;)

  15. André Scholten
    By André Scholten on 17 October, 2010

    If you’re making money with outbound links, please fill in an amount as an extra argument in the event code:

    <a href="http://yoast.com/out/vps/"
    onclick="_gaq.push(['_trackEvent','aff','/out/vps/', 10]);">

    Than you’re able to assign value to your incomming sources. Even if you don’t know the exact value, fill in a number and use it as a rating system.

    • Joost de Valk
      By Joost de Valk on 18 October, 2010

      Yeah good point André! In fact, I’d make it at least triple or 1/3th of the actual value, so people (read: competitors) reading your code don’t know what it really is :)

      • Dave
        By Dave on 18 October, 2010

        That’s a tip to write down in our secret little notebook ;)

Check out our must read articles about Analytics