title: How to configure multiple domain on single Google Analytics account
body: <p>I'm upgrading old google analytics code (ga) to latest gtag implementations.</p>
  <p>in the old implementation we were using couple of site under one account using below command,</p>
  <pre><code>ga('create', '&lt;TrackingID&gt;', '&lt;DomainName&gt;');
  </code></pre>
  <p>but in the new implementation we are required to use</p>
  <pre><code>gtag('config', '&lt;TrackingID&gt;');
  </code></pre>
  <p>I managed to get google tracking working using the provided code by google, but I had to create two properties with different urls,</p>
  <p><a href="https://i.stack.imgur.com/DtNqY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DtNqY.png" alt="Site - 1" /></a></p>
  <p><a href="https://i.stack.imgur.com/bo7u3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bo7u3.png" alt="Site - 2" /></a></p>
  <p>Is there a way to record analytics from both sites under same property.</p>
  <p>Also in the old implementation we were able to push javascript function as below,</p>
  <pre><code>var _gaq = _gaq || [];
  _gaq.push(['_setAccount', '&lt;TrackingID&gt;', '&lt;Domain&gt;']);
  _gaq.push(['_trackPageview']);
  _gaq.push(function () {
      foo(1000);
  });
  </code></pre>
  <p>Is there a way to push function using &quot;gtag&quot;?</p>
  <p>Thanks</p>