Flash_and_Flex_03_2009

Flex Analytics 101

UI Events Tracking UI events is a very straight-forward task. When users interact with the UI components in a Flex application, events are emitted to notify the application code that a certain action (click, scroll, mouse over, etc) took place. Developers can write code to notify an Analytics engine about a particular UI action. Consider the following Flex button component:

from the application logic layer. For instance, if a rich client executes a request to process a credit card transaction, an event may be issued indicating a successful or failed result. Tracking these events can provide important insight into the core business functions of an application. • Tracking time intervals (user activity and inactivity per component or screen), session duration – due to the lack of page fetches in a rich client application, web servers (and thus traditional analytics systems) cannot track the time a user spends on any particular screen or in an application state. However, it is a very important metric as it indicates whether users are struggling with application navigation, which might be a sign of a usability problem. Dimensionality Applications can submit data readings for analysis and create logical associations between readings and concepts in the application. These associations create metrics. For instance, you could have a metric for the number of clicks of some button which would indicate execution of a business function. Simple associations provide a very basic view of the data. In the example of the button click, all you would know is how many people actually clicked the button, but no more than that. However, for most of the applications it is essential to have a deeper analysis of the data. For instance, it may be important to know not only the percentage of users that executed a certain action, but how many of them came from a particular geographic area, are in a particular age group or of a certain gender. In fact, as you analyze the collected data, you may need to group it by different categories. For example, you may need to ask the system the following: generate a chart of the number of users from California, who are male between ages 25 and 30, who clicked the ‘Check Out’ button between the hours of 8:00am and 1: 00pm . In this example, application should be able to submit additional information for the button click metric. That additional information becomes the metadata of the submitted readings or dimensions. Creating custom data views by combining dimensions is called data slicing. Analytics products supporting dimensionality and data slicing enable businesses to work with data in order to extract valuable information about applications and business processes. Analytics and Flex Integration The subject of analytics may sound complicated, but fortunately integrating it into ActionScript is a relatively straight-

forward task. Both Flex analytics solutions by Google and Midnight Coders provide Flex library components (SWCs) with the ActinScript analytics API. It would be a developer’s responsibility to integrate these components into the monitored Flex application. Below you will find a few examples of using these libraries for tracking various types of events described above in the ‘User Activity Tracking section.

Listing 2. Reporting dimensional analytics data using Midnight Coders API

private var dims:DimensionNames; private var dimValues:DimensionValues; private var indicator:ReadingIndicator; private function init():void { // set up the name of the dimension group – "My App" // and the names of the dimensions in the group dims = new DimensionNames( "My App", "OS", "Screen Resolution" ); // set up concrete values for the dimensions dimValues = new DimensionValues( dims, getOS(), getResolution() ); // configure reading indicator for the button. // the indicator automatically subscribes to the specified event // and reports data to the analytics server along with the dimensions indicator = new ReadingIndicator( dimValues, clickMeButton, MouseEvent.CLICK ); // start data collection agent DataCollectionAgent.instance.start(); } private function getOS():String { return Capabilities.os; } private function getResolution():String { return Capabilities.screenResolutionX + "x" + Capabilities.screenResolutionY; }

03/2009 (5)

17

Made with FlippingBook HTML5