We love digital

Call 0845 485 1219

We love digital - Call and say hello - Mon - Fri, 9am - 5pm

The Complete Google Analytics Event Tracking Guide Plus 10 Amazing Examples

Anna Lewis

by Anna Lewis on 25th January 2013

ga event tracking guideOver my time working with Google Analytics accounts I have come across many reasons to use Event Tracking, so much so that I now wonder why there are still websites out there that do not utilise this fantastic resource. Here, I’m going to explain what it is, the benefits, the code and examples, covering my favourite things to use Event Tracking for.

With just a small amount of extra code, you can start collecting data on a whole host of additional activities that happen on your website which cannot be tracked with the standard Google Analytics code. From clicks on buttons or links, to how much of a form was filled in and even organic keyword rank data!

The data is also completely custom to you – you get to choose 4 pieces of information to pass into Google Analytics, specific to each activity.

Event Tracking works through passing the following information to Google Analytics:

Category, Action, Label and Value

There is one other field that can be used in the code, non-interaction, but this does not pass any additional data, so we’ll come back to it later. Also, you don’t need to include a tag saying which page the Event happened on, as this is captured through the standard trackPageview functionality.

top events report

The data comes under the Content Report, then Events. Have a look at how the information is accessed before deciding on how to label the activities on your website. You will want to consider grouping similar activities in to the same action, which can then be broken down by category and label, rather than having too many differing actions. Similarly with categories, try to find ways to define these tin order to enable you to group them and analyse similar ones together, whilst maintaining the ability to break them down through labels and actions.

I’ll cover some examples of how to name your activities in each of the examples below so that you start to get a feel for what you can do.

Basic Code

Broken down to the basics, the code is structured like so:

_trackEvent(category, action, opt_label, opt_value, opt_noninteraction)

Replace each aspect with the data that you want reported. Although you only need to include category and action, the others are optional.

As an example, to track PDF downloads of a Whitepaper called SEO is Great, I have chosen to use:

  • A category for all my Whitepaper activity
  • An action of ‘download’ for all downloads across the site
  • A label to distinguish which resource sees the activity
  • A value of 5 (based on the perceived value or arbitrary scale, whatever works for your business)
  • A non-interaction setting of true (meaning I do not want activity here to impact by bounce rate)

Which in its most basic format would be:

_trackEvent(‘whitepaper’, ‘download’, ‘SEO is great’, 5, true)

The important thing to remember, is that if you want the Event to fire data when someone clicks something, you will need to put the code inside an onClick function, like so:

onClick=”_gaq.push(['_trackEvent', 'whitepaper', 'download', 'SEO is great', 5, true]);”

In this example, we’re tracking clicks of a PDF, so the full code of the link would be:

<a href=”/downloads/whitepapers/seo-is-great.pdf” onClick=”_gaq.push(['_trackEvent', 'whitepaper', 'download', 'SEO is great', 5, true]);” target=”_blank”>SEO Is Great Whitepaper</a>

You can see how the extra line of code just sits inside the code for the link and after you’ve done it once you can use the same example but just replace the bits that need to change. Copy and paste is your best friend when you’re not a coder!

Additionally, because it is JavaScript, you can insert the data dynamically, instead of using static information. For example:

<a href=”/downloads/whitepapers/seo-is-great.pdf” onClick=”_gaq.push(['_trackEvent', 'whitepaper', 'download', pdfName, pdfValue, true]);” target=”_blank”>SEO Is Great Whitepaper</a>

In this example you would have to define the pdfName and pdfValue variables elsewhere in the code, so that the JavaScript knows which bit of information to pull in.

Events and Bounce Rate

When using Event Tracking on a website, you will need to be aware that Events will impact the bounce rate of the page because by default, Events count as an interaction (not a bounce) in the same way as visiting another page.

If you do not want Events to impact your bounce rate in this way, you will need to use the non-interaction part of the code to specify that it should not be counted as an interaction and thus, should be ignored for the bounce rate calculation. To do this, set the opt_noninteraction field to true as I did in the above example.

Value of Events

As with goals and ecommerce data, having a value in your reports can give you so much more insight into performance and success, so I would highly recommend setting values wherever possible. In Event Tracking code, the value is an integer that can be used for whatever metric you want, as long as it’s a positive number.

You can either set the value based on what the Event is worth to the business, i.e. clicks of this link mean someone has purchased something worth £12, so the value should be set as 12.

If you don’t know what value something has or if it’s for things of varying total value, you can try and work it out based on the average final revenue and then times this by the conversion rate (the likelihood you will get revenue from the Event) to work out how much each Event could be contributing.

Alternatively, if you have no real way of working out actual revenue, you can set the values as arbitrary numbers on a scale of importance. This will help you compare a visits/pages/traffic sources that have measured 100 low importance interactions compared to visits/pages/traffic sources that have measured just a couple of very high importance Events.

Using either method here will then give you a much better idea of how things are performing, especially when you’re tracking more than one type of Event.

Alternatively, you may choose to use the value field for another metric such as time (for tracking videos watched or time on site) or as search engines ranking position. If you use these then you may want to make sure that everyone reporting from your Google Analytics account is aware that these values are not money!

value - time on site

Reporting on Events

Before I dive into all the examples, let’s take a quick look at how the data is reported and what you can get from it.

finding event reportsHere are the core metrics:

  • Total Events: How many Events were recorded
  • Unique Events: How many unique actions happened (de-duped version of total Events)
  • Event Value: The total value recorded (only you know whether it’s £, $, time or another metric!)
  • Avg. Value: The average value across all Events
  • Visits with Event: How many visits contained an Event
  • Events / Visit: The average number of Events recorded per Visit

These are then broken down by Category, Action, Label (or a combination of these) and the data can also be reviewed by the pages on which Events happened.

Once you have chosen dimension to break the data down by (i.e. a category that you want to analyse), the data will be shown in more depth for this and a breadcrumb appears at the top allowing you to change this or go back to All.

I would also recommend tracking your most important Events as goals so that you can see data relating to these in the standard reports against other data and use the metrics to help you work out the value and ROI of your website.

Examples you say?

So now you’ve got the basics, let’s crack on with some examples of when and how you can use Event Tracking to take your web analytics to the next level! The methods I’m going to cover are:

Basic tracking of clicks/interaction:

  1. External links
  2. Internal banners
  3. Sign-ups, log-ins and form submissions
  4. Downloads

Middle difficulty:

  1. Gadgets
  2. Videos
  3. Social sharing button interaction

Advanced but awesome:

  1. Rank tracking (easy implementation and awesome data!)
  2. Form completion progress/ drop out
  3. Scroll reach

Tracking Clicks and Interaction

This is the most common use for Event Tracking – how many times people click on a certain thing. The only limit here is your imagination! If you’re not sure where to start, take a screen shot of a couple of pages of your website and circle all the things that users can click, then think about what value and use each of these actions is to you. From this you can decide what to track and what naming structure you might need to use to organise the data.

External Links

Tracking clicks on links to other websites can enable you to measure the following:

  • Clicks on adverts
  • Click through to sister sites or sub domains
  • Clicks to social profiles
  • Clicks to the resources you have provided
  • Clicks to your YouTube Channel or other sites you’re promoting
  • Clicks on AdSense and affiliate links
  • Clicks on Live Chat buttons (usually an external service)

Each of these has its own benefits and some will have more significant monetary value than others, but each will be valuable data because if no one clicks the links, why should you fill your website with them? This data can help you decide which ones are of most use to your users, as well as which ones are valuable to your business.

The code for these links might looks like this:

<a href=”https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide” onClick=”_gaq.push(['_trackEvent', 'resource', 'outbound link', 'https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide', 1, true]);” target=”_blank”>Google’s Guide to Event Tracking</a>

I’ve named this as a resource clicked from an outbound link with a value of 1 and I have told it to not use clicks on this to impact the bounce rate of the page.

Internal Banner Tracking

Have you got a rotating banner on your site? Or somewhere to place a banner but you want to know which one performs best?

Adding Event Tracking code to your internal banners and carousels (rotating banners) can help you identify the best banners to use on your website – which type of content users are most interested in and which banners work best at attracting clicks. You can also tie back the data to see the goal values from users who clicked each banner to work out if any outperform others in bringing value to your business.

Not only can you track the banners themselves, but you can track the navigation buttons that people use to flick between rotating banners or forward and backwards arrows if you have them.

The code for these links might looks like this:

<a href=”#banner1″ onClick=”_gaq.push(['_trackEvent', 'banner', 'internal link', 'banner 1']);”>1</a>

So here I am labelling the action as a click on an internal link, with the category banner. I’ve used the label field to specify which banner it is (yours should have a more informative name than 1!). I’ve decided to remove the value and non-interaction fields, as I don’t see a value being attributed to this click and it counts as interaction to further content on my website. Therefore, I’m happy for this click to stop the views being counted as a bounce.

Signups, Log-ins and Form Submissions

sign up boxHave you got any forms on the site where users can throw in some details and click go? Whether it’s signing up, signing in or signing their life away, you can track it! All you need to do is put the code on the submit button and you will be able to track how many times this is clicked.

<input type=”submit” onClick=”_gaq.push(['_trackEvent', 'form, 'submit', 'email subscription', 10]);” value=”Subscribe to our email” />

You should be starting to see the pattern now, this example uses the category form, so that we can track other interactions from forms within the same place. The action is ‘submit’, with the label specifying which form it was, the value being 10, which is left to count towards the bounce rate.

Downloads

Throughout your site you might have files that people can open or download, but you can’t tag these pages with Google Analytics. The closest you can get is to tag clicks to open/download the files.

As above, a way to track downloads as Events is:

<a href=”/downloads/whitepapers/seo-is-great.pdf” onClick=”_gaq.push(['_trackEvent', 'whitepaper', 'download', 'SEO is great', 5, true]);” target=”_blank”>SEO Is Great Whitepaper</a>

Whether you’re promoting Whitepapers, flyers, fact sheets, spreadsheets or other items, you can set up Event Tracking to measure when they are clicked, as well as how many unique clicks they see and what value this provides to you. 

Middle Difficulty

These examples might need slightly more code knowledge or research to get right, but don’t let this put you off!

Gadgets

If you have interactive gadgets or widgets of any kind on your site, such as ratings, feedback pop ups, liked-that-try-this pop ups, calendar buttons or polls, you can add Event Tracking to get an idea of how much these are used and which ones work best.

I’ve put this under the middle difficulty section as some of these will require some extra code to get working, but a simple implementation might be:

<a href=”#” id=”submit_feedback” onClick=”_gaq.push(['_trackEvent', 'feedback', 'submit', 'Did you find this useful?',, true]);” target=”_blank”>Submit</a>

Here I have used the category ‘feedback’, so that any forms that also use the ‘submit’ action can be analysed individually by category, as well as all submission data being shown within the same data set. This allows for in-depth analysis of visits with anything submitted.

Videos

So you have videos on your site and stats on these through the video hosting platform – but how do you tie the success of these in with other data you have about activity on your site? By tagging the Play, Pause and Stop buttons with Event Tracking of course!

You can even set up Event Tracking to record how many seconds of the video was watched before the user stopped it.

Due to the way that videos are built into websites, you may find that you need to modify the code to work properly, but the final outcome you’d be looking to see will be something like:

onClick=”_gaq.push(['_trackEvent', 'videos', 'play', 'video marketing is awesome',]);”

Or for video duration:

_gaq.push(['_trackEvent', 'videos', 'video duration', 'video marketing is awesome', videoDuration]);

Rather than provide an additional 2,000 words on how to set everything up, here are some resources to get you started, depending on how you’re using videos:

Here’s a JavaScript library that in a few short steps can get your video activity tracking as Events (although with the naming convention that they have set, rather than one you choose yourself).

Here’s how to put Event Tracking code in Flash videos (and using FlowPlayer to make videos easier to handle on your site) by Luna Metrics.

Wistia users can follow this guide for embedding Event Tracking in their videos.

Social Sharing Button Interaction

Depending on how you have added social sharing buttons on your website will depend on how you can track the activity. You will also need to decide if you want to use Event Tracking for social media or whether the Social reports would be better for you. The Social report can give you more detailed and integrated data, see this guide for implementation and this blog post for using the Social reports in Google Analytics.

I do think that social tracking is best done within the Social reports, but if you still want to see this interaction as Events, here’s how:

If you’ve coded your social buttons yourself, you can manually add Event Tracking code around these, like so:

To add Event Tracking code to Twitter buttons:

<a href=”https://twitter.com/koozai_anna” onClick=”_gaq.push(['_trackEvent', 'social media', 'twitter', 'Koozai_Anna']);” target=”_blank”>Koozai_Anna on Twitter</a>

To add Event Tracking code to Facebook buttons:

<a href=”https://en-gb.facebook.com/koozai” onClick=”_gaq.push(['_trackEvent', 'social media', 'facebook', 'Koozai on Facebook']);” target=”_blank”>Koozai on Facebook</a>

As you can see, you don’t get a huge amount of information and you will require extra code to make this dynamic to save yourself having to hand code every link, but this method can work for basic set ups.

Alternatively, if you are using Twitter Web Intents, a Twitter service that can make it easy for people to follow and share your content without leaving your website, there is a full implementation guide to get this activity tracked as Events with lots of juicy information.

With Facebook, if you have used their code for Social Plugins you can work your Event Tracking in to this code using this guide.

Google+ interactivity automatically feeds data into your Social report in Google Analytics, however, if you want to put the data in to your Events report you will need to add some code. Again, Yoast has put together a tidy little guide here.

Advanced but Awesome

This section may need additional code, but it will be worth it!

Rank Tracking (easy implementation and amazing reports)

You may have heard of using a filter in Google Analytics to show organic keyword positions in the keyword report, but this method, as outlined recently by Justin Cutroni, allows for so much more than that!

For the full implementation and information about this please read the original post.

It involves adding one small section of code to your website which then enables you to pass Event Tracking data in to Google Analytics in the following way:

  • Category: RankTracker (so all the data is grouped nice and easily)
  • Action: the keyword the visitor used
  • Label: the landing page (which in other Event Tracking is gathered through the Event page report but is very useful to grab as its own metric here)
  • Value: the rank that your website was when it was clicked
  • Non-interaction: True so that your bounce rate is not affected

Some of the uses for this are:

  • Finding the average rank of keywords – through the average value report
  • To group keywords and review performance based on the type of keyword (i.e. brand, product)
  • To track rankings of keywords over time on a graph
  • To see which pages perform well for which keywords

So what are you waiting for?! Get over to cutroni.com and implement this today!

Form Completion Progress and Submissions (code required)

Ever wondered how many times your forms are left incomplete? Which fields cause people to run away in fear or give up? Ever tried to guess how to improve your forms without using actual data?

Well now you can start to make informed decisions and get a detailed analysis for forms with the use of Event Tracking!

Rather than me writing the code for you, the lovely guys at Luna Metrics have recently provided a version that you can use.

There are two chunks of code involved – one to fire an Event every time a cursor leaves a form field and the second to set jQuery up. You only have to customise a few areas of the example to make it work for your form.

If you have budget available, then I would recommend using a different tool, such as ClickTale, to give you this data in a much more presentable and usable format. However, for those websites that don’t have scope for extra analytics budget, the above method is your next best alternative.

Scroll Reach (advanced implementation)

Again, you could use a dedicated tool such as ClickTale to analyse how far users scroll down your website pages, but if you want the data all in one place, you can utilise Event Tracking to measure this for you!

Now for this, I also can’t take any credit for putting the code together, the best write up on how to do this is found on Justin Cutroni’s blog and was put together by some of the best minds in web analytics!

You can find the full instructions here.

Conclusion

I think that’s enough for now! I hope that these ideas, examples of the code and resources will help you improve and get a lot from your own Event Tracking strategy. The data can be full of insights you never thought you could see! Remember though – why add the tracking code if no one’s going to use the data? Put a plan together for what metrics are going to be most useful to you and who/how they should be reported on before you decide on the implementation. This can also help you work out how best to name your Events to allow for the best analysis.

And after all that, if you need help improving the tracking on your website, we can help! Just give us a call to talk about our analytics services.

UPDATE: Unnecessary ‘ signs removed from value fields

Anna Lewis

Anna Lewis

Our resident analytics specialist is Anna Lewis. Anna is unbelievably attuned to anything analytical and can fill you in on all the latest news, tips and advice to get ahead in this evolving market.

down arrow

Your Free Whitepaper

The Practical Guide To Google Analytics For Businesses (2nd Edition)

The Practical Guide To Google Analytics For Businesses (2nd Edition)

Download this whitepaper now and get a new one every month!

Download »

98 Comments

  • Pritesh Patel 25th January 2013

    Great post Anna.

    Will get my thinking cap on for some more things which could be tracked using event tracking.

    In the mean time, I came across this very VERY interesting article about ‘event tracking naming strategy’ which is well worth a read before setting up any event tracking: http://www.seerinteractive.com/blog/event-tracking-naming-strategy

    Reply to this comment

    • Anna Lewis

      Anna Lewis 25th January 2013

      Thanks Pritesh, that’s a great resource for planning a naming convention! Definitely recommended reading for anyone wanting to use event tracking for more than one type of thing.

      Reply to this comment

    • Chris Le 25th January 2013

      Thanks for the mention Pritesh!

      Reply to this comment

  • Mit 25th January 2013

    The GA Config tool from Raven is briliant for event tracking, makes for quick and easy implementation

    http://gaconfig.com/

    Reply to this comment

    • Anna Lewis

      Anna Lewis 25th January 2013

      Hi Mit, thanks for the comment – you’re right the Raven Tools GA Config is a useful tool both for normal code and event tracking, I’m just so used to tweaking the code myself now but for anyone who doesn’t like to mess with code then this makes it easy and failsafe!

      Reply to this comment

  • Robert Kingston 25th January 2013

    Nice post, Anna. Love the examples.

    Another cool little advanced implementation is copy/paste tracking (I intend to post instructions to this on my site in the next week). Will keep you posted!

    Reply to this comment

  • Paul Rogers 25th January 2013

    Hi Anna,

    Great post, events are really important for tracking engagement and so many people don’t use it in the right way.

    Something I’ve found really useful since it was introduced is event goals in GA, mainly for tracking conversion rates of people watching videos, using content in JS pop-outs, clicks on different affiliate links etc.

    Reply to this comment

    • Anna Lewis

      Anna Lewis 25th January 2013

      Thanks Paul, yes the ability to set Goals for events matching a certain set of details makes them so much more useful! It’s great that you can pick and choose whether to have an event for exactly matching or containing a string of text in any of the fields (category, action, label or value), it’s so flexible that it suits almost every business need!

      Reply to this comment

      • Melani Zannaki 7th February 2013

        To set a Goal for an event, it is essential to have set the event first ?
        For example, a client of mine has a hotel website with a link where users can download a PDF. To track the clicks on the link, I have to add the additional code and then set a goal for the event?
        And because I am new to this, could you please give me an example ?

        Thank you in advance!

  • Graeme Benge

    Graeme Benge 25th January 2013

    Another totally average post Anna….;-)

    Could you expand a bit on the merits or when best to have event tracking impact bounce rate or when it’s best not to impact bounce rate?

    Reply to this comment

    • Anna Lewis

      Anna Lewis 25th January 2013

      Thanks Graeme, good question.

      Every case will be different, but the way to work it out is to think about your situation and understand what the bounce rate is currently showing you and what it would be showing if you were to add the code for each situation, here’s some examples.

      Preventing an event from counting towards the bounce rate might be useful for:
      - Events that fire automatically (you don’t want every visit to count as a bounce! Use True to get a real measure)
      - Events that are measuring something that’s not specifically an interaction (i.e. page load time, video duration)
      - An activity that is meant to happen (maybe a log in box event tracking code could be blocked from counting so that the bounce rate can be used to tell you what % don’t make it through to the next page – would work best when the page has little other content than the log in box)

      Allowing the event to impact the bounce rate could suit:
      - Tracking PDFs as these count as viewing another page but can’t be tracked as a page in their own right
      - Tracking polls and forms as these are actual interaction.

      I hope that clears things up a bit!

      Reply to this comment

  • Jim Banks 25th January 2013

    If you are using the plain old ga.js version of Google Analytics and running WordPress then Yoast has a plugin which does a lot of the recalibration of event tags for you.

    You can also get hold of GAS (Google Analytics on Steroids) which can be either a standalone, or a WordPress plugin, it means you don’t need to mess around with code (if you don’t want to).

    I’m doing more work with the analytics.js , dc.js and also messing around with Google Tag Manager, so the plugins tend not to work so well.

    Good post Anna.

    Reply to this comment

  • Ravi Sodha 25th January 2013

    As always, great post!

    As an example, I have implemented menu event tracking. The menu consists of drop downs so we measure:

    1. Hovers over the drop down menu items
    2. Clicks on the menu items
    3. Clicks on the links within the drop downs

    Its really useful to compare interaction before and after making changes to the menu.

    On another note, we use event tracking to measure pdf downloads. We found it best to add a small delay (300 ms) to ensure the event tracking code fires before the PDF loads. Users don’t notice the delay but if you don’t add it, the code doesn’t always fire!

    I am planning to measure comments on my blog using events (as I will treat it as a goal).

    Reply to this comment

  • Ian Creek 25th January 2013

    Hi Anna – great post as always.

    One other use for event tracking that’s good for publishers or sites that have a lot of guest blogging, is to track impressions of Avatars. E.g. every time a bloggers image is shown alongside the content you trigger an event. You can then easily see how many impressions each blogger gets all in one place. I’m sure you could come up with some great reports off the back of that.

    Reply to this comment

  • Rob Kingston 28th January 2013

    Hi guys,

    Another interesting use for events in GA is tracking what your visitors copy from your site. I’ve popped together a small bit of code that allows you to track:

    - Text your visitors copy
    - The page they copied it from
    - The length of the copied text in characters

    It can be particularly useful if you have a content site (e.g. blog) and you want to track a different form of engagement. If you’re interested in how to install it and how it looks in Google Analytics check out my post here:

    http://www.optimisationbeacon.com/analytics/use-google-analytics-to-track-what-content-your-visitors-copy/

    Reply to this comment

  • Gerry White 29th January 2013

    So – quick question – why for a number of those events wouldn’t you use pages instead of events – I typically use for form submissions and downloads page tracking – if anyone was to ask me why – habit, pathing, goals and segmentation – is there a reason to use events?

    I use events for video related bits and I have tried to use it for elements such as social shares, the scrolling you mentioned, certain on page events such as carousel and panel expansion etc…

    Cheers Gerry

    p.s. custom vars article next ?

    Reply to this comment

    • Anna Lewis

      Anna Lewis 29th January 2013

      Hi Gerry, thanks for your comment, you raise a good point. I have used both methods in the past (and outlined them in my previous article about how to track clicks on a link: http://www.koozai.com/blog/analytics/how-to-track-clicks-on-a-link-in-google-analytics-7721/)

      My rationale for choosing which method to use comes down to whether or not I want the data in the content report (as virtual pageviews will ‘artificially’ inflate pageviews) and whether I want more data than just a pageview.

      For PDF downloads, form submission buttons etc, you’d be perfectly justified to use virtual pageviews instead, as theoretically you would be tracking it as a URL if it was able to have it’s own page.

      I’ve moved to using Event Tracking for things like this as it gives you better ways to break the data down. If I have two+ forms on the site I can create a goal for all forms in one more easily and also analyse the data quickly just by clicking the form Event category.

      Obviously scroll reach, page load time, video interactions are Event specific.

      So in some cases you can pick either method depending on where you want to see the data. The data has to make sense to you and suit your reports so you will need to choose what’s right for you in each situation.

      Hope that helps!

      Reply to this comment

      • Gerry White 29th January 2013

        Thanks! – that makes sense … GA has massively evolved and I haven’t used it daily (for 7 months now) and it helps when people talk through why one rathe than another!

  • Lenin Rodriguez 30th January 2013

    When using event tracking on a submit button is it possible to add the name of the page where it was click as the widget might be in different locations?
    Currently I’m just using the basic code but I would like to get the page where it was click for tracking. Any suggestions?

    onClick=”_gaq.push(['_trackEvent', 'Quote', 'Instant', 'Submit',, false]);”

    Reply to this comment

    • Anna Lewis

      Anna Lewis 31st January 2013

      Hi Lenin – luckily for you the Events report in Google Analytics reports on this automatically. It’s found under Content > Events > Pages

      You could also add Page as a secondary dimension when reviewing this Event’s data in the Top Events reports.

      Hope that helps!
      Anna.

      Reply to this comment

  • Lenin Rodriguez 31st January 2013

    Thank you Anna,
    It seems that I was over thinking and didn’t noticed until later on and yes you are right, I can get the page name from that report.

    This is the first time I found your blog and it has tons of good articles, great job.
    Thanks again.

    Reply to this comment

  • Altoranking 1st February 2013

    Thanks Anna!! That was a great eye opener within Google Analytics.

    Reply to this comment

  • Anna Lewis

    Anna Lewis 8th February 2013

    Hi Melani, yes you would need to put the event tracking code on the PDF link, then set up a goal for the Event. You can either set a value within the Event Tracking code or you can set a value for the goal that you set up (or both if you want!). Hope that helps!

    Reply to this comment

  • Melani Zannaki 11th February 2013

    That makes sense! Thank you for your help and this informative article :)

    Reply to this comment

  • Nils 13th February 2013

    Thanks so much for the article! It was well written, well laid out and super informative. You convinced me to take the time to set up rank tracking, video interaction and form completion. Sweet!

    Reply to this comment

  • Tom Bowen 21st February 2013

    Hi Anna,

    Really good article–spells things out as clear as I’ve ever seen and great examples.

    Is there a decent resource for trouble-shooting that you recommend? I implemented a simple external link click event, and have clicked the link myself but I still show zero events. I get no JavaScript errors when I run the Error Console in Firefox. I have no filters set up that would filter out my visit. I can see my visit in the real-time report. But no matter what, I still see zero events, so I’ve clearly implemented wrong, but don’t know what my problem is. How do you recommend one would troubleshoot this?

    Reply to this comment

    • Tom Bowen 25th April 2013

      A good debugging tool I found was the Google Analytics Tracking Debugger for Chrome (https://chrome.google.com/webstore/detail/google-analytics-debugger/). Using that within Chrome and opening the JavaScript console showed me an error that I was not able to see without it.

      That error was that my Value parameter was enclosed in quotes. I took those quotes out from around the numeric value, and I got no errors. I did see my event in the Real-Time monitor on GA.

      Reply to this comment

      • John Potter 2nd May 2013

        I’m having exactly the same problem that Tom describes.

        I see my visit in the real-time report, but the event is not recorded.

        I’m using Yoast’s Google Analytics for WordPress plugin.

        I’ve tried using the debugger, but it shows no errors, even with the Value parameter enclosed in quotes as demonstrated in Anna’s example.

        Removing the quotes does not generate an error or record events.

  • Jen 19th March 2013

    Liked the post thanks. Would anyone know why it is that when I edit and add the code to my page to track my pdf download I end up getting all of the raw code showing up rather than my “download here” link ?

    Sorry for the Nube question

    Reply to this comment

    • Gerry White 19th March 2013

      whilst it sounds like a nube question – it is amazingly common – are you using a CMS? you generally have to add it to the code itself, and many CMS systems deliberately won’t let you… If it is WordPress we can hack it in.

      Reply to this comment

    • Jen 19th March 2013

      Thanks for that, yes I am using WordPress would you happen to have made a tutorial for hacking the code into WordPress?

      Reply to this comment

  • Gerry White 20th March 2013

    Sorry nope – what is it your trying to do? – loads of plugins available – I love the Yoast one http://yoast.com/wordpress/google-analytics/

    Otherwise you can just switch to HTML view and it shoudl work …

    Reply to this comment

  • Katherine Rincon 20th March 2013

    Hi Anna! Great post. We’re studying it section by section. Is there any way to use Event Tracking to track a pdf that is only accessed from an external banner ad? We do not have any clickthrough data on the banner ad, and were hoping to see how many hits on the pdf. We tried setting up a redirect where the referring page had the GA tracking code, but that didn’t work. Thanks so much for your help!

    Reply to this comment

    • Anna Lewis

      Anna Lewis 21st March 2013

      Hi Katherine, if the link to the PDF is not on your site it won’t be able to trigger an Event as your Google Analytics code won’t be on the page with the Event tracking on it. I’d have thought a redirect could work but only if there was a time delay to allow for the Google Analytics code to load before the redirect happened. For advanced PDF tracking I recommend having a look at this article: http://www.jonoalderson.com/conjecture/advanced-pdf-tracking/ It might be that server side tracking would work for you. Hope that helps!

      Reply to this comment

  • Luke 27th March 2013

    Thanks for the brilliant article Anna.

    I have a website with an online form sitewide. Is it possible to implement the event tracking code which automatically generates the URL per event tracking in Google Analytics?

    In other words I would like to avoid implementing an unique event tracking code per page as my site has hundreds of pages.

    Many thanks!

    Reply to this comment

  • Mike 1st April 2013

    Thanks for posting this article, Anna! I make use of Events quite extensively every day. What I’m struggling with currently is trying to tie those events to more granular Ecommerce metrics. Currently you can only combine transactions with Events. I’m wondering if anyone has come across a method to also combine Events with Ecommerce Product values (SKU, Category, etc.).

    Best of luck data mining, folks!

    Reply to this comment

  • digdeep 3rd April 2013

    Nice post on the implementation side. I am wondering how you get any use out of the reports?

    I am struggling with the concept of getting multiple events as a per column item in a report that for example shows visitor ID as a line item, then pulls in each event by that user as a column.

    At best, I can create a segment which grabs only the subset of users that have that event rather than the full visitor data.

    Unless i am missing something here, the reports are next to useless in GA. to put in context, aggregate values in the UI reports are pointless when you are looking at a website with a decent amount of traffic.

    Would love your thoughts around this :)

    thanks and very nice post.

    Reply to this comment

    • Anna Lewis

      Anna Lewis 13th May 2013

      I generally break the reports down by categories and actions or through using segments to see activity about users who triggered certain events. If you need anything more than that then using an API export might be the best option.

      Reply to this comment

  • Ty Whalin 14th April 2013

    Awesome write up. Just implemented some event tracking last week. Spent several hours on Google Help for Analytic Event tracking. Now I come across your article in my inbox during inbox clean out day. Good value article for anyone.

    Reply to this comment

  • Liam 17th April 2013

    I read somewhere that it may take time for the events to show up in GA reports. Is that true? You didn’t mention it, so maybe is is not the case, and also since I cannot now find anywhere that says it does take time.
    Very helpful page, by the way. Thanks.

    Reply to this comment

    • Anna Lewis

      Anna Lewis 13th May 2013

      Hi Liam, I generally find that it takes a couple of hours for the data to come in but you might see partial data before that. In theory, it’s best to wait 24 hours to make sure the data is most likely to be accurate but for quick testing and troubleshooting (as well as tracking) you can use the new Events feature in real time reports.

      Reply to this comment

  • Deepak 17th April 2013

    Great post Anna!!! Thanks for posting this article. can you please provide the video for the same to understating more about Event tracking…

    Reply to this comment

  • mathew 24th April 2013

    I use google Anaytics to generate site translate stats from our site : markham.ca.
    however the report from ga consists 2 letter language code ie fr, iw etc. how do list a label beside the language code fr : French, iw : Hebrew. pls advise

    Reply to this comment

  • doron 28th April 2013

    Hi Anna. I am looking to add information about linking from my site to other sites. just to do copy past to this code ?
    and in what to put it in the analytics code ?
    Thank you

    Google’s Guide to Event Tracking

    Reply to this comment

  • ceri 28th April 2013

    Great post Anna, The form submission i cant wait to implement and see whats happening, cheers for the link to Luna Metrics to.

    Ceri

    Reply to this comment

  • Don Alava 29th April 2013

    Great post. I’m glad the search engine lead me to your post.

    I read that the first 10 event hits sent to Google Analytics are tracked immediately, thereafter tracking is rate limited to one event hit per second. Should I be concerned if a visitor has fired off 10 events before they reach a conversion form? For example, if a confirmation page gets served quickly upon submit, could Analytics potentially not track the 11th event due to the one second delay?

    Reply to this comment

  • kerry 30th April 2013

    Hi Anna, where do mailto links fit in with this?

    Thanks

    Reply to this comment

    • Anna Lewis

      Anna Lewis 13th May 2013

      Hi Kerry, Mailto links work just like any other link, you have an href which you can put the event tracking code alongside.

      Reply to this comment

      • kerry 15th May 2013

        Hi Anna, I’ve tried that but it doesn’t work :( any chance I could get a bit of help? Thanks

  • Tom 30th April 2013

    Hi Anna, is it possible to track mailto clicks? Thanks, Tom

    Reply to this comment

  • Cory 1st May 2013

    Hey Anna,

    How do you track between two events, for example the time between clicking something and closing:

    Open window Close window

    Can you track that?

    Thanks heaps,

    Reply to this comment

  • Ryan 1st May 2013

    Which Google Analytics Plugin for wordpress are you using?

    Reply to this comment

  • Dan Richardson 5th May 2013

    Anna (or anyone) :)

    Do you need the onclick=javascript part too as part of the link code? thx

    Reply to this comment

  • Matt 8th May 2013

    Anna, this is a great blog post! I was looking for a good article on how to use Google Event Tracking and now I’m excited to try it out. I’m happy GA has this function built in! Can’t imagine not using it!

    Reply to this comment

  • Jordan 9th May 2013

    Hi Anna,

    Thanks for the great guide. I don’t mean to be a critic, but I encountered one problem with the way you have demonstrated Custom Event Values. Your examples pass this value as a string by wrapping the value in quotation marks, whereas it should be passed as an Integer with no quotes.

    Example:
    <a href="/downloads/whitepapers/seo-is-great.pdf" onClick="_gaq.push(['_trackEvent', 'whitepaper', 'download', 'SEO is great', '5', true]);" target="_blank">SEO Is Great Whitepaper</a>

    Should be:
    <a href="/downloads/whitepapers/seo-is-great.pdf" onClick="_gaq.push(['_trackEvent', 'whitepaper', 'download', 'SEO is great', 5, true]);" target="_blank">SEO Is Great Whitepaper</a>

    Thanks for the guide though. It really helped me until the brief hang-up there.

    Reply to this comment

    • Anna Lewis

      Anna Lewis 13th May 2013

      Hi Jordan, thanks for your comment, just had a look back over and you’re right, I must have got a bit code blind! Have updated examples now. Apologies for the error.
      Anna.

      Reply to this comment

  • Ady 15th May 2013

    Thank you! I’ve been looking anything on pixel tracking and Google Analytics and I just have opened 20 tabs of technical jargon. Then I came across your article…
    Do you have anything about adding pixel tracking to a GA code? All I found out was the _utm.gif that is needed. Can you help me Anna, please?

    Reply to this comment

  • Bharat 15th May 2013

    Hello, I am interested in knowing whether it is possible to track the timing through google analytics. Like at what time, how many number of users visited the page (which is kept for tracking). I would appreciate if any one can share the piece of the code for the same.

    Reply to this comment

  • shelby 3rd June 2013

    Thank you. I was so used to using the old analytics interface and am happy this article was written! Thank you!

    Reply to this comment

  • Pierre 5th June 2013

    TRULY AMAZING! Thanks for all your help Anna!

    Reply to this comment

  • Nathan 6th June 2013

    I’ve found a nice wordpress plugin (WP Google Analytics Events) for tacking Google Analytics Events. So it’s pretty easy to add custom tracking to the clicks on links or any element, and even to create an event so to see if the users scroll into view. I’ve put it on my site it SO COOOL!.

    Reply to this comment

  • Karen Keller 21st June 2013

    I need to put event tracking on a form submit. I’ve read elsewhere that there may be trouble in missing some events being tracked because immediately after calling that javascript the browser is going to submit the form and go to another webpage. Can you comment on that, how much do I have to worry about that? Your example on form submit doesn’t cover that eventuality. Also, there was some mention of a “utm.gif” tracking image not loading in time. What is that?

    Reply to this comment

  • Abdi Mohammed 1st July 2013

    Hi Anna – thanks for the interesting and thorough write up. I did have a question though – is it possible for GA to report on Events (external clicks) without someone setting it up? The reason I say this is because I’ve logged onto a client account wanting to set it up and there is data already there, e.g. the URLs of affiliate links that have been clicked. I checked the code on the website and they do not seem to have added the extra bit of tracking….and I am pretty sure the client would not have known how to do it. Am I missing something? Sorry if the question is a little wayward!

    Reply to this comment

    • Anna Lewis

      Anna Lewis 1st July 2013

      Hi Abdi, thanks for the comment. I imagine that the site will be using a plugin or tool which enables event tracking to work without you having to put the code in yourself, such as Google Analytics for WordPress by Joost de Valk. Alternatively it might be that it’s been built into the framework of the site so that additional code is not required.

      Reply to this comment

      • Tom Bowen 1st July 2013

        Abdi, try checking the source code as it is rendered by the browser with a View Source. Whether inserted with a plugin or a framework or something else, the GA code capturing the event should show up here, and that can help you investigate where it is coming from. If you do NOT see it in the View Source, then you’re right–it is not on the page, which would imply that there is some other page with the tracking code in it that is firing those events (either correctly or incorrectly). I think you could then do some advanced segmentation within Google Analytics to get a list of pages viewed by those who had triggered the events in question.

      • Abdi Mohammed 1st July 2013

        Thanks very much Anna – that makes sense and on the same lines as my initial suspicions. As long as its set up that’s the most important thing.
        Thanks again for the prompt response :)

  • Victor Clar 3rd July 2013

    Anna, amazing post and great comments! Just one question: if I’m tracking E-commerce, is it possible to have the value of the product as the value of the event?

    Reply to this comment

  • Tom Bowen 3rd July 2013

    Wouldn’t you in that case be using GA’s Ecommerce conversion tracking instead? I can’t think of what you’d be doing with Ecommerce to use an onclick event to track. Typically the last click in a checkout is to Submit a credit card, but you don’t know at that point if the credit card was accepted or not.

    Setting up Ecommerce tracking in Google Analytics lets you track everything easily, including the value of each order. I bet there is a good tutorial of it here on Koozai somewhere. If not, try googling for Justin Cutroni’s tutorial, titled “Google Analytics E-Commerce Tracking”.

    Reply to this comment

  • Victor Clar 4th July 2013

    If i want to know if cross-sells are effective, or if the different elements in the product page (zoom, video, pan, alternative images, product reviews, etc) contribute to sales / higher revenue, I would like those events to have the value of the item’s price but only if it was actually purchased.

    I could also do segments filering all those events under ecommerce reports, but it would be easier to have the list of events with how much each event contributed in $s…

    Reply to this comment

  • Mark 31st July 2013

    Hi,

    how do i create a track event for copy&paste email ?

    Example, if in website have email’s link and i want to track thios event. Some people copy&paste that in your mailbox (peope haven’t Outlook Express or Mail for Mac).

    BR
    Marco

    Reply to this comment

  • Get Discount Coupon 5th August 2013

    Great. Great. Great Article…

    I have a question
    How can I link conversion to previous visit?
    Means I have phone call as conversion,
    Some visitor comes to our website by searching some keyword and makes a call and leaves the website. Another visitor comes(of course it comes by searching another keyword) to our website and we want to push previous call conversion to Google Analytics and want to bind it to actual previous visitor?

    Thank you for such a great post.

    Reply to this comment

  • This is still an amazing resource.

    Thanks for putting it together guys. Agree with Pritesh though. Naming conventions are vital for this to work well.

    Reply to this comment

  • Michelle 27th August 2013

    Thank you so much for the super detailed guide! This is my first time using Google Analytics and this will help speed up my learning!

    Only thing I hate is I now have to re-do all of the links I want to track to include the analytics tracking code. :(

    Reply to this comment

  • Jennifer 29th August 2013

    Great article… above my pay grade. :)

    How do I track the number of clicks on the outbound facebook icon on my youtube channel?

    It is set to a client’s facebook page and they won’t share the inbound info. :(

    Thanks!

    Reply to this comment

  • Neil 3rd September 2013

    Anna, you’re an angel!

    I’ve searched high and low for someone that could explain this in plain English. You did – and with awesome examples!

    Off to track some ‘Buy Now’ button clicks…

    Thanks :)

    Reply to this comment

  • Marco 13th September 2013

    Hi Anna, great post ;)

    I added GA’s track event in company’s webpage and work it, but when customer copy&paste the email(in our webpage email is textual), for example didn’t click over button only copy and paste in your webmail, how do I can track this event?

    Other thing, GA tracked as event 1 goal when clicked on “send button” but didn’t send email….or cannot send mail form because missed a data, number, wrong text and cannot validate it….

    How I to do for fixed that?

    Thanks,
    BR
    Marco

    Reply to this comment

  • Jan 24th September 2013

    Hi Anna,

    Thanks for this post!

    I was wondering if you also know something about the reporting of the events. I have put events into place, but now I would like to know things like:

    - What series of events do users follow? (or, per user what events were triggered)
    - How many users tracked 2 or more events in the last week?

    Is it possible to get reports like that? I am struggling with this issue for some time…

    Thanks!
    Jan

    Reply to this comment

  • Andrew 24th September 2013

    This is an epic resource, and perfect for me as I’m just getting into event tracking. It took me at least one coding syntax error, but I’m now up and running. Thanks for sharing all of this information.

    Reply to this comment

  • Sangho 25th September 2013

    Good write up!

    Just wondering how you deal with externally hosted videos and cookie information exchange. Will this work automatically or do you need additional scripting?

    @Jan: there is an event flow report in GA. It should answer your questions.

    Reply to this comment

  • Heather Bell 27th September 2013

    You are a star. Thank you for the concise explanation.

    Reply to this comment

  • Pradeep Unni 9th October 2013

    Thanks Anna…. Thanks for sharing all this information. Keep rocking :-)

    Reply to this comment

  • Alex.H 30th October 2013

    Hi guys,

    Since the new updates I saw that
    onClick=”_gaq.push(['_trackEvent', 'videos', 'play', 'video marketing is awesome',]);”
    is obsolete and that we have to do this :
    https://developers.google.com/analytics/devguides/collection/analyticsjs/events#usingjquery

    I don’t understand how to implement these trackers for events. Did somebody have to deal with this allready ?

    Thanks,

    Alex.

    Reply to this comment

  • Alex Paps 22nd November 2013

    Awesome piece of information! Thank you Anna.

    Quick question please: Do you know if there is any way to set up an emailed alert for when it triggers? When I have an event completion?
    (not the weekly or daily reports that I can set up for the events overview !)

    Thanks in advance!

    Reply to this comment

    • Anna Lewis

      Anna Lewis 22nd November 2013

      Hi Alex, yep! Go to admin, bottom right you’ll find Custom Alerts. Change the green dimension box to event category / action or label and pop the relevant info into the box depending what it is you need the alert for. Then set the blue metrics box to total events, the next drop down to is greater than and pop 0 or 1 in the box. Don’t forget to tick the box to tell it to email you. These don’t work in real time so you might only find out 24 hours later, but better than nothing! :) Hope that helps.

      Reply to this comment

  • Pingback: GTM for agencies PART 2: How to track Google Analytics events with Google Tag Manager - à la data

  • Jack 22nd January 2014

    Hi Guys,

    Can any one help me to track download clicks in Google Universal. I used this code but it doesn’t work

    plz help me

    Reply to this comment

    • BenMc 24th January 2014

      @Jack:
      I’ve just gone through this myself. The code you need seems to be different for Universal vs the older GA.

      Instead of:

      onClick=”_gaq.push(['_trackEvent', 'whitepaper', 'download', 'SEO is great', 5, true]);”

      Try:

      onClick=”ga(‘send’, ‘event’, ‘whitepaper’, ‘download’, ‘SEO is great’, 5);”

      This format is working for me. Lots of info here:
      https://developers.google.com/analytics/devguides/collection/analyticsjs/events

      Reply to this comment

  • Jo 13th February 2014

    Hi Anna,

    Thank you for this very useful article.

    I am still a bit confused as to how to set up event tracking: in your article, you don’t seem to mention anything about setting anything up in google analytics under the admin > goals section.

    Is it a matter of either implementing the codes in your article or setting up the goals under the admin section? Or do I have to do both?

    thanks!

    Reply to this comment

    • Gemma Holloway

      Gemma Holloway 13th February 2014

      Hi Jo,

      You only need to set up a goal, as well as the code, if you wish to track that particular event as a conversion (i.e. want it to appear within the Conversions report in GA).

      If you are happy for the event to simply be registered as an event (i.e. appear in the Events report in GA only) then only the code needs to be implemented.

      Thanks,

      Gemma

      Reply to this comment

  • Jo 13th February 2014

    Hi Gemma,

    Thanks a lot for you quick reply!

    Reply to this comment

  • WMK 20th February 2014

    Current Google Analytics Menu does not include a “Content” menu? Mine shows:
    Dashboards
    Shortcuts
    Intelligence Events
    Real-Time
    Audience
    Acquisition
    Behavior
    Conversions

    Menu in article screenshot http://www.koozai.com/blog/wp-content/uploads/2013/01/finding-event-reports.jpg is different:
    Real-Time
    Audience
    Traffic Sources
    Content
    Conversions

    Reply to this comment

  • WMK 20th February 2014

    The menu change mentioned in my previous comment was reported around Oct. 9, 2013, as seen in the links below.

    Apparently, the “Events” submenu is now under Behavior.

    http://marketingland.com/google-changes-menu-options-adds-new-reports-in-google-analytics-61060

    http://analytics.blogspot.com/2013/10/new-acquisitions-reporting-channels.html

    Reply to this comment

  • Judy 26th March 2014

    Great article! Can you tell me is this the same code to use for Universal Analytics – analytics.js? I am getting confused, because i am under the impression there is a slightly different code for UA…ultimately I am trying to simply track a pdf download:) Thanks in advance for any insight.

    Reply to this comment

  • Pingback: Patrick Griffith | How to Be a Real-World Web Designer

Subscribe To The Koozai Blog