Google Market tracks how many users have downloaded your application. But you may want to also know how users interact with your application. You could track, for instance, which part of your product is most popular and which features could be replaced or removed.
Reporting has become a standard component for many applications. This capability tracks user activity and sends the information to a remote service that stores data and provides analysis.
Google Analytics (http://www.google.com/analytics/), a popular choice in the nonenterprise market, is free and provides an open source ActionScript API. An ActionScript 3 API for Google Analytics data collection, called gaforflash, is available at http://code.google.com/p/gaforflash/. In addition, you can keep up with Google Analytics information by reading the blog athttp://analytics.blogspot.com/2011/01/new-actionscript-3-library-for-api.html.
You need to provide a website profile and some geographic information when you register on Google Analytics. A simple example follows.
To set the Internet permission:
<uses-permission android:name=”android.permission.INTERNET” />
To use the Web ID property you received from the service:
import com.google.analytics.GATracker;
import com.google.analytics.AnalyticsTracker;
var tracker:AnalyticsTracker =
new GATracker(this, “UA-111-222”, “AS3”, false);
// current displayObject
// Unique Web ID
// tracking mode
// debug mode
// button press go to section “game”
function pressButton(event:MouseEvent):void {
tracker.trackerPageView(“game”);
tracker.trackEvent(“Button”, “click”, “parameter1”, “parameter2”);
// category
// action
// additional parameters as needed
}