English | Site Directory

Google Analytics Tracking Code

Tracking API: Event Tracking

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

GATC Event and Outbound Link Tracking Methods

Method Details

_createEventTracker()

    _createEventTracker(objName) Deprecated. Use _trackEvent() instead.

    Creates an event tracking object with the specified name. Call this method when you want to create a new web page object to track in the Event Tracking section of the reporting. See the Event Tracking Guide for more information.

    var videoTracker = pageTracker._createEventTracker("Videos");

    parameters

      String   objName The name of the tracked object.

    returns

      _gat.GA_EventTracker_ A new event tracker instance.

_trackEvent()

    Constructs and sends the event tracking call to GATC via the event tracking object.

    parameters

      String   eventType The type name for the event.
      String   opt_label An optional descriptor for the event.
      Int   opt_value An optional value to be aggregated with the event.

    returns

      Boolean whether the event was successfully sent.

_trackEvent()

    _trackEvent(category, action, opt_label, opt_value)
    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.

    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 to be aggregated with the event.

      returns

        Boolean whether the event was successfully sent.