Font size:
Apache Forrest Notes
Integration of Google Analytics
Google Analytics is a tool to analyze website traffic, visitors, keyword usage etc. . In order enable Google to collect statistical data for your site a small chunk of JavaScript code has to be inserted into every page to track. Thanks to the templating system of Apache Forrest this is easy to achieve.
1. Generate Google Analytics-Code
Log into your Google account and generate the Analytics code. It will look something like this:
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "XX-XXXXXX-X"; urchinTracker(); </script>
2. Insert Google Analytics-Code into Forrest Stylesheet
Insert the code above into {FORREST_HOME}\main\webapp\skins\pelt\xslt\html\site2xhtml.xsl right before the closing body tag:
...
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "XX-XXXXXX-X";
urchinTracker();
</script>
</body>
</html>
</xsl:template>
...

