Events: Best Practices for Hierarchies and Naming Conventions
If you are looking to understand the actions that a user takes on your website, one of the best ways to do this is with event tracking. This can include (but not limited to):
- Link clicks (on site or outbound)
- Downloads (whitepaper, pdf, etc)
- Load times
In Google Analytics, event tracking is made up of 4 elements: Category, Action, Label, and Value. The awesome thing about this is that the hierarchy use cases are highly customizable so events are a very flexible way to report on user action.
For larger websites/enterprises, I tend to track events in the following format, utilizing the category as a means of organizing actions based on site structure. Note that the ‘Value’ field is used to set a numerical value for an event, most useful when there is a monetary value associated with an action.
Category: location of event (Homepage, About Us page, Resources page, etc)
Action: action the user took (Video, Whitepaper download, Start Trial, etc)
Label: specifics about action (Video name, Whitepaper name, detail of linked clicked if there are multiple with same action (ex. Learn more – product A, learn more – product B, etc)
For example, on this blog, I have event tracking on the ‘Continue Reading’ button on the bottom of each post snippet on my homepage (index.html). So I have added the following event hierarchy (via auto-event tracking in Google Tag Manager):
Category: Index (location of button click)
Action: Continue Reading (name of button)
Label: destination URL (to know which post snippet drove people to continue reading)
Another good use of the hierarchy would be for rolling up micro-actions into a larger action bucket. An example of this might be a video on a website. For this, you could code the event as:
Action: Play, Pause, Stop
Label: Name of video
One final use case I’ll mention here is tracking outbound link clicks. Event tracking can be a very valuable data point for this by setting up your hierarchy like so:
Action: Page URL (page link was clicked from)
Label: Click URL (destination link click takes the user)
Again, this is super easy to setup via Google Tag Manager. First, make sure you’ve enabled the necessary pre-defined variables. Then setup the tag which would look like this:
For more detailed information about Event Tracking in Google Analytics, visit the help center.