Tech tip: Google Universal Analytics not tracking?

Google's latest version of its  Analytics website-analysis tool - Universal Analytics - offers all sorts of bells and whistles for the SEO fan. Custom dimensions, keyword and referrer exclusions, much broader device support, the list is long.


That's all very exciting but what happens when the Universal Analytics installation doesn't work?

When installing Universal Analytics across a variety of managed sites I was faced with a group of sites that just would not report any activity. Everything had been installed correctly, the tracking code was plainly visible in the right place when viewing source, but all I got was a bunch of flatlined dashboard graphs and this in the admin console:



One thing gave me a clue: every one of the problem sites was running the Joomla content management system (although some of my Joomla sites were reporting to Universal Analytics perfectly fine); then I worked out that every one of the problem Joomla sites had been built using a site template that relied on the Mootools javascript library.

A quick test confirmed that Mootools and the Universal Analytics tracking snippet do not play well together - when Mootools was disabled Universal Analytics began functioning normally. While we wait for an updated version to resolve the conflict, here's a quick fix. Un-define the ga.create method in your analytics.js snippet like this:

if(!ga.getByName) ga.create = undefined; //add this line to your GA snippet
ga('create', 'UA-XXXX-X');
ga('send', 'pageview');

That is all! Get tracking!


-- Simon