RIATrax

RIATraxRIATrax is an Adobe Flex component set which integrates automatic event tracking through Google Analytics. Event tracking is an evolutionary way to send data to Google Analytics as to not inflate pageview counts. It provides a user defined 3-dimensional data collection system which can be used to track: User interaction, Server latency, Custom Data, and more. Visit Google Analytics information page for details.

The RIATrax components are direct replacements for the base Flex components and add automatic event tracking. If you have a Google Analytics account but don’t yet have event tracking enabled, you can request that you event tracking be enabled here. The following download includes both the documentation and the SWC Flex library.

Download RIATrax Beta 1

VIEW DOCUMENTATION

EXPERIENCE RIATrax EXPLORER

RIATrax SUPPORT GROUP

This first release of this free component set includes the components shown in the table below.

Component Event Tracked data tracked
Accordion IndexChangedEvent.CHANGE selected child’s label
Button MouseEvent.CLICK Button’s label
ButtonBar ItemClickEvent.ITEM_CLICK selected Button’s label
CheckBox MouseEvent.CLICK label
ColorPicker ColorPickerEvent.CHANGE selectedColor
ComboBox ListEvent.CHANGE selectedLabel
DateChooser CalendarLayoutChangeEvent.CHANGE selectedDate
Image MouseEvent.CLICK source
LinkBar ItemClickEvent.ITEM_CLICK selected Button’s label
LinkButton MouseEvent.CLICK label
Menu MenuEvent.ITEM_CLICK item’s labelField
MenuBar MenuEvent.ITEM_CLICK item’s labelField
PopUpButton MouseEvent.CLICK label
PopUpMenuButton MenuEvent.ITEM_CLICK item’s labelField
RadioButtonGroup ItemClickEvent.ITEM_CLICK selectedValue
TabBar ItemClickEvent.ITEM_CLICK selected Button’s label
TabNavigator IndexChangedEvent.CHANGE selected child’s label
ToggleButtonBar ItemClickEvent.ITEM_CLICK selected Button’s label
Tree ListEvent.CHANGE selected item’s labelField
ViewStack IndexChangedEvent.CHANGE selected child’s label

By simply changing your existing component namespace to the RIATrax namespace and instantiating the Tracker with your Google account information, you will get automatic event tracking through Google Analytics. Each component also includes overrides for the properties being recorded allowing you to pass custom values if required.

Basic Usage:

layout="absolute" creationComplete="init()"
xmlns:rx="com.happytoad.libs.riatrax.*">

<!--[CDATA[
import com.happytoad.libs.riatrax.Tracker;
private var tracker:Tracker =
Tracker.getInstance();

private function init():void{

tracker.account="UA-xxxxx-yy";
tracker.display=this;
tracker.visualDebug = true;
}
]]-->

Although the chart above showed which data was automatically being tracked, you also have the option of supplying your own values. Each component contains the following properties that can be set to override the default values shown above.

Component Properties

  • gaCategory:String - passed to Google as the Category property.
    see component documentation for default
  • gaAction:String - passed to Google as the Action property.
    see component documentation for default
  • gaLabel:String - passed to Google as the Label property.
    see component documentation for default

Additional properties that can be set per component:

  • gaValue:Number - value to be aggregated with the event.
    defaults to 0
  • gaMode:String - ( unique | all | none ) tracking mode for component. If set to unique, only the first unique event for component - ( For example: A component with children like a TabNavigator will track each child only one time, while a simple component like a Button would only track the first click). If set to all, every instance of the event will be tracked even if they are duplicates. If set to none, the tracking is disabled.
    defaults to unique

In addition to automatic tracking the Tracker class also exposes the trackEvent() method as a public method allowing you to manually track events as well, just as you would with the GATracker class from Google.

Tracker Properties & Methods

  • display:DisplayObject - DisplayObject to hold a reference to the object. This property should be set within the application root and set to “this”.
    this is a required property
  • account:String - This String is also known as the Google UA number of your tracking code and looks like UA-xxxxx-yy, where the x’s and y’s are replaced with the numbers that correspond to your account and profile information for the object you are tracking.
    this is a required property
  • mode:String - ( Bridge | AS3 ) Use Bridge mode if you control both the HTML page and the Flash content. This mode is best if you have already implemented Google Analytics (ga.js) tracking on your website and you want to add tracking to embedded Flash content. The bridge mode simplifies Flash-to-JavaScript communication by providing a unified ActionScript 3 interface to the ga.js code. It provides the connection from the ActionScript 3 calls to the Analytics JavaScript in order to make the tracking work.
    Use AS3 mode if you control the Adobe Flash ActionScript 3 code, but you do not control the hosting environment of your Adobe Flash application. For example, if you are developing Flash content for distribution across many sites, then you would use AS3 mode. AS3 mode is completely independent from the ga.js tracking code and contains all the Analytics tracking functionality. There is no need for a separate ga.js tracking installation with this mode. In addition, AS3 mode uses the Flash storage mechanism to track session information for the visitor.
    defaults to AS3
  • visualDebug:Boolean - ( true | false ) set to true to show visual debugging within your application. This can be used to test that all is working properly.
    defaults to false
  • config:Configuration - the Configuration object of the tracker. see Google documentation for additional details.
    defaults to null
  • debug:DebugConfiguration - the DebugConfiguration object of the tracker. see Google documentation for additional details.
    defaults to null
  • trackerCount:int - the current total count of events tracked for user session.
  • getInstance():Tracker - returns an instance of the Tracker
  • trackEvent(category:String, action:String,label:String=null,value:Number=0):Boolean - method used for sending event data to Google

Please leave comments with your experience and any wishes for additional components or events that you would like to see tracked.