Article - What Can statMobi Analytics Do For My Application?

v1.05 : 06.04.2012



What are statMobi Analytics?

Analytics are used on the World Wide Web to track your user's interaction with your site. That user interactivity information can be very helpful for optimizing your user's experience, encouraging users to return to your site early and often.

The statMobi Analytics package offered by appMobi allows you to do the exact same thing, only for your mobile applications. Your appMobi application can be seeded with data point calls that allow the application developer to track just about any information imaginable at any point during the application's execution. Even if the application is not connected to the Internet, all the analytics data is stored on the device and posted to the server later once the application is restarted while connected to the Internet.

How does statMobi Analytics work?

To take advantage of the statMobi Analytics package, developers first need to opt-in (or enable) the analytics cloud service in the XDK. Next, the developer's application should be seeded with calls to the statMobi analytics engine. Once that is done, some testing of the analytics data can be performed. Finally, once the application is tested and distributed live, the developer can harvest the analytics data from live installations from the appMobi appHub.

Opt-in to statMobi through the appHub

To get started, you'll have to enable statMobi Analytics for your application through appHub. To do that, you'll want to navigate to appHub(http://apphub.appmobi.com) and log in using your XDK account credentials. There you should be able to select the application for which you want to enable analytics.

From the App Development Tools section for your app, Select the statMobi icon (if statMobi is not enabled, the wrench will be shown in a red color).

On the window presented, select the Enable button which allows analytics for the application. When closing the window, the wrench on the statMobi icon within the Services Administration Tools section should go from red to green.

Add calls to statMobi to your application

Once you have chosen to record analytics from your application, the next step is to think through what data points to collect. Every statMobi enabled application will record the following data points automatically:

The power of statMobi lies in being able to track any sort of data point in your application that you might want, though. A good way start adding custom data points is to create a single function to call that will serve as a clearinghouse for all your analytics requests. Here is some example code you might call to save analytics data. This sample function records an event ID, as well as an optional set of name/value pairs as a query string to the statMobi Analytics logs.


/* ANALYTICS EXAMPLE CODE */
//this function sends an event ID, to statMobi analytics
//as well as an optional set of name/value pairs as a query string
function addAnalyticsDataPoint(eventID,queryString)
{
	try
	{
		if (queryString==null) { queryString = ""; }
		AppMobi.analytics.logPageEvent("/application/"+eventID+".event", queryString,"","",0,"index.html");
		//view the sampled results of your analytics from the XDK
	}
	catch(e) {}
}

Drop this Javascript function into the <head> element of your application's index.html page and call it everywhere you want to record an analytics event. It takes two parameters. The first is an event identifier string and the second is an optional key/value query string parameter.

Test the statMobi calls in your application

Finally, test your application to make sure that the analytics are working. Run the application a few times in the XDK, and then access the text analytics file. The results of the analytics calls on the XDK are recorded in a text file on your computer's hard drive. Access the logs on the XDK by clicking the Analytics icon down the left-hand side of the XDK, selecting the XDK Emulator radio button (if it isn't already selected) and clicking the "logs" button.

Next, test your application on an actual device by either testing through Wi-Fi or using the "Test Anywhere" feature of the XDK. Data will be bundled and sent back to appHub once every 24 hour cycle. appHub is where you will ultimately find the analytics information for your application once it has been released.

Harvest live analytic data from appHub

appHub gives you access to analytics data from your application. Log files are compiled and posted every 24 hours, so you won't immediately see your test data. Get back into appHub the day after your test, select your application name and again select the statMobi icon from the App Development Tools section. On the statMobi Administration screen shown, select the DOWNLOAD LOGFILES option. These W3C-compliant log files are viewable in most analytics readers, including Urchin, Omniture and many others. After you save your statMobi WC3-compliant log files to your machine, they can be parsed in a spreadsheet program such as Excel or imported into and analytics logfile reader such as Urchin or Omniture.

Why should I use statMobi Analytics?

By using statMobi Analytics, you'll get easy access to information that will help you make your application better. Analytics gives you an accurate representation of what is working in your application and what isn't. If you plan on supporting your application using advertising, analytics can tell you which ad placements are the most effective. Since statMobi Analytics is hooked directly into the application, you'll get information to track just how often your users start your application and how long they use it. You can consider analytics to be a "frictionless" feedback loop. You can learn just what is the most appealing to your customers just by exploring the data about how they use your application. Coupled with with appMobi's Live Update features, statMobi Analytics allows you to use your early adopters of the application as your "focus group" to tighten up what your application offers.