title: Google Analytics - Tracking multiple websites (top-level domains)
body: <p>I have 10 top-level domains e.g. example1.com, example2.com, example3.com, etc, and each domain has its own, unique website (not redirects). My goal is to have one Google Analytics account and one web property for all 10 websites, a master profile (the default) that shows me metrics of all websites combined, and 10 individual profiles for each website to limit the view to just that website... as if it had its own Google Analytics account. After much research and reading, I think I determined that all I would need to do is add the following code to each website:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-XXXXXXXX']);
  _gaq.push(['_setDomainName', 'example1.com']);
  _gaq.push(['_trackPageview']);
  
  (function() {
      var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
      ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
      var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
  
  &lt;/script&gt;
  </code></pre>
  
  <p>Where the only thing that would change on each website would be the <code>_setDomainName</code> to match whatever the website's address is e.g. example2.com, example3.com, etc.</p>
  
  <p>Also, one website is actually at a sub-domain of a top-level domain (anothersite.example4.com), so I'm guessing I'd put exactly that in the <code>_setDomainName</code> variable in that instance (regardless of whether it's a top-level domain or sub-domain.</p>
  
  <p>Can someone confirm that I interpreted this correctly? Am I missing anything and is this a good way to set that up if I own all 10 web properties and want to later create an account for each website administrator to view metrics for their website only?</p>