Bill.D
Active member
Hey all,
I have a Xenforo install on a subdomain andI am trying to track the main site and the subdomain. I found online how to alter the analytics code to do it but it doesn't quite match what I am seeing in the Google_Analytics Template:
This seems to bee the traditional insert and not they asynchronous versions. So here is the code I found for the tradition which seem similar:
The part from the middle down seems like what I need to add the the part above does quite match. SO I guess my question is: Can I just add that bottom Part? Or is there another way completely to do this?
Thanks,
-Bill
I have a Xenforo install on a subdomain andI am trying to track the main site and the subdomain. I found online how to alter the analytics code to do it but it doesn't quite match what I am seeing in the Google_Analytics Template:
Code:
<xen:if is="{$xenOptions.googleAnalyticsWebPropertyId}"><script>
var _gaq = [['_setAccount', '{$xenOptions.googleAnalyticsWebPropertyId}'], ['_trackPageview']];
!function(d, t)
{
var g = d.createElement(t),
s = d.getElementsByTagName(t)[0];
g.async = true;
g.src = ('https:' == d.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
s.parentNode.insertBefore(g, s);
}
(document, 'script');
</script><xen:comment><!--Adapted from http://mathiasbynens.be/notes/async-analytics-snippet--></xen:comment></xen:if>
Code:
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<!--- The part below seems like the bit I need to add to the template -->
<script type="text/javascript">
try{
var pageTracker = _gat._getTracker("UA-4XXXXX-XXX");
pageTracker._setDomainName("bonusfeber.no");
pageTracker._trackPageview();
} catch(err) {}
</script>
Thanks,
-Bill