Search code examples
google-analyticsgoogle-tag-manageruniversal-analytics

Android devices being categorized as desktop


We've been receiving loads of new access to our landing page through an app and almost all users are using Android (possible to verify by looking at Public > Technology > Browsers & OS). I've tested the app and the page is loaded using the device's browser in-app.

However device category is being interpreted as desktop for every Android user that access it that way. Therefore on the "Real Time" tab it shows that more than 80% of visitors are coming from desktop which can confuse a lot of people including our clients. Real time report Public browser and device report

Is there a way to either

  1. Tell Analytics that all Android devices should be considered mobile?
  2. Edit real time report to show browser and not device category, as it's showing correctly?
  3. Is there something I can do in my viewport meta tag to help this? It's currently <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">

Thank you!


Solution

  • What is happening here is most likely due to a UserAgent string being set to null (or empty string) in the android source code for the WebView element.

    In the abscence of a user-agent string, analytics would still detect the browser because WebView (Android version 4 and above) always attempt to modify the user-agent to notify servers that the request is coming from a WebView browser. But Google will not detect the device because the UserAgent was null or empty and the only thing that Google Analytics server can read off the user-agent string is that the browser is an Android browser.

    Google Analytics will default to desktop if it cannot detect the device off the UserAgent.

    Possible Solution:

    Ask your developer to set the UserAgent of the WebView to Android's default (He will understand this).