title: Google Analytics not working in Webview in iOS app
body: <p>Let me first start out by saying I know how to use the iOS SDK so please don't answer this with a "just use the SDK." I want to know WHY google analytics is not working.</p>
  
  <p>Here's my setup. I have a web app that is also baked into an android app and ios app via webview. I'm using cordova. The android app works just fine with the GA JS code. The web works just fine. However no events or page views are showing up from iOS. I've heard that GA is tied to the domain so does an iOS Webview do something under the hood to the domain?</p>
  
  <p>I was going to attach my code snippet but it's coffeescript in a few classes so I'll just paste the compiled js</p>
  
  <pre><code>  Analytics.prototype.track = function(args) {
        window._gaq.push(args);
    };
    Analytics.track(['_trackEvent', 'SubscriptionModal', "Closed", data]);
  </code></pre>
  
  <p>This works fine in web and android so it's not a JS. I'm setting the GA _setDomainName to 'focusatwill.com' and can see that both ios and web have a domain of 'www.focusatwill.com'</p>
  
  <p>I've read online a few people talking about this issue and everyone says just use the SDK. I'm looking for the reason why it doesn't work. How do you fix it to use the JS? </p>
  
  <p><strong>edit</strong></p>
  
  <p>I should mention that the html and JS are not baked into the device, ie they don't have a local url but are served up from our webserver </p>