DeskMetrics Analytics for Adobe Air runtime - Complete API reference

You probably went through the three minute tutorial and learnt the basics of DeskMetrics Analytics, such as downloading our SWC, adding it as a compiler reference and making a simple example using the DeskMetrics Analytics’ platform. If you haven’t done so, we recommend checking it out it before reading the complete documentation.

Basic information about DeskMetrics Analytics API

The DeskMetrics Analytics Adobe Air API is, basically, a wrapper for the DeskMetrics Analytics web service API. Its basic role is to take the data collected, serialize it into a JSON string and finally send it to DeskMetrics’ servers.

There are a few more features, like caching and background data sending (through a separate thread); If you are curious about our implementation, check our Adobe Air API code at Github

The DeskMetricsTracker class

The DeskMetricsTracker class contains all supported tracking features provided by DeskMetrics Analytics’ platform.

Note

You don’t need a DeskMetricsTracker instance because all methods are static.

The standard methods provided by the library are:

com.Deskmetrics.DeskMetricsTracker.Start(appid:String, version:String, realtime:Boolean)

Must be called when your application starts.

Note

You can get your application id at http://analytics.deskmetrics.com/

.

com.Deskmetrics.DeskMetricsTracker.TrackEvent(category:String, name:string)

Events are triggered by things that occur, allowing better organization of your data. These events are updated immediately when a user interacts with your software. They are just strings and they can be called anything you want.

Events can be user actions, such as clicking a mouse button, pressing a key, or software occurrences.

com.Deskmetrics.DeskMetricsTracker.TrackEventValue(category:string, name:string, value:string)

Method used to track any kind of event and attach a custom value.

com.Deskmetrics.DeskMetricsTracker.TrackLog(message:string)

Utility to track logs.

com.Deskmetrics.DeskMetricsTracker.TrackCustomData(name:String, value:String)

Sometimes you may want to obtain a specific piece of information from your users or software. There are two ways to do that, by using our log function or the function to send custom data.

The function TrackCustomData is useful for sending any type of data and generating information and charts. For example, you might want to get information about your users, like a phone number. You can used the TrackCustomData function to get it and follow its daily income.

com.Deskmetrics.DeskMetricsTracker.TrackCustomDataR(name:String, value:String)

Same as TrackCustomData but sends the data in real time.

com.Deskmetrics.DeskMetricsTracker.TrackException(ex:Error)

Exceptions are used to report errors when the code is running. An exception is thrown when a run-time error occurs, for various reasons, e.g. mismatched data type error, out-bounds memory problems and so on.

Debug version

To activate debug, just add Tracker.debug = true;. Alerts followed by messages will be produced by your app when an important event or error occurs.