androidgoogle-analyticstitaniumappceleratorappcelerator-mobile

Track App Version in Google Analytics


I am using Google Analytics module( https://marketplace.appcelerator.com/apps/5081?2014113336 ) in my Titanium App.

1). Is there any way to track my app version to Google Analytics. In that module documentation no information regarding this.

2). How can I test Google Analytics in my app? After integrating GA, I didn't see any data on my GA account. (even realtime data also empty https://www.google.com/analytics/web/#realtime )

3). When creating new Account in Google Analytics, which one should I choose WebSite or App ( http://screencast.com/t/gE0nPfxKsD7 )?(What is the difference between both)

Thanks


Solution

  • 1) You can send your app's version together with the tracking or on an event, for example:

        PackageManager manager = this.getPackageManager();
        try {
            PackageInfo info = manager.getPackageInfo(this.getPackageName(), 0);
            trackPage("/SomethingUseful/" + info.versionName);
        } catch (NameNotFoundException e) {
            // Log.e(TAG, "exception / namenotfound");
        }
    

    2) If you have done everything corretly, it should start appearing after a few minutes

    3) App