Tuesday, November 9, 2010

gaAddons: outbound links tracking with Google Analytics

Over time I have seen numerous agencies, consultants and practitioners suggest ways to track outbound links with Google Analytics. Even Google offers an overtly simplified perspective to manually track clicks on outbound links. Sadly, most of the time the proposed solutions lacks quality and elegance or simply miss on several points commonly found "in the wild". Here are some of the things I have taken into account while developing the _trackOutbound call in gaAddons:
  • should outbound links be tracked as events or page views? (see here to decide!)
  • because it's firing another call to Google Analytics, tracking on the 1st page view of a visit will impact the bounce rate, is this what I want? See "to bounce or not to bounce?"
  • do you take into account the GA call might be cancelled before having enough time to complete - and GA suggest to add a 100 millisecond delay (which causes other issues...)
  • should I blindly track all outbound links or use include/exclude regular expressions to narrow down the tracking on what's really important for the business? 
  • do I really have to  manually go and alter every link on every page if I want to track outbound links?
  • if I already have an onclick event on specific links, what will happen if I blindly parse the Document Object Model (DOM) to replace the onclick handler?
  • how is the "target" attribute of A HREF handled? Are links going to open in new windows or the existing one?
  • what should really be collected? The URL as a whole with all of its arguments? Just the domain name? How do I "classify" those links?
  • what happens with links that are within the cross-domain tracking?
  • how do you handle right-clicks?

gaAddons to the rescue

_trackOutbound is one of many calls found in gaAddons that can be seemlesly integrated with your regular Google Analytics async code snippet. Simply follow the integration instructions, add _gaq.push(['_trackOutbound']) and voilà!

What is unique about gaAddons?

  • ease of integration: you can tag GA? you can use gaAddons!
  • independent development: gaAddons was created so it could be used by agencies, freelance consultants and practitioners with a simple "fair use" licensing model
  • growing support: the more it's being used, the more it's undergoing the test of fire, the better it will get for everyone!
  • ever expanding: other great features are on the way: automated cross-domain tracking, internal campaigns, micro-formats support, etc.

Take a look at the enhanced gaAddons website, give it a try and let me know what you think!