jessica
02-18-2008, 04:17 AM
Hi,
Following is the tracking code that needs to be placed on the 404 error page, if you are using the new GA 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>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-xxxxx-x");
pageTracker._initData();
pageTracker._trackPageview("/404.html?page=" + document.location.pathname + document.location.search + "&from=" + document.referrer);
</script>
Can anyone explain this part of the analytics code?
var gaJsHost = (("https:" == document.location.protocol) ? " https://ssl ." : "http://www.");
Since, I am using this analytics code for my blog, just wanted to be sure that this code would serve the purpose.
Following is the tracking code that needs to be placed on the 404 error page, if you are using the new GA 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>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-xxxxx-x");
pageTracker._initData();
pageTracker._trackPageview("/404.html?page=" + document.location.pathname + document.location.search + "&from=" + document.referrer);
</script>
Can anyone explain this part of the analytics code?
var gaJsHost = (("https:" == document.location.protocol) ? " https://ssl ." : "http://www.");
Since, I am using this analytics code for my blog, just wanted to be sure that this code would serve the purpose.