onClick event tracking with Universal Analytics
Earlier this year Google launched Universal Analytics which is a new version of the Google Analytics tracking code as we know it. The main difference? The new version tracks a great deal more information than ever before and that’s where we’re going to benefit.
The idea behind this new tracking code is to track the behaviour of a visitor rather than just the anatomy. On top of this, the new tracking code will tie data together across different platforms and devices, thus broadening the data being collected – it will even allow for the tracking offline conversions.
Suffice to say, everyone will be upgrading to Universal Analytics and for those of you who have used onClick event tracking code to track events in the past you’ll have to make some adjustments before upgrading. This is really important, if you upgrade to Universal Analytics and your event tracking is still as it is below, your events won’t be tracked:
onClick=”_gaq.push([‘_trackEvent’, ‘Category’, ‘Action’, ‘Label’]);”
Instead, you’ll have to replace that code with the following as the push method is no longer applicable, but rather the send method:
onClick=”ga(‘send’, ‘event’, ‘Category’, ‘Action’, ‘Label’);”
Google has provided a fantastic document that breaks down the new tracking methods and details each attribute precisely. It is recommended that you have a read here.
We’re not sure whether Google will one day automatically convert everyone over to Universal Analytics, but there’s a chance that might happen and to avoid problems or missed events, we recommend that you upgrade to Universal Analytics and update your tracking code accordingly and as soon as possible.
Of course, Google’s Tag Manager has been created to assist with managing your campaigns and allowing you to focus on marketing and not programming. Here’s a good video on Google Tag Manager that will bring you up to speed: