How to Set up Event Goals in Google Analytics

When you want to track the specific behaviours of visitors to your site – leaving a comment,   downloading a file – you set up an ‘Event’ goal.

There is more technical work involved in creating Event goals than URL Destination or Threshold goals. Your website developer will have to make some   changes to the code on your site, and understand the web coding language javascript.

Data Habits is created for non-technical people who want to understand web analytics.   So this lesson assumes you are working with a skilled web developer who can make the necessary technical changes to your site.   We’ll focus on the overall process, so you can work with confidence with your developer to set up Event goals.

When I say that Event goals require “changes’ to your website”, that doesn’t mean that it is always easy to make these changes on all website platforms. If your website platform is open source and relatively easy to modify, a technically skilled website programmer should be able to set up several event goals in a few hours. If you have a proprietary system managing your website and you can’t make any changes to the underlying code that runs it, you are likely out of luck if it’s not designed to support event goals.

With all those qualifications out of the way, let’s look at what’s involved. There are three steps to setting up event goals:

  1. Decide on what ‘events’, or user behaviours, you want to track as goals.
  2. Modify your website to record an event to your Google Analytics account every time one of these events occurs.
  3. Set up an event goal in Google Analytics to track when these events occur.

Let’s look at each of these steps.

1. Decide on what user behaviours on your site you want to track as a goal.

Your ability to track event goals on your site is limited by two things: your imagination and the skillls of your website programmer. You could track any behaviour your site visitors make, from moving their mouse to downloading a documents to clicking on a link.

Remember we need to focus on useful site behaviours, so I will give you a few recommendations for straightforward events to track:

  • Clicking on a particular link
  • Downloading a PDF report
  • Leaving a comment on your site
  • Logging in to your site
  • Pressing ‘Play’ on a video
  • Watching an entire video
  • Scrolling to the end of a long blog post
  • Filling out a form on your site, but not clicking on ‘submit’

As you can see, you can track almost any behaviour as a goal – negative and positive behaviours.   This doesn’t mean you should track every possible action on your site.   You need to ask yourself what good the information will do you – what will you do differently once you have great insights into visitors who take this particular action? It’s called the ‘So What?‘ test, and it’s important.

Once you are tracking important visitor behaviours as goals, Google Analytics gives you much more powerful insights, as you can focus in on these particular visitors: where they came from, what brought them back to your site, and how to get more of them.   But don’t get overexcited and track every behaviour – take some time to be choosy about what you track.

2. Modify your site to track these events in your Google Analytics account.

Here’s where things get a lot more technical. You – or your website developer – must modify the code on your website to send a signal to your Google Analytics account every time one of the events you have defined occurs.

Every time someone takes the action you want to track, a bit of javascript code on your site sends a   message to your Google Analytics account, alerting it that the action has happened.   This message must be formatted in a particular way, and you define it’s ‘labels’ so that you can track very specific actions that occur on your site.

For instance, an important element of your website is PDF reports on your biggest projects.   You want to be able to track when these are downloaded as goals in Google Analytics, so you can tell where these visitors are coming from, what else they do on the site, and how to ultimately get more people downloading your reports.

You will need to decide on how to categorize the download behaviour, by assigning the following values:

Category: The overall group of behaviours you want to track.   For our example, ‘Report’ would work well.

Action: A name for the behaviour exhibited. In this case, ‘Download’ would be helpful.

Label: This is the specific unique behaviour to be tracked – in our example it could be the title of the report so “Boston Project 2012”.   This value is optional, but you can see why it would be important to have a record in Google Analytics of which particular reports are downloaded.

To make all this tracking happen, you need to add a short bit of custom code to each instance of the functionality on your site. As mentioned before, this can be relatively quick or almost impossible to implement on your site, depending on your setup.

Here are some great resources to share with your website developer on how to make these modifications to your site:

The GAConfig event tracking tool
Step-by-step instructions for your website admin in how to create the code for tracking many common events

Official Google Analytics documentation on Event tracking
This can be a little dense and involved, but it will tell you – and your web developer – everything you need to know (and more) about event tracking.
Here’s the version to use if you have installed Universal Analytics

Event Tracking in Google Analyitcs – the complete guide
SEOTakeaways has excellent advice for setting up Event goals in Google Analytics.

3. Setting up Event goals in the Google Analytics Admin panel

So you have decided on what specific visitor behaviours you want to track, and your web developer has set up some scripts on your site to alert Google Analytics whenever these occur.   You have specific labels for each of these actions, with a Category, Action and Label for each one. Now you need to set up your Google Analytics account to ‘listen’ for these events, and record them as a goal whenever they happen on your site.

Here’s the step by step for setting up two goals related to our earlier example: tracking downloads.

Log in to your Google Analytics account.

Click on the ‘Admin’ button at the top right of the page, on the orange banner. Make sure you are in the correct ACCOUNT and PROPERTY.   You may see one or more ‘VIEWS’, or ways to track your website.   Click on the one to which you want to add a goal.

Make sure you are in the proper Account, Property (website) and View (profile) to be setting up a goal in Google Analytics.
Make sure you are in the proper Account, Property and View where you want to record the goal.

Click on the ‘Goal’ tab (between Users and Filters) Click on the ‘CREATE A GOAL’ button.

Choose a 'Custom' goal type when setting up an event goal in Google Analytics. The other options go to the same place, and are just confusing!If you see a number of options under headings like ‘REVENUE’, ‘ACQUISITION’ or ‘INQUIRY’ ignore these and click down to the last option, ‘Custom’. (All these options end up in the same place, they are just set up to confuse you, the inexperienced Google Analytics user. Now you know.)

Give the goal a name, one that will make sense to you and anyone else who checks the account.   We’re going to set up this goal to track downloads of a specific PDF, the report on our Boston 2012 project.

Choose the ‘Event’ option, and then enter the Category, Action and Label you decided on earlier. Here’s how it will look.

Setting the Category, Action and Label of an Event goal in Google Analytics

You can ignore the ‘Value’ field, and ‘Verify’ may or may not work, depending on how long ago your developer set up the javascript events you are tracking.

Save the goal, and you’re done.   You have defined a particular action that you want to track in detail (downloads of the Boston 2012 project PDF) your web developer has set up a script on your site to alert your Google Analytics account whenever someone downloads that particular file, and you have set up your account to ‘listen’ for that event and record it as a particular goal.

Note that you could make a more generic ‘Report Download’ goal by not specifying the label of the event, assuming that every PDF report download is triggering an event with the ‘Report’ category and ‘Download’ action.

In your next lesson you will learn how to track your email marketing and social media in Google Analytics.

Do you have questions about this lesson?
Ask them in the comments below.

Did you find this page via Twitter or a link from a friend?
Click here to get the rest of these lessons sent to you via email. Of course you can unsubscribe at any time with just a couple of clicks.