Question

Is it possible to track all visit of all sites in one google account?

Sometimes I want to know how many ppl are in my server at one time, so I can control the traffic, etc...

I couldn't found any solution for this on the web.

Was it helpful?

Solution

This is indeed possible, depending on methodology.

You could create a so called roll-up account which aggregates all data into one Analytics property.

To do this, you'd set it up in a way like this (for the Classical Analytics):

_gaq.push(['_setAccount', 'UA-XXXXXXX-1']);
_gaq.push(['_setDomainName', 'domainname.com']);
_gaq.push(['_trackPageview']);

Second tracker would go directly underneath the original code.

_gaq.push(['t2._setAccount', 'UA-XXXXXXX-2']);
_gaq.push(['t2._setDomainName', 'domainname2.com']);
_gaq.push(['t2._trackPageview']);

The second tracker, called t2 in the above example, is your roll-up account and should be placed along with your other Google Analytics accounts. A full example would look like this:

<script type="text/javascript">
_gaq.push(['_setAccount', 'UA-XXXXXXX-1']);
_gaq.push(['_setDomainName', 'domainname.com']);
_gaq.push(['_trackPageview']);
_gaq.push(['t2._setAccount', 'UA-XXXXXXX-2']);
_gaq.push(['t2._setDomainName', 'domainname2.com']);
_gaq.push(['t2._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>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top