javascript.*.tmpl file in /templates, for instance javascript.analytics.tmpl.
In that file, write:
%TMPL:INCLUDE{"javascript.pattern"}%
%TMPL:DEF{"twikijavascript"}%<script type="text/javascript" src="%PUBURLPATH%/%TWIKIWEB%/TWikiJavascripts/twiki.js"></script>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
<script type="text/javascript">
// <![CDATA[
_uacct = "your-code";
urchinTracker();
// ]]>
</script>
%TMPL:END%
In your Main.TWikiPreferences (not TWiki.TWikiPreferences), set:
*Set SKIN = analytics,pattern
This is from the top of my head and untested. Let me know if you succeed.
-- ArthurClemens - 06 Jun 2006
That seems to work allright... although there is also a GoogleAnalyticsPlugin plugin, which more or less does the same thing.
-- OlivierBerger - 22 Jan 2008