i have multidomain web site, but i'm not sure, if i'm tracking it in good way.
Primary domain: www.domain.com Domain aliases: www.domain.sk, www.domain.cz (each show content from .COM but in other languages)
I created in analytics new profile for multi domain web.
My tracking code:
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'ACCOUNT_ID']);
_gaq.push(['_setDomainName', 'domain.<? echo $url_localization; ?>']);
_gaq.push(['_setAllowLinker', true]);
_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);
})();
</script>
Is this right way? How can i filter visits in analytics by domains?
If you don't need track visitors across multiple domains (see documentation for that), I think the better solution would be creating more separate properties (within one GA account). You will need to change the UA-XXXXXX-X id number on each website, but you won't have to play around with filters and also, this would help avoid the volume limits (currently 10 million per property - not strictly applied by Google as of yet though).