Why your Event Tracking has Died Using Universal Analytics

Have you been happily tracking events but then were coerced in this fancy new “Universal Analytics” which was the next big thing. Analytics of the future.. track any electrical device and track your fridge opening and closing or how many times the coffee machine has been used.

So you welcome this new world of Analytics and expect magical things to happen. So what does actually happen? You lose all your event tracking. Brilliant! Thanks Universal Analytics! You’re a star!

Don’t stress, I can help you. What to know what’s even better? I can’t code! So everything I will be saying is from the ultimate layman. If I can do it, you can… so lets do this.

Since there are a multitude of events you can create, I am using a simple button onclick event, which is quite commonly used.

What you will need:

  1. Find your event button locations
  2. Some super mean copy paste skills.
  3. A little coding experience won’t go astray.. but as long as you have Pt 2 covered you should be fine. Again, I’m from the Pt 2 crowd.

Ok so lets get your event tracking running again!

Generally the reason why your event tracking has gone off the charts is because the new script for Universal Analytics uses different calling methods to trigger an event. For people that don’t code (like me), it just means the scripts are different so require different event tracking codes.

So those who are having these issues generally upgraded their Analytics profiles and code but didn’t upgrade their event tracking. I’m assuming this is you. Either way, read one.

To check what Analytics are running, go to your Analytics, Visit Admin -> Property -> Tracking info -> Tracking Code. Now check the source code of your website (usually ‘Right click’.. view source code. Now if it matches then you are on your way, the next step is easy. If you are running Tag Manager (please tell me you are.. if you arn’t we need to have a chat) check your Analytics tag in your container. Make sure it matches up.

Next Step – Event triggers

Go to where you have specified an event on your site. You will notice it doesn’t look like a ‘normal’ <a href link right? It may look something more like this:

<a href="/targetpage" onClick="_gaq.push(['_trackEvent', 'Category', 'Action', 'Value']);">Click here!</a>

Now this is the easy part. Since we have a new way to code an event, you will need to make it look like this:

<a href="/targetpage" onclick="ga('send', 'event', 'Category', 'Action', 'Value')">Click here!</a>

Remember those Copy Past skills? It’s time to put them into action! For normal event tracking, like a click on a button, then you just need to make sure that you keep those written in red the same.

Give it a quick test and see if it tracks. Let us know how you go.

Now you can push these into Jimmy as cool Kpi data or in a graph.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>