Analytics is one of those things that hasn’t always been at the top of my priority list until recently. Google Analytics has many features I’ve never used before because I haven’t had the time to sit down and really investigate what they can do for me and my clients. A few months ago, in one of my late night GA adventures, I found a section on event tracking, a small love soon formed.
Like most of you out there I often find myself creating different CTA’s (Calls to Action) and wonder how effective they really are. Google Analytics allows you to setup goals but that really doesn’t track the effectiveness of your specific CTA’s. Through the combination of event tracking and CTA’s, you can easily find those CTA’s that are not making the cut and replace them with something more effective.
The Setup
First you will obviously need to have Google Analytics installed on your website. If you already GA installed on your website you need to make sure you have the most current, up to date, script. If your script in not current you can follow the instructions
HERE depending on if you are using asynchronous snippet, traditional snippet, or the urchin.js tracking. Once your GA script is setup correct to allow tracking you are ready to setup the links you will be tracking.
Before we start to use event tracking we should take a quick look at the syntax and the way you can use it. The syntax for the _trackEvent() method is:
_trackEvent(category, action, label)
- category (required)
The name you supply for the group of objects you want to track.
- action (required)
A string that is uniquely paired with each category, and commonly used to define the type of user interaction for the web object.
- label (optional)
An optional string to provide additional dimensions to the event data.
Example: seomoz.org
Lets first look at how you can use event tracking and use SEOmoz as an example. In the image below are two unique CTA’s that both end up at the same page. How would you tell if a user clicked on the top CTA or the bigger CTA in the middle of the screen? Using event tracking it would be quite clear what CTA was the most effective at getting clients to that page.
Implementing event tracking is quite simple, you just need to add a simple onClick javascript action fill that with the _trackEvent syntax and you’re done. Below is how I would setup link tracking for the two CTA’s we discussed above in the example section. It may look a little different for you depending on if you are using asynchronous snippet, traditional snippet, or the urchin.js tracking. The example below is for asynchronous tracking.
In the example you will see that the category for the tracking is set as “GoPro”, because the CTA is about becoming a PRO member. The action is “FrontPage” because both of these CTA’s are located on the front page, you could also place the URL or page in this area. The label is set as a unique identifier, either “TopMenu” or “MiddleImage”, which refers to the specific CTA that you are tracking. If you have similar CTA on different pages you could change the label to reflect the page of your CTA.
Once your links are setup and you can view the data in the Content -> Event Tracking section on GA. When you find CTA that are under producing, think about replacing them with something that might work better in that location. I often compare the number of clicks on my CTA's with the number of goals that were completed. If I find that I have a high number of clicks but lack the conversions, there may be a problem with the landing page. If I'm not getting the clicks on my CTA's then it may be a problem where my clients are not seeing my CTA's or they are not appealing, either way it helps me narrow down any issues I may have.
If you are having problems getting data to show up in your reports, please check the
Common Pitfalls section or leave a comment below for some additional help.
Other Uses for Event Tracking
I’ve also been using event tracking for monitoring clicks on my external links. It provides a great way to find out what links your clients are using. Event tracking can also be used monitor load times on videos, though I have yet to experiment with that feature. Another way to use event tracking would be what
Sam Niccolls post a few months back in step number 10 in
11 Conversion Rate Optimization Lessons Learned in 2009. In step 10, Sam talked about using Virtual Pageviews to track form abandonment. Unlike the old virtual page views method, using this method does not inflate page views and will not affect your overall data. In what way are you using event tracking that could help out everyone else in the community?
More nice stuff on Google Analytics! Guys, how about a post on /review of the alternatives. There's Clicky, Chartbeat, Woopra, Reinvigorate, Piwik, Ominture. It's not too easy to find hype-free info on some of these. It would be helpful if you talked about any of them too, and others! Food for thought.
I think they always review Google Analytics because it's free, easy-to-use and directly related to the most powerful search engine in the world.
I do agree with you that there isn't enough insight to the alternatives though!!
Having never swum much in GA other than the very basics, between this post and Jen's last post on GA, I feel like I've dived into Google Analytics deep end.
As the only analytics package I use, I could definitely use more GA posts. I just never make the time to learn more than I know (unlike my friend gfiorelli1 who actually allots specific learning times in his day!)
I want to remark that not all in the same day... or it would need to be of 36/48 hours each one!
I figured you found a way to squeeze in 32 hours into every 24. ;)
This is absolutely fantastic.
It's a perfect way to check whether it's the CTA that's not performing well or if it's the page that's not performing well...
There are times when I've said to myself "it seems like SeoMoz keeps re-hashing the same stuff, wonder if I should keep coming back". Then there actionable posts like this that make me say "and this is why I keep coming back".
Thanks for the tip, will definitely be using this.
I would like to add that...
Best practices are:
- Determine all events that may occur in your page
- Build a hierarchy of category/actions
- Use clean, constant naming
Did you know that you can use a maximum of 500 event per visit? It means that you shouldn't track event such as mouse movement using this method!If you're not sure, take a peek at Google Conversion University!
Ohh!!!
So THAT's what the event tracker was for!
Always wondered about it, but couldn't be bothered to figure it out. Thanks for the tip Chenry. I'll have a try with some of my websites!
Yup, another thing to add to my checklist!
What's the difference between event tracking and page tracking? Years ago I set up page tracking to do the same thing as your example - on a page with multiple CTA's, tag each CTA to see how it performs.
The syntax is -
javascript:pageTracker._trackPageview('/a/unique/path/for/tracking');
So I use:
javascript:pageTracker._trackPageview('/clicks/page/ctadescription');
I'm thinking that page tracking was all that was available at the time I implimented this however it sounds like event tracking is more appropriate now.
Edit to add - the JS is within an onclick obviously.
_trackEvent is still the preferred method over _trackPageview...
I think it's more subjective than that. Events can't be put into goal funnels. Pageviews can. Yes, it inflates pageviews, but it also increases your ability to measure outcomes.
Edit: for clarity.
I'm sorry, but I definitely don't agree.
Please note I've used the term "preferred", which is, in my opinion, everything but subjective - No offense. :)
There are many advantages in using a virtual event over a virtual page view...
One advantage is that "you won’t generate an extra (and useless) pageview each time an interaction occurs".Another advantage is that "you can easily organize your events into categories, actions, and provide labels and even values for each event you track".
These are GCU examples, but I've got many more if you want. I don't want to debate the fact you should or shouldn't use virtual pageview over virtual event, I'm just saying that Event Tracking is the preferred method. Oh, and I'm not the only one saying it... Google itself does too! :)
I definitely agree that events are preferred when you're just talking about tracking an event itself.
But events can't be entered into goal funnels. Pageviews can. So... if you absolutely need the action to be a part of the goal funnel, what other choice do you have but to use pageviews?
The Google Analytics community has been requesting that events can be added to goals for over a year now due to this minor annoyance.
I've read all the GCU articles and agree with all the points you make. :)
And, from this perspective, I must say that I totally agree with you!
This "minor annoyance" (I like your term) is one of the main reason I'm having a hard time with funnels when using technologies such as Adobe Flash, since I'm a big fan of events!
Google Analytics UTM's made this whole process a whole lot easier. The Urchin Tracking Module allows users to tag all sorts of parts of forms etc allowing users to use advanced segmentation, and see where abandonment rates/conversion rates are really happening. For people that haven't checked it out yet I highly recommend checking out Google's free Conversion University to learn all about Google Analytics as it's a fundamental of SEO (unless of course you're using another analytics program such as Omniture's)
Thank you! I really appreciated this post it helped a lot! I need to know whats working and what isn't thats how I make better sites. This is great!
Nice post and explained in 'real world' language - I appreciate your taking the time to explain what could be complex, in such a nice step-by-step way :-)Andy Kuiper - SEO Vancouver
Great post, thanks for sharing the knowledge! I've been using GA for years and it seems like I've never used more than 50% of its features.
Since we're at it, I noticed a change for the recommended GA code position on the page. Until now, we had to paste the code before the ending body tag. Now they say above the code in the account: "Copy the following code, then paste it onto every page you want to track immediately after the opening <body> tag." --- this is for the new version of tracking code. I didn't even know that I had to change the GA code from my websites.
Geez, these subtle changes are killing me.
You can even do this in a Flash app. You can have a whole Google Analytics profile based around a Flash widget, and track all the navigation within the widget as Google Analytics events.
Thanks chenry... nice to know that I'm not the only one doing his Google Analytics homework late at night.
Thanks especially for the snippets, as my worry is always to really know if the code I write down is totally correct... therefore I'm glad to have always a snippet to look at as a guide.
I didnt knew this was possible. Thank you
This is great chenry, great to see some focus on this. I'd also suggest looking at using custom variables in GA for this. If you have "slots" available they allow for more extended tracking of the visitor. They're great for conversion events that occur deep in a visit, or even on subsequent visits, and the tagging effort is about the same.
Hey,
Event-Tracking is an excellent method to monitor interaction with static content - but what about dynamic content?
I wonder how I can track the effectiveness of Homepage Tiles. We have 4 different Tiles on our /Home but the content and the links keep on changing continously.
However, I'd love to track the positions of the tiles through Event-Tracking. Do you think this is possible or does the Event-Tracking-Code has to be altered for this everytime a Tile changes contenwise?
Thank you,Max
How can we set the event tracking to automatically recognize what pages it is on so that we dont have to install a different code for every page just to track click on a link (that exits on every page of the site)
Hello
I have placed event tracking in my websites to track banner clicks. Now I want to track the trasanction ID's as
well for those banners (People click those banners and place an order).
Im still new at all this, but should you use GA with wordpress sites? Any real benefit there since it isn't a normal website?
A wordpress site is a normal website, it's just dynamic. There is definitely benefit to using it on ANY website that you do. Just stick the tracking code in the footer.php file of your theme, located here:
yourdomain.com/wp-content/themes/[theme-name]/footer.php
:-)
Shoot me a private message or respond to this if you need some more help. I've got a lot of experience working with Wordpress sites.
Actually the new GA code should stay in the head section, based on their new documentation for this code (they say it tracks better since it catches the visit even for people that left the page before it completed loading).
Sorry, hadn't read the new updated tracking documentation yet. Haven't needed to add it to a site!!
Another very interesting Analytics package to use when looking at CTAs is Crazy Egg. The heatmaps and confetti views are especially relevant to the example you've used, chenry, since these allow you to see exactly where people have clicked. So, you can see whether they took "Sign Up For PRO Today" as just a headline or as a click-able call to action, whether the image to the left was clicked on etc. Something non-GA to throw into the mix.
I definitely think Google should put events into the goals setup - that would make them unbelievably useful, and resolve thiswhole _trackEvent or _trackPageview debate.
Hi! Thank you very much for this great useful information!!
I´ve been fighting with this thing for white a long time now. I want to track how many people click on my ad banner, but I don´t manage to do it. This is how my ad banner code looks like:
<center><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="quality" value="high" /><param name="movie" value="https://www.zaichina.net/wp-content/uploads/InstitutoIberochinoBanner250.swf"/><embed pluginspage="https://www.macromedia.com/go/getflashplayer" quality="high" src="https://www.zaichina.net/wp-content/uploads/InstitutoIberochinoBanner250.swf" type="application/x-shockwave-flash"></embed></object><center>Where and how should I include the track code? Thank you very much for your help.
I'm running into an odd problem using onclick trackEvents. When I added that additional tracking to our site on a few pages the code seems to be sending events as the Events Overview page in Analytics is now saying that "1511 of your visits sent events" when previously it said "0"
However, right below that line, where it shows the "Total events", "Unique events", etc. detail, everything there is still "0". Also, the Event Category, Action, and Label info below that section has no detail either.
Do you have any idea why only partial detail would be showing? The code seems fairly straightforward: onclick="_gaq.push(['_trackEvent', 'Download', 'Pricing PDF', this.href]);"
Note, I tried it also without the this.href code but that doesn't seem to change anything. I get there may be a delay in the reporting but it's been a full day and it seems to be recording part of the data.
Thoughts?
Wow, cheers dude, very clear, very concise. Worked for me.
Clean and to the point. Been IQ certified, and just now getting into event tracking.
Thanks for sharing this! Maybe a future article about how to read the gathered data in GA, related to this post?!
I found a number of tutorials on implementing Google Event Tracking (including this one), but for an absolute web newbie like myself, I found that for each one I read I ended up having to read three others.I tried distilling down the basics for getting it to work for a button in case anyone is interested: https://www.re-d.ca/2012/04/18/google-analytics-event-tracking/I hope this helps!
I just noticed that implementing event tracking will skew your Bounce rate statistics for that page.
Hey guys,
I have bunch of banners on my home page and would like to track the clicks for each banner. I have copied the following tracking code on my home page but still don't get the reports in GA! Appreciate your inputs.
<a href=”https://www.ocsurplus.com/servlet/StoreFront” onClick=”_gaq.push ([‘_trackEvent’,’homepagebanners’,’click2’,’homepage-2’]);”>Click on homepage-2</a>
I noticed SEOMoz uses
onclick="javascript:_gaq.push(['_trackPageview', 'vpv/goal/engaged-visit/twitter']);"Is that a alternate method?I notice thety also have GA tracking script in the <head>, why? Curious
It is normal to put the GA script in the <head> section ... GA recommends this! The other part of code "onclick" is there to track clicks and site navigation
awesome post on event tracking! (love Google Analytics / just wish they would include tabs for webmaster tools and adsense on the same page) Anyone have links or referemces/suggestions to any additional code examples?
Excellent post. I wondered how to set up an event tracker. We have ever so slight variations of the same keyphrase we will use this one.
Hah! A comment or two ago I was wondering where you were Casey, and voila, you show up in a blog post!
Good to hear from you and even better to learn from you. I appreciate the more in depth GA tips and I am making it a goal of mine to make myself get past the GA basics.
Note to self - I will finish reading both of Avinash's books that are sitting on my bookshelf collecting dust.
PS - Sorry for you that Jen isn't going to be emailing GA info until June posts.
We have used the GA Event Tracking to create a very simple banner tracking system for one of our clients a few years ago.
The ad agency had included some web banners to sponsors for an event. The static event website they created did not have any sort of ad manager.
Rather than attempt to install something for this small website, we just setup Event Tracking into their exisiting GA account and we were able to tell the sponsors how many clicks they received on each ad.
Very simple and very useful.
I like the ideas above. Great for testing. I would be curious to know how many times the annoying videos are closed before they are completed. :)
Thanks for the great example and showing exactly how easy it is to set up.
@sjixxxy one of our clients in the past used one of those annoying video overlays and I also would find it interesting to see if most people just click out of those things.
A while back someone in our marketing department became infatuated with the video overlays of people greeting the user and telling them what CTA they should click. We set up event tracking to measure the percent of play time, and if the user manually made the pop-up person go away. We wanted to see if they were worth the time, or were just annoying users.
Never got to collect actual data on them though as the project never made it live.
Now that would be interesting to see. I personal don't like those overlays and always turn them off. I would bet that most people are quick to turn them off also.
Are you aware or have you noticed any crawling problem due to the addition of the event tracker in the link?
Since it's implemented with the onclick attribute crawlers should ignore it. I have not had any problems with it so far.
Cheers for the post, I have traditionally found the goals on GA to be somewhat lacking in effectiveness.
Thanks for including the link to common pitfalls!
I'm not renowned for my development abilities..... but even I have manged to get an experimental landing page going with 2 separate CTA's on it.
I await the results with baited breath.......
That surprises me. I have been a big fan of Funnel Visualisation within the Goals section of GA for awhile and it has helped improve Conversion Rates across multiple projects.
Great post.
Can you do another one like this on campaigns, like how you get your utm= code in your rss feed?
Thanks!
You mention using event tracking for external link tracking. I've been setting one of my sites up the opposite the opposite - internal tracking. I've been attaching events to various parts of my site that are meant to drive visitors deeper into it. I'm segmenting it out by the different areas the clicks come from. Featured posts, content links, related posts, etc.
It's useful to see which areas are in need of work, or aren't being used enough that I would be better off using their on screen real estate for more productive purposes.
Thanks for the great info!
Do you know if this will work for tracking clicks on an e-mail address that uses the "mailto:" command?
If so, what might that code look like? I am trying to figure out how to track e-mail clicks using GA, but I am not too advanced with javascript. Any help is appreciated.
Thanks in advance!
Melanie :)
I started using Event Tracking several months ago. Its always refreshing to read how others are using it for their websites.
Useful tip will be good for conversion optimization
Man you are a life saver. I was just trying to setup event tracking on one of our websites to track call to action buttons, file download options, print etc. Very nicely put.
Best
Neil
Im pretty new to google analytics but it gives everything plus the kitchen sink with tracking my blog.
Great post as I dont know alot about the program and I am learning everyday
Glyn
Love the advanced Google Analytics information. Google Analytics is such a powerful tool for online measurement that allows businesses to measure things that were previously unknowns. I hope you can keep writing posts about how to become more proficient at GA because it will make me indespensible to my company.
Nice post. We're using Event Tracking to monitor Coupon Prints for a client. I love the way you can quickly access your Event data and how well labeled it is in GA.
Thanks!