GA Event Tracking

GA Event Tracking

Google Analytics Event Tracking

  • A method available in the ga.js tracking code
  • Employs an object-oriented model that can be used to collect different types of interactions
  • Use it to record user interactions with website elements
  • Attach the method call to the UI element that needs to be tracked
    • All user activity is thereafter calculated on those elements
    • User activity is displayed as Events in the Analytics reporting interface
  • Pageview calculations are unaffected by user activity tracked using the Event Tracking method

Events To Track

  • Flash Movie players and other Flash elements
  • Embedded AJAX page elements
  • Page gadgets
  • File downloads
  • Load times for data

The _trackEvent() Method Specification

  • _trackEvent(category, action, label, value, noninteraction)
  • category (required) - A name that you supply as a way to group objects that you want to track
  • action (required) - A string that is associated with one category, and commonly used to define the type of event or user interaction you want to track for the web object
  • label (optional) - A string to provide additional information for events that you want to track, such as the movie title for a video, or the name of a file when tracking downloads
  • value (optional) - An integer that you can use to provide numerical data about the user event, such as the time in seconds for a player to load
  • non-interaction (optional) - A boolean that when set to true, indicates that the event hit will not be used in bounce-rate calculation

Google Analytics Tracking Guidelines

  • Use proper case with method names because they are case sensitive
  • Strings should be passed in quotes, but booleans and other types should not be in quotes
  • Verify that you are using the correct name of the method for method calls
  • Verify strings do not contain leading or trailing whitespace

Sources