r4 - 22 Jan 2008 - 12:29:50 - OlivierBergerYou are here: TWiki >  Support Web > UsingGoogleAnalytics
Tags:
pattern_skin 1 Add my vote for this tag, , create new tag

Question

Hello all,

Which is the best way to add google analytics tag to my TWiki? I've to edit by hand every template files?

Environment

TWiki version: TWikiRelease04x00x02
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS:  
Web server:  
Perl version:  
Client OS:  
Web Browser:  
Categories: Plugins, Add-Ons, Skin
-- StefanoCislaghi - 06 Jun 2006

Answer

For PatterSkin: create a new 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

 
Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r4 < r3 < r2 < r1 | More topic actions
 
Powered by TWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback SourceForge.net Logo