Wednesday, December 8, 2010

Google Analytics cross domain tracking made easy: gaAddons v2.1.1 released!

Let's face it, unless you are very skilled at JavaScript, have perfect control over the tagging of the sites and have achieved a level of understanding of Google Analytics that you could be a GAAC, cross domain tracking with Google Analytics is a real pain!

gaAddons v2.1.1 stable version available

Thanks to the growing list of supporters of gaAddons, this version fixes many annoying bugs and introduces _setXDomain.

Bug fixes
  • Fixed issues with handling of right-click vs regular click for _trackOutbound and _trackDownload
  • Outbound links and downloads should open in the _self window by default, unless a TARGET is specified
  • Fixed bug with _trackLoadTime where it was always triggered even when onBounce:false
Enhancements and other changes
  • New _setXDomain call
  • Tested for compatibility with Mootools
  • Added wmv, mp4 and flv to the default list of tracked file types in _trackDownload
  • Enhanced options:debug to provide more complete info when using Firebug
  • _trackOutbound and _trackDownload now support a "format" option which gives greater flexibility to track with the taxonomy you want (this is cool!)
  • _setHourOfDay is deprecated since this is automatically handled by GA

_setXDomain: cross domain tracking made easy

This feature handles the most common scenarios for cross domain tracking with Google Analytics:
  • One domain & subdomains
  • Multiple domains & subdomains
  • One domain & sub-directories of another domain
  • A single sub-directory
The same snippet of code is simply added to all pages, on all domains you need to track, and gaAddons takes care of calling _setDomainName, _setAllowLinker, _setAllowHash and _setCookiePath as needed and automatically set the outbound _link and _linkByPost where required.

Lets look at the "Tracking Across Multiple Domains and Sub-domains" from Cross-Domain Tracking on Google Analytics help center.
Credit: Google Analytics Help Center
It could hardly be easier with gaAddons:
_gaq.push(['_setXDomain', {
     domainName: 'example-petstore.com'
     }]);

That's all you have to do!

Now, imagine there is a blog on petstore.blogger.com. Easy!
_gaq.push(['_setXDomain', {
      domainName: 'example-petstore.com',
      include: /(petstore.blogger.com)/
      }]);

"domainName" is always the main domain under which you want everything to be tracked, "include" is a regular expression that specifies the other domains, directories of other domains or just the directory that needs to be tracked.

I want it!

You can give it a try! gaAddons is free for personal use and non-profits. See Pricing for commercial rights of use for corporate websites, freelancers and agencies.

Please use Support to report issues or just send feedback & ideas for future releases.