I'm currently developing a Android game and would like to implement analytics. I see that both Flurry and Google Analytics offer the ability to track the users location. I've been playing around with Flurry and see that the users location is continent based (I guess unless I add the permission to access GPS, which user don't like). I was wondering if Google Analytics can give me a more precise user location without giving the permission to access the GPS?
-
well you can get a less accurate position by wifi or 3G . Look for how to acquire position by network not gps . – moujib May 22 '12 at 19:59
-
1@moujib, that won't work. NETWORK_PROVIDER requires either of the permissions android.permission.ACCESS_COARSE_LOCATION or android.permission.ACCESS_FINE_LOCATION. Even PASSIVE_PROVIDER requires android.permission.ACCESS_FINE_LOCATION. – Stephan Branczyk May 22 '12 at 20:27
-
Thank you for the correction , sorry if I was pointing toward a not correct solution . – moujib May 22 '12 at 20:45
2 Answers
Without GPS, the challenge with determining location on mobile is that it depends on how the device is connected. If the device is connected over the mobile network (3G, 4G), then network traffic will exit through some mobile operator gateway, and the source IP address will likely point to a very different and very wrong location for the actual user (which many analytics services incorrectly do). If the device is connected over WiFi, then the source IP address can be reliably used to identify the metro area location (at least as reliable as fixed broadband connections).
At Localytics (I work there), we first determine how devices are connected. If over a mobile network, then location is only reported to country level. But if it's connected over WiFi, then we'll report location down to region or metro area -- this gives you a better representative sample of where your users are.

- 178
- 4
-
Thanks! How is the data displayed? (This makes me wonder why Flurry Analytics only give continent based feedback even though I'm connected with wifi!). – Luke Taylor May 23 '12 at 20:09
If you just ping a Google Analytics-enabled web page/server, then yes you should at least be able to get an ip address location even if it misses the mark by 400 miles (as it does for me when I try it from my phone).
But there must be a good reason for pinging a web page, users don't generally like useless permissions or useless traffic. For instance in your case, you could implement a global scoreboard, either one that you made yourself, or one that you call through an open intent, or one that you added to your apk as a library like OpenFeint.
You could even ask the user to manually enter their location when they enter their username on the scoreboard, or better yet implement something like Facebook Connect for adding social features and for adding a social scoreboard.

- 9,363
- 2
- 33
- 49
-
I like this approach of letting the user enter his location . Is it possible to get a location by getting the carrier operator on phone devices ? – moujib May 22 '12 at 20:47
-
1That might work too. At least, it should give you a better answer than which continent it's in. http://stackoverflow.com/questions/3838602/how-to-find-out-carriers-name-in-android – Stephan Branczyk May 23 '12 at 00:57
-
IP address for mobile is only reliable at the country level. Most mobile traffic is routed through the same carrier gateways and as a result the bulk of all mobile traffic will appear to come from the same city. – henry May 23 '12 at 18:39