Tracking Code: Event Tracking

This reference describes the methods that you use for setting up Event Tracking in Google Analytics reporting.

GATC Event Tracking Methods

  • _trackEvent(category, action, opt_label, opt_value, opt_noninteraction)

Method Details

_trackEvent()

    _trackEvent(category, action, opt_label, opt_value, opt_noninteraction)

    Constructs and sends the event tracking call to the Google Analytics Tracking Code. Use this to track visitor behavior on your website that is not related to a web page visit, such as interaction with a Flash video movie control or any user event that does not trigger a page request. For more information on Event Tracking, see the Event Tracking Guide.

    You can use any of the following optional parameters: opt_label, opt_value or opt_noninteraction. If you want to provide a value only for the second or 3rd optional parameter, you need to pass in undefined for the preceding optional parameter.

    parameters

      String   category The general event category (e.g. "Videos").

      String
        action
      The action for the event (e.g. "Play").

      String
        opt_label
      An optional descriptor for the event.

      Int
           opt_value
      An optional value associated with the event. You can see your event values in the Overview, Categories, and Actions reports, where they are listed by event or aggregated across events, depending upon your report view.

      Boolean  opt_noninteraction Default value is false. By default, the event hit sent by _trackEvent() will impact a visitor's bounce rate. By setting this parameter to true, this event hit will not be used in bounce rate calculations.

      returns

        Boolean whether the event was successfully sent.