Track events

13/07/2021 0 By indiafreenotes

Google Analytics Event tracking is an invaluable feature that allows you to record interactions with elements of your website which aren’t tracked by default within Google Analytics.

Events are user interactions with content other than page loads (pageviews). Downloads, link clicks, form submissions, and video plays are all examples of actions you might want to analyze as Events.

Simply by adding snippets of code to your site, it is possible to track event interactions to understand how long users spend watching your videos or even which fields on your forms users drop off at.

Some of the typical uses for event tracking are listed below:

  • Tracking outbound link clicks to other websites.
  • Understanding how many users clicked on mailto email addresses or click-to-call phone numbers. This can help you to better understand the number of enquiries you are getting from your site.
  • Tracking PDF and other media downloads.
  • Measuring interactions with video content, such as time spent watching a video.
  • Tracking exactly where users drop off when filling in fields on your forms or checkout
  • Monitoring the clicks on unique elements of a page, such as the “contact us” call to action on your about page.
  • Collecting data about how many users filled in and submitted a form, although I would always recommend sending users to thank you pages whenever possible.

Anatomy of Events

An Event has the following components. An Event hit includes a value for each component, and these values are displayed in your reports.

  • Category
  • Action
  • Label (optional, but recommended)
  • Value (optional)

For example, you might set up a video “play” button on your site so that it sends an Event hit with the following values:

  • Category: “Videos”
  • Action: “Play”
  • Label: “Baby’s First Birthday”

Category

A category is a name that you supply as a way to group objects that you want to analyze. Typically, you will use the same category name multiple times over related UI elements that you want to group under a given category.

Suppose you also want to measure how many times the video is downloaded. You could use:

  • Category: “Videos”
  • Action: “Downloaded”
  • Label: “Gone with the Wind”

In this case, there would be only one category Videos in your reports, and you could see aggregate metrics for user interaction with the total set of elements for that single video object.

However, it’s likely that you will have more than one single object that you want to measure, and it’s worth considering how you want to categorize your reporting before you implement the call. For instance, you might want to analyze all separate movies under the main category of “Videos” so that you get aggregate numbers for all video interaction, regardless of which one users interact with.

On the other hand, you might create separate categories based on the type of video one for movie videos and one for music videos. You might also want a separate category for video downloads:

  • Videos – Movies
  • Videos – Music
  • Downloads

In this scenario, you could see the total combined event count for all three categories in your reports. The Total Events metric displays all event counts for all categories that you have supplied in your implementation. However, you will not be able to view combined metrics for all Videos separately from Downloads, because detailed event metrics are combined under their respective categories.

While the Event object model is entirely flexible, you should first plan your desired reporting structure before deciding upon your category names. If you plan to use the same category name in multiple locations, be careful to correctly reference the desired category by name. For example, if you plan to call your video category “Video” and later forget and use the plural “Videos,” you will wind up with two separate categories. Additionally, if you decide to change the category name of an object that has already been recorded under a different name, the historical data for the original category will not be re-processed, so you will have metrics for the same web-page element listed under two categories in the reporting interface.

Action

Typically, you will use the action parameter to name the type of event or interaction you want to measure for a particular web object. For example, with a single “Videos” category, you can analyze a number of specific events with this parameter, such as:

  • Time when the video completes load
  • “Play” button clicks
  • “Stop” button clicks
  • “Pause” button clicks