title: How can I differentiate Android Chrome Browser and In-App WebView user agents?
body: <p>I am currently working on an Android App that uses WebViews to load some pages (I cannot modify the HTML, because it is being used by the iOS App and the website).
  First we had the problem, that the user agent was the same for the InApp WebViews and a regular Android Browser (starting with Android 4.4 which started using chromium as the webengine).</p>
  
  <p>InApp Webview Example: </p>
  
  <blockquote>
    <p>Mozilla/5.0 (Linux; Android 5.1.1; Nexus 5 Build/LMY48M; wv)
    AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0
    Chrome/44.0.2403.117 Mobile Safari/537.36</p>
  </blockquote>
  
  <p>So in Google Analytics we could not differentiate between users using the App and users visiting the HTML page with the normal browser.
  The solution was to alter the Useragent String with:</p>
  
  <pre><code>webView.getSettings().setUserAgentString("Our custom Mobile Android InApp Browser");
  </code></pre>
  
  <p>This worked for Google Analytics.</p>
  
  <p>But now we ran into the problem that Youtube is not identifying InApp users as mobile users and is serving the desktop Youtube player.</p>
  
  <p>Now I am looking for one of the following solutions:</p>
  
  <p>1) Somehow make Google Analytics identify the In-App-Browser as different from the normal Android Browser.</p>
  
  <p>or</p>
  
  <p>2) Have some custom String for the webview-user-agent that causes Youtube to serve its mobile version.</p>
  
  <p>Thanks!</p>