I’m setting up google analytis on my webpage using the standard script:
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXX-X']);
_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>
If I include this site on my UAT page (e.g. http://uatsite.com/) will google track any activity or will it only track activity on my main site (e.g. http://production-site.com).
thxs
The domain (or, as GA likes to call it, hostname) from which Google Analytics receives its info doesn’t matter and really it’s up to the client to define it (and is very much exploited, see this for just one example).
If you don’t want to track activity on your UAT site, you can create a
Hostnamefilter to prevent the data from being recorded. This filter can be of include type so that only your production site registers or exclude type so it excludes only your UAT site.Alternatively, you can modify your analytics code to not track on the UAT site: