Home
Getting Started
Solutions
AddThis Bookmark
Audio/Video
Bravenet Services
Custom Site
Forms: Allforms
Forms: Bravenet
Google Adsense
Google Analytics
Google Webmaster
Image Enlarging
Links in New Window
Redirect
Popup Generator
Site Search
Slideshow Generator
Webpage Translation
Tutorials
Tips
SE Optimization
Customizing OL
Help and How To
Downloads
Services
Office Live Video
Frequently Asked Question
Contact Us

How to Insert Google Analytics

Scroll Down for instructions on inserting the old urchin.js tracking code, it is recommend to use the new ga.js code though.

 

New Tracking Code (ga.js)
 

1. Sign-up for a Google account and for Analytics, http://google.com/analytics.

 

2.  Copy the code from Google Analytics, use the New Tracking Code (ga.js).
 
3.  Insert a Custom Footer module as close to the bottom of the page as possible.  This will depend on your layout, always paste in the last, in the last zone, for example if you have a 4 zone layout paste at the bottom of zone 4.
 
4.  Remove everything from the Custom Footer, and paste in the code below.
 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text" omit-xml-declaration="yes"/>
<xsl:template match="/">
<![CDATA[
 
]]>
</xsl:template>
</xsl:stylesheet>
 
5.  Paste in your Google Analytics code after the <![CDATA[ tag, like below.
 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text" omit-xml-declaration="yes"/>
<xsl:template match="/">
<![CDATA[
<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-00000-0");
pageTracker._trackPageview();
} catch(err) {}</script>

]]>
</xsl:template>
</xsl:stylesheet>

 
6. Go back go Google Analytics and verify, it takes a while to verify in some cases.

 

 

Legacy Tracking Code (urchin.js)
1. Sign-up for a Google account and for Analytics, http://google.com/analytics.

 

2.  Copy the code from Google Analytics, use the Legacy Tracking Code (urchin.js).
 
3.  Insert a Custom Footer module as close to the bottom of the page as possible.  This will depend on your layout, always paste in the last, in the last zone, for example if you have a 4 zone layout paste at the bottom of zone 4.
 
4.  Remove everything from the Custom Footer, and paste in the code below.
 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" />
<xsl:template match="/">
 
</xsl:template>
</xsl:stylesheet>
 
5.  Paste in the Google Analytics code after the <xsh:template> tag, like below.
 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" />
<xsl:template match="/">
<script src="
http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-00000-0";
urchinTracker();
</script>

</xsl:template>
</xsl:stylesheet>

 
6. Go back go Google Analytics and verify, it takes a while to verify in some cases.

Resources

Updated December 26, 2009



Links

 



Search Website