What would be the best way to set up Google Analytics to track multiple domains which actually are all one site?



mysite.es gets routed to mysite.com/es, URL is mysite.es mysite.es/contenidos/stuff gets routed to mysite.es/contents/stuff, URL is mysite.es/contenidos/stuff

I've already taken care of the technical side of this, but I'm just not sure about what's the best way to proceed with analytics. Any help would be much appreciated.

3 Answers 3


When you create your analytics profile for your site you can choose to track:-

  • A single domain
  • One domain with multiple subdomains
  • Multiple top level domains

Choose the most appropriate option for your URI structure and you're done.

enter image description here


It seems as though with the redirects in place you're not actually needing to track multiple domains, rather you're looking for a way to segment your single domain based on the sections that the additional domains are redirecting to (IE you want to segment your domain based on example.com vs example.com/es) assuming I am understanding properly it seems filters would be the easiest way. Simply create an additional profile for the site and filter out traffic to suit your needs.


I activated that one, and when I did the traffic seemed to be dropping... the current code I have (was not set up by me) and is:

<script type="text/javascript">
var _gaq = _gaq || [];
<% if Rails.env == "production" -%>
_gaq.push(['_setAccount', 'UA-xxxxxx26-1']);
_gaq.push(['_setDomainName', '.sitename.it']);

(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);
<% end -%>

and what i don't get is the .sitename.it

anybody knows?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.