Submitted by bwells on Fri, 03/04/2011 - 12:12
I am trying to update the GoogleAnalytics.pm file so that it can match the new format that google has pushed out. I have everything except one piece. I need to know how to populate the domainname field. I have tried to use dom, DOM, $DOM, and $virt. Every time I submit my change, the plugin brings down my webserver. I just need to know where this entry is. Thanks!
Status:
Closed (duplicate)
Comments
Submitted by JamieCameron on Fri, 03/04/2011 - 12:56 Comment #1
I wasn't aware the domain name was required in the javascript .. where is this documented?
Submitted by bwells on Fri, 03/04/2011 - 12:57 Comment #2
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '$account']);
_gaq.push(['_setDomainName', '.domain.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);
})();
</script>
Submitted by bwells on Fri, 03/04/2011 - 13:03 Comment #3
What you have is correct for single sites. Above is the code if you have multiple subdomains. Below is if you have several top level domains.
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '$account']);
_gaq.push(['_setDomainName', 'none']);
_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>
Submitted by JamieCameron on Fri, 03/04/2011 - 13:10 Comment #4
Let's move this discussion into the existing bug https://www.virtualmin.com/node/17151