Search code examples
javascriptandroidanalytics

Setting up Android application for Analytics and tracking


Tracking events and setting up Analytics for Websites seems easy. You create an account with one of the Analytics service providers like Google. They give you javascript code that you embed in your pages (whichever event you wish to track) and voila..you're done.

I have written a native application for Android phones, which is actually an adaptation of the actual web site. Now, I am required to setup Analytics and tracking for this native application.

Question:

  1. How to do setup a native application for Analytics?

  2. We have Java Script code(not Google Analytics but for some other engine) that works for the original web site. Is there a way to incorporate that in the native application?

  3. I know Android supports Java Script via WebViews(Webkit);my application does not have webviews, it is native!

I have not worked on JavaScript since school so excuse me if I sound naive.

Thanks.


Solution

  • Google Analytics provide a guide for implementation on a mobile device. Refer to http://code.google.com/apis/analytics/docs/tracking/mobileAppsTracking.html

    To get started have a look at this guide from google.