title: Google Analytics with wildcard domains + subdomains
body: <p>I want to have a single script in my shell/layout page that provides insight on whatever url is currently being used.  I have a multitenant app that has URLs like: </p>
  
  <ul>
  <li>app1.myapp.com</li>
  <li>custom.com</li>
  <li>myapp.com</li>
  </ul>
  
  <p>These all are different domains, but will be hitting the same application with the same page.  How can I use google analytics to report from "whatever the active URL is", instead of specifying URLs in the <code>&lt;script&gt;</code>?  I'm trying to avoid specifying domains because users of the app can map their own domains, so manual mapping will be unwieldy.  </p>
  
  <p>I have the following: </p>
  
  <pre><code>&lt;script&gt;
          (function (i, s, o, g, r, a, m) {
              i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {
                  (i[r].q = i[r].q || []).push(arguments)
              }, i[r].l = 1 * new Date(); a = s.createElement(o),
              m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)
          })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
  
          ga('create', 'SSSSSSSSS', 'mysite.com'); // something here?  I've tried document.URL
          ga('send', 'pageview');
  
  &lt;/script&gt;
  </code></pre>
  
  <p>But this only tracks requests made to the base domain (myapp.com, sub.myapp.com), not other domains (differentapp.com).  What changes do I need to make to get this working? </p>