Posts Tagged ‘Google’

How to add Google Analytics code to Simple Machines Forum

Tuesday, February 17th, 2009

This is a EZ fix! All you need to do is put a backslash (\) before any apostrophe’s (‘) in the google analytics code.

goog
Here is the Google Analytics Code from google.
<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">
try {
var pageTracker = _gat._getTracker("UA-999999");
pageTracker._trackPageview();
} catch(err) {}</script>

Here is the new code after the fix.
<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”>
try {
var pageTracker = _gat._getTracker(“UA-99999″);
pageTracker._trackPageview();
} catch(err) {}</script>

Computer Help - ECH Revver Page - ECH MetaCafe Channel - ECH YouTube Page 47 queries in 0.643 seconds.