Quote from: ncrossland at Mar 14, 2008, 11:21 AM
Quote from: bwente at Mar 06, 2008, 03:25 PM
Why would you do this instead of a chunk in your templates?
It has a few advantages
* it respects the "log visits" setting on ModX pages in the manager - e.g. if you untick the box for one page, it will not get the tracking code on it
* it also ignores visits when you are logged in to the manager (e.g. when QuickEditting)
* it is easy to turn off for debugging (just a tick box in the Manager, instead of commenting out code)
* it has some other interactive capabilities (like the ’alternative tracking URL’ functionality I recently added) which isn’t possible with chunks
But, if chunks suit, there’s nothing wrong with them!
After reading this thread I decided to try the plugin for GA instead of the chunk I have been using.
The script on my html pages is now:
<script src="http://www.google-analytics.com/ga.js" type="text/javascript"></script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-0000000-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
it was this:
<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>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-0000000-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
Is that correct?
Also, I see the script in this manner at the bottom of each HTML page, no matter if I am logged into manager or not. My plugin configuration is test mode "false" and version "new".
I am using the latest plugin. I replaced part of my tracking code above with 0’s for the example.