Google provided an updated script to call the new javascript ga.js
to enable to track usage of html pages with Google Analytics.
<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-xxxx-xx");
pageTracker._initData();
pageTracker._trackPageview();
</script>
I injected above code in to the template of this blog and everyting is now working fine. If you want to try it, Andy wrote an how to.
Cast for two
Showing posts with label analytics. Show all posts
Showing posts with label analytics. Show all posts
Thursday, December 20, 2007
Updated Analytics script ga.js works with Google blogger
Posted by
cast42
at
10:15 AM
0
comments
Friday, December 14, 2007
New Analytics script not accepted by Blogger
Google asks to update the Google Analytics script to:
<script type=”text/javascript”>
var gaJsHost = (("https:" == document.location.protocol) ? " https://ssl." : "http://www.");
document.write("\<script src='" + gaJsHost + " google-analytics.com/ga.js' type='text/javascript'>\<\/script>" );
var pageTracker = _gat._getTracker(“UA-xxxxxx-x”);
pageTracker._initData();
pageTracker._trackVisit();
</script>
When entering this in to the Blogger HTML template, I get an error:
Open quote is expected for attribute "{1}" associated with an element type "type".
If you don't need the secure http access, you can simplify the script to:
<script src='http://www.google-analytics.com/ga.js' type='text/javascript'>
</script>
<script type='text/javascript'>
var pageTracker = _gat._getTracker("UA-xxxxxxx-x"); pageTracker._initData(); pageTracker._trackPageview(); </script>
Please only use the above code if you urgently want to test the new script. It might be wise to wait until the Google engineers have ironed out this issue if you do not want to put your huge analytics income at risk ;-)
Posted by
cast42
at
2:17 PM
0
comments
Subscribe to:
Posts (Atom)