How to set up Event Tracking

Event tracking is a great way to know if users are engaging with your website and performing intended actions. 

The Google Merchandise Store, for instance, can track clicks on the global navigation bar to better understand how users navigate their website.

To collect Event data from a website, you'll need to add JavaScript to the individual elements on the site you wish to track. 

Note that you’ll have to set up separate event tracking for each element or state you wish to track. For example, if you want to track when videos are both played and paused, you will need to set up separate event tracking for the play and pause states of the button.

When a user performs an action on an element with event tracking, the event tracking code will pass four parameters along with the event hit. These parameters are: “Category,” “Action,” “Label,” and “Value.” 

You can define these parameters in your JavaScript to organize the data in your event reports.

  • “Category” lets you organize the events you track into groups. For your website, this might be “Videos” or “Social Shares.”   
  • “Action” is the action the user took when they initiated the event. If you were tracking when users click a video play-button, you might have a category called “Videos” with an associated action of “Play.”  
  • “Label” is an optional value used to further describe the element you’re tracking like the name of a video. This can help you make your event reports more readable. 
  • “Value” is an optional numerical value like the amount of time it takes a video to load or how much a specific event action is worth. You can use Value to assign a specific dollar amount when a specific action occurs.

Be mindful about how you name your categories, actions, and labels, so when they show up in your reports, the event data will be easy for you and others to understand.

If the Google Merchandise Store wants to set up an event on their website to track the “Android” link under “Brands”, they can set the event category as “Navigation,” the action as “Brands,” and the label as “Android.” Since navigation doesn’t have a direct monetary impact, they can leave off the “Value” parameter.

Once the event tracking code has been added to the navigation element, every time a user interacts with that element it will pass the parameters that were assigned to Google Analytics, which will appear in the Events reports.

Total Events are calculated as the total number of interactions with the tracked element, while Unique Events are how many users have triggered that event. So if a user clicks on the Google Merchandise Store’s navigation for “Bags” five times in a single session, the total number of link clicks for that event will be “five,” but the number of Unique Events will be counted as “one.”

Events reports are found under Behavior. When you open the “Top Events” report, events are organized by category. 

You’ll see metrics for Total Events, Unique Events, and Event and Average Value (if applicable) for each event category you set up. You can jump to the category, action, or label simply by clicking on the navigation links at the top of the table report.    

If you click into the Category, you can see the associated Actions. This can help you view the various interaction states that were tracked for a Category in one place.

If you click into the action, you can see the labels associated with that action. 

Another great use for events is tracking outbound link clicks that lead away from your site. 

For example, the Google Merchandise Store has a live chat button in their top navigation bar that opens a pop-up window when clicked. However, this pop-up window was implemented by a third-party vendor and goes to a different URL that the Google Analytics tracking code won’t track by default. 

We can set up event tracking on this button with the category “Outbound links,” an action of “Live Chat,” and a label of “Home” (or wherever the live chat button was clicked from). That way, we can tell how many times the live chat button was clicked and from what page. We can then know which web pages were causing users to seek help and work to better optimize those pages.

You should be thoughtful about the events you want to track to give you insight into the customer behavior on your website. If your goal is to increase engagement, you’ll want to focus on tracking actions that demonstrate how users navigate your site and interact with your content. You can use event tracking to better understand user behavior specifically for your website and overall business.
 

Was this helpful?
How can we improve it?