Tracking the impact of website events helps you monitor the way people interact with your website. Understanding these visitor interactions helps you measure the effectiveness of your website and any changes you make. Google Analytics makes tracking website events, such as click-throughs and downloads, simple. In this article, we will explain what event tracking in Google Analytics is and how to track events in Google Analytics.
Image via Flickr by perzonseo
Event tracking is a feature of Google’s free website tracking tool, Google Analytics. This tool lets you track the events that you define. Through Google Analytics Event tracking, you can track and monitor events that aren’t included in Google Analytics’ basic tracking metrics.
Event tracking’s customization properties help you focus on the Google Analytics events that really matter to you. Event tracking helps you identify the elements of your website that work and any barriers that may impair user interaction. You can use event tracking in Google Analytics to make your website better.
Event tracking can also help you create more effective advertising campaigns. For example, you might invest in a pay-per-click advertising campaign for the type of customer inquiries with the best conversion rates and lead values.
Google events are actions that occur on your website when visitors interact, or don’t interact, with your content. Some Google events include:
As you can see, anything a website user does, or doesn’t do, is a Google event.
Custom events are the events you monitor through Google Analytics’ Event tracking tool. Google provides the ability to view and monitor only the events you’re interested in. For example, if you’re focusing on developing video content, you might monitor events on pages with videos, such as:
Google lists event tracking under “Behavior” on the sidebar at the left side of the Google Analytics home page. Clicking “Behavior” expands the menu to reveal further options. You’ll find “Events” under “Site Search” in this expanded menu. Click “Events” to reveal the four event tracking pages:
Once you set up your events and people start interacting with your site, these pages will become populated with data.
Google Analytics requires information about your event before you can track it. It gets this information from code referring to the following qualities:
This is the element your visitor interacts with, such as form submissions. Categories must be text. Every event needs a category.
This is the type of action occurring during an event, such as sign up. Actions are always text. Every event also needs an action.
This is a method of categorizing your events. For example, if you have several white papers available for download on your website, you could label each one with their title so you know which ones are the most popular. Labels are optional text fields.
A numeric value associated with the event. This could be a value you ascribe to an action, such as a monetary value for every new subscriber, or a number linked to the event, such as the length of a played video. Values are optional and always expressed as integers without any units of measurements.
Take the following steps to create your event using this method:
Deciding how to structure your reports before you start coding will help you get the most value from event tracking. Consider which events you want to track and the categories, actions, labels, and values you’ll use for each. Identify similar events which you will group using the same categories, actions, and labels. This will help you track your events over time. If you change your structure in your future, past data isn’t reorganized, so it pays to do this job right the first time.
If you haven’t already connected your website to your Google Analytics account, you’ll need to do this before you start tracking events. Log in to your Google Analytics account and click on your properties at the top of the screen. You’ll see a list of your website properties and information about them.
Google lists your tracking ID under “Properties and Apps.” This is a string with the format UA-000000-1. UA stands for Universal Analytics. The first six numbers are your account number, and the final number is the property number.
Once you know your tracking number, you’ll add code containing this number to your website so it can track your events. Add the following code under the tag of each page on your website, making sure to change GA_TRACKING_ID to your own tracking ID.
Next, you’ll add code snippets that tell Google Analytics what to track. Add your code to the header of the page where your event takes place. Code snippets for event tracking follow the format:
ga(‘send’, ‘event’, [eventCategory], [eventAction], [eventLabel], [eventValue]);
This code translates to Google Analytics send event, followed by the customized fields defining the event. To customize this code, substitute eventCategory with your event’s category, eventAction with your event’s activity, and so on. Event tracking code also needs an event handler around the event tracking code. An event handler is code that triggers your tracking event when a website visitor performs a set action. An example of completed code is:
This code sets up an event for Frank’s Cafe. Whenever someone downloads the cafe’s .pdf dinner menu, the code triggers the event. The event is worth 20. The cafe’s owner may create another event for visitors downloading the breakfast menu, for example. This event might have a value of 10, as customers enjoying breakfast tend to spend half as much.
After setting up events in Google Analytics, you should trigger them to make sure your code works. Complete the action you’re tracking, then visit the Google Analytics page to see if it recorded your event. Click “Behavior,” then “Events,” then “Overview” in the left sidebar to view your tracked events. If you have no events recorded, proofread your code and correct any errors. Test it again until your code works.
If you aren’t confident working with code, Google Tag Manager provides an alternative way to set up event tracking. Many people with large websites or interest in tracking many things also find Google Tag Manager helps them scale their event tracking efforts.
If you’ve never used Google Tag Manager before, you’ll need to sign up for an account. Click the “Create Account” button, then complete the form using your website’s details. You’ll then need to add Google’s code to the head and body of every page on your website. Then take the following steps to track an event using Google Tag Manager.
As you’ll need Google Tag Manager’s click variables for your own tags and triggers, make sure they’re enabled. Select “Variables” in the sidebar, then the blue “Configure” button in the top right of the screen. Scroll down and tick all the click variables. Then click the close icon at the top left of the menu to apply your changes.
Click “Overview” on the sidebar to return to the Google Tag Manager main page. Then click the “New tag” button to the right of the sidebar. This will create a new tag for your event.
The tag workspace has two clear sections. The top section is the configuration section, where you’ll set up your tag. Click inside this box, then choose “Google Analytics: Universal Analytics” as your tag type. This should be the top option.
You’ll then choose “Event” from the “Track Type” drop-down menu. Fill in your category, action, label, and value if applicable, just as you would when completing the code in the steps above. Change the Non-Interaction Hit setting to “True,” so the event doesn’t count toward your bounce rate.
Click the “Google Analytics Settings” drop-down menu and select “New Variable.” Enter your Google Analytics tracking ID in the space provided, then click the close icon. This will send the event tracking data from your website directly to Google Analytics, where you can assess it later. Click beside the configuration box to return to your main tag page.
Click within the Triggering box to specify your trigger. This is the action that will activate your event. Click “All pages” so your event works throughout your site. Then click the plus icon in the top right to add new triggers. Click within the Trigger Configuration box, then scroll through the list and choose the trigger you want.
Set a name for your trigger at the top of the page so you can easily use it for future events. Then click the blue “Save” button at the top right of your page to save your Google Tag. It will now send data from your website to your Google Analytics page.
Event tags are codes that track the number of times people view or click on Google AdWords advertisements. You might use event tags to track which ads people view most often and which ads encourage the highest number of click-throughs. You can also add extra information, such as keywords, which Google includes whenever the ad event occurs. They work similarly to event tracking on Google Analytics but are not as customizable.
Read More About Resources