devices are displayed wrong

Nov 28, 2013 at 9:30 AM
Hello, I use Google Analytics SDK with a Windows phone 8 application, but
many devices in google analytic page are seen as Lumia 1020, but it is not true, I have a 820 and it has never seen..

Thank you
Jan 3, 2014 at 7:35 AM
Im also seeing lots of 1020 for one of my games
Mar 23, 2014 at 9:07 PM
Not sure, but I think this is more a problem caused by Google Analytics itself, isn't it Tim?
Coordinator
Mar 23, 2014 at 10:20 PM
There are a few challenges here.

First, some background: GA determines the device by looking at the user-agent. If you open whatsmyuseragent.com on your device, you'll see that IE for WP sends something like this:
2.Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 920).
"NOKIA; Lumia 920" is the important part here and what GA uses to identify the device.

The first challenge is that WP does not automatically include a user-agent header with a web request. This means that the SDK needs to construct one itself (which it does).
The second challenge is that WP doesn't offer a way to programmatically retrieve the same strings that IE uses in it's user-agent. The closest thing available is:
Microsoft.Phone.Info.DeviceStatus.DeviceManufacturer and
Microsoft.Phone.Info.DeviceStatus.DeviceName
(which is what we use today but it also causes the issue where some devices are misrecognized)
the last challenge is that Google needs to make sure that it updates it's service to ensure that newer devices are recognized. Here we're at Google's mercy.

However, if you can find a way to get the device name and wanted to supply your own user-agent, the latest version now offers a way to do this via:
GoogleAnalytics.Core.GAServiceManager.Current.UserAgent = "set a custom user agent";
If you wanted to use this approach, here's a great open source project that you can use to cross reference the device info WP provides with a name that probably more closely resembles what GA expects. I haven't tried it personally but I think it would help to construct your own user-agent and see better results on GA.