Search code examples
javascriptcordovagoogle-analyticsanalyticsflurry

Analytics for cross platform JavaScript based mobile app


Possible Duplicate:
How to use Google Analytics with Phonegap without a plugin?

I want to use something like Phonegap to write an app for Android, iOS and Blackberry, as well as generate free analytics data such as session length and how often buttons are pressed. I'd like to be able to do all this in JavaScript if possible but I cannot find any analytics provider that allows this.

The only option I can see is to use Flurry which supports all those OSs. This would require some native code for each platform and a way to call this code from JavaScript. I'd rather avoid having to write native code if possible.

I tried using the web version of Google Analytics (e.g. adding JavaScript snippets to my app code) but this produces the logging error

http://www.google-analytics.com/u/ga_debug.js: Line 18 : Local file. Aborting hit.

which I assume means Google Analytics only works on actual web pages. Google Analytics for apps isn't available for Blackberry either.


Solution

  • You can integrate your apps with Flurry HTML 5 SDK. This way you can write HTML 5 apps using JavaScript. Once done, you can port it to the native platform. Please note that Flurry HTML 5 SDK is currently in beta, and can be enabled for you once you register on Flurry. (Full disclosure: I work in the Support team at Flurry)