Previous to you can view event tracking consequences in your reports, you must set it up on your site following these steps.
- Set up tracking on your site. Create sure you have set up tracking for your website. For information on setting this up.
- Call the _track Event () method in the source code of a page object, widget, or video.
- category (required)
The name you provide for the group of objects you want to track.
- action (required)
A string that is exclusively paired with each category, and usually used to define the type of user communication for the web object.
- label (optional)
An elective string to provide additional dimensions to the event data.
- value (optional)
An integer that you can use to offer numerical data about the user event.
- View the reports. Once event tracking has been set up and operational on your site for a day, go to the Content section of the reports and view Event Tracking.
Anatomy of Event Tracking
The Event Tracking data model has the following components which map in a straight line to elements in the Analytics Reports interface:
- categories
- actions
- labels
- values
- implicit count
A easy example illustrate how you might use the Event Tracking method to record user interaction with a video Play link on your page. It assumes that pageTracker is the name used for your tracking object.
In this scenario, the reports for Events would display Videos as the Category, Play as the Action, and Baby's First Birthday as the Label. The rest of this document describes these mechanism in detail. Bear in mind that when you put into practice Event Tracking, you can use this data model as a guide, or you can simply use the _trackEvent() method to segment user interaction in any way that works for your data.
Categories
For Event Tracking, a category is a name that you provide as a way to group objects that you want to track. It is the first parameter used in the _trackEvent() method and it is required.
The term Category appears in the reporting interface as Top Categories in the Events Overview page. In this model, a category represents the "root level" of the hierarchical arrangement of Event Tracking, and you can use that structure in any way suitable to your reporting needs. Typically, you will use the same category name multiple times over related UI elements that you want to group under a given category.
Presume you also want to track how many times the video is downloaded. You could use:
In this case, there would be only one category—Videos—in the Events Overview page for Top Categories, and you could see collective metrics for user communication with the total set of rudiments for that single video object.
However, it's likely that you will have more than one single object that you want to track using Event Tracking, and it's worth considering how you want to categorize your reporting before you implement the call. For instance, you might want to track all separate movies under the main category of "Videos" so that you get aggregate numbers for all video interaction, regardless of which one user interact with.
On the other hand, you strength create divide categories based on the type of video—one for movie videos and one for music videos. You strength also wants a divide category for video downloads:
- Videos - Movies
- Videos - Music
- Downloads
In this scenario, you can decide the total combined event count for all three categories via the Total Events dashboard. The Total Events metric displays all event counts for all categories that you have complete in your Event Tracking implementation. However, you will not be clever to view combined metrics for all Videos unconnectedly from Downloads, because detailed event metrics are combined beneath their respective categories.
While the Event Tracking object model is entirely flexible, you should first plan your desired reporting structure before calling the _trackEvent() method for similar web object elements. 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 tracking category "Video" and later forget and use the plural "Videos," you will have two separate categories for video tracking. Additionally, if you decide to change the category name of an object that has already been tracked 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.
Actions
The term "Action" in the Event Tracking model refers to the second parameter in the _trackEvent() method. It too is necessary.
Characteristically, you will use the action parameter to name the type of event or interaction you want to track for a particular web object. For example, with a single "Videos" category, you can track a figure of specific events with this parameter, such as:
- Time when the video completes load
- "Play" button clicks
- "Stop" button clicks
- "Pause" button clicks
As with categories, the names you offer for an action is up to you, but keep in mind two important features of how an event action is used in the reports:
- All actions are listed independently from their parent categories.
This provides you with another useful way to segment the event data for your reports.
- A unique event is determined by a unique action name.
You can use duplicate action names across categories, but this can have an effect on how sole proceedings are calculated. See the suggestion below and the Implicit Count section for more details.
- To attain the best probable reports for extensive Event Tracking in your site, keep in mind the following suggestions for using actions:
- Action names be supposed to be relevant to your report data
Event Tracking combines metrics for the same action name across two dissimilar categories. For example, if you use the action name "Click" for both the "Downloads" category and the "Videos" category, the metrics for the "Click" in the Top Actions report appear with all interactions tagged with that same name. You could then view a detailed break-down of the "Click" action by category in the next report level. However, if you use the action "click" arbitrarily across your Event Tracking implementation, the value of that segment will be diminished in the reports. Consider choosing action names that relate to your data categories if you plan to use Event Tracking extensively on your website. For example, you might choose to reserve the term "click" for gadget interactions, while keeping the action terms, "Play," "Pause," and "Stop" reserved for video player interactions.
- Use action names globally to either aggregate or distinguish user interaction
For example, you can use "Play" as an action name to the "Videos" category for all videos on your website. In this model, the Top Actions report would offer collective data for events for the "Play" action, and you can see how this event for your videos compares to other events for the videos, such as "Pause" or "Stop."
However, suppose you want to use one video category for your reports, but you want some information about two different video player UIs. You can use the action name to distinguish the different player chromes without having to create separate video categories. The report can then distinguish the two player styles without losing the benefits of aggregate data on all videos for your website.
- Action does not always mean "action"
You can provide any string for the action parameter. In some situations, the actual event or action name is not as meaningful, so you strength use the action parameter to track other elements. For example, if you want to track page downloads; you could offer the document file type as the action parameter for the download event. In this scenario, your reports for the "Downloads" category would then be broken out by file types (pdf, doc, xls).
- Unique events are incremented by unique actions
Any time a user interacts with an object tagged with a exacting action name, the initial interaction is logged as one sole event for that action name. Any additional interaction with the same action trigger for that user's session will not contribute to the unique event calculation for that particular action. This is true even if the user leaves that object and begin to interrelate with another object tagged via the same action name.
This has two distinguished results in the reports. First, suppose a user interacts with the "Play" action from two unique video players tagged with separate categories. The Top Actions reports for "Play" will list one unique event even though the user engaged with two unique players. Secondly, each category's Action report will list one unique action, since there is certainly one unique event per category/action pair. See Implicit Count for more information.
Labels
The term "Label" in the Event Tracking data model refers to the third string parameter in the _trackEvent() method. This parameter is optional. With labels, you can offer additional information for events that you want to track, such as the movie title in the video examples above, or the name of a file when tracking downloads.
As with Categories and Actions, the reporting interface has its own section for all labels you create for your Event Tracking. Think of a label as a way to create an additional reporting dimension for user interaction with page objects. For example, suppose you have five video players on your page that you want to track interaction with. Each one of these players can use the "Videos" category with the "Play" action, but each could also have a separate label (such as the movie name) so that they appear as distinct elements in the report.
Values
The term "Value" refers to the fourth, and optional, parameter that you can use with the _trackEvent() method. This parameter differs from the others in that it is of type integer rather than string, so use it to assign a numerical value to a tracked page object. For example, you could use it to provide the time in seconds for an player to load, or you might trigger a dollar value when a specific playback marker is reached on a video player.
The value is interpreted as a number and the report adds the total values based on each event count. The report also determines the average value for the category. In the example above, the _trackEvent() method is called for the "Video Load Time" action when video load completes. The name of the video is providing as a label, and the computed load time is accrued for each video download. You could then decide average load time for all "Video Load Time" actions for the "Videos" category. Presume you had 5 unique downloads for your website videos with download times in seconds as:
- 10
- 25
- 8
- 5
- 5
The reporting interface would then compute these as follows, with the numbers in this example illustrating download time in seconds:
Implicit Count
In Event Tracking, each communication with a tracked web page object is counted, and each interaction is associated with a given user session. In the reports, Total Events are calculated as the total figure of interactions with a tracked web page object. On the additional hand, where a single user session (or visit) has one or more events, this is calculated as a single Visit w/Event or Unique Event in the reports.
For example, if one user clicks the same button on a video 5 times, the total number of events associated with the video is 5, and the number of unique events is 1.
The table above makes the supposition that user interaction with "Gone with the Wind" and "Mr Smith Goes to Washington" occurs separately in separate user sessions (visits). However, the table below illustrates how events are intended for a known action in a more compound and typical scenario, where some users press "Play" on only one video, while others interact with more than one video during a visit. Here, the total sole events reflect the total unique events for the "Play" action across labels. Notice that, even though there are 17 unique events per label/action pair, the reports list the unique events for the relevant dimension. So, for all actions, there are only 16 unique events, and for the "Videos" category, a total of 16 visits built-in an event in which "Videos" was the category.