This project has moved and is read-only. For the latest updates, please go here.

Recording OS version on Win 10 with WinJS app

Aug 14, 2015 at 10:30 AM
Thanks for this library, it has been a godsend.

We have a WinJS Universal app, created with VS Community 2013 and have been using your SDK version 1.2
After the release of Win 10 I started looking in the OS Version report in Google Analytics and noticed no traffic at all from Win 10. I know that there is some since I am testing on a Win 10 virtual machine and can see the screen views appear in the real time view.

All my traffic appears as Win 8.1. Do you know if there is anything that I can do in order to correctly identify users on Win 10?

I have tried updating to the new release a few minutes ago, but saw the same thing.

Aug 25, 2015 at 7:01 PM
Glad to hear you are enjoying the SDK!

The short answer is that you should update your app to target Win10 -- and be sure to update to v1.3 of the SDK which now supports Win10 UWP apps.
The longer answer is: GA uses the user agent to detect OS and the SDK hardcodes the user agent to mimic the user agent sent by IE for the version of Windows in which it targets. The SDK includes different versions for each platform: (Win8, Win81, WP81, Win10, ...etc) and each has its own hardcoded user agent. So, if your app targets Win8.1 and it is running on Win10, the user agent will still be the Win81 user agent.

Not: you could also manually override the default user agent through the static property: GAServiceManager.userAgent. If you can find a way to dynamically detect the OS in your app at runtime, you could conditionally supply a user-agent that GA would recognize as Win10 when running on Win10. I'm not sure if there's a good way to detect OS version at runtime however so you'd have to do some research here to see if this is possible.
Aug 27, 2015 at 4:58 PM
Thanks, am I right in thinking that if I update the app to target Win10 then it would no longer be compatible with 8.1? (and sorry if that is a dumb question).

I need to keep win 8 compatibility and can't afford to maintain two separate versions of the the app. I'll have a look into OS detection / feature detection.
Aug 27, 2015 at 5:37 PM
This is correct, if you port your app to target Win10, that version of the app will not run on Win8x machines (this is the same as how an app that targets Win8.1 will not run on Win8.0). Note: There are tricks to create 2 projects in Visual Studio that share the same code however (e.g. file linking) so you don't have to maintain 2 code bases.