Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Analytics Android SDK: Tracking My App Version & Device Model Name

I'd like to be able to track the Version number of my application using Google Analytics Android SDK, and the Device Model name for people connecting to my application; What is the best way of achieving this?

I'm assuming that I might be able to do something like:

Device Model Name:

tracker.trackPageView("/testApplicationHomeScreen/"+Build.MODEL);

Version Number:

tracker.trackPageView("/testApplicationHomeScreen/"+packageInfo.versionName);

Will this work, and is this the best way of achieving this, or should I be using Events?

like image 897
James Avatar asked Sep 22 '10 04:09

James


1 Answers

This is a bit late, but with the addition of Custom Variables to the sdk, you can "tag" your pageviews/events with metadata like "version" and Model". A couple of links for easy reference:

Android Blog Post - Analytics For Android Apps

Google Analytics For Mobile - Using Custom Variables

This has the added advantage of letting you look at segments of your traffic, filtered by that metadata- For instance, you can look at all the pageviews/events which occurred on V2.1 of your software, instead of manually tracking down all the pageview URL's that end in /v2.1.

This was added after your original question was asked (months later, in fact) so you'll have to download an updated version of the sdk.

like image 162
Alexander Lucas Avatar answered Sep 23 '22 10:09

Alexander Lucas