Google Analytics Plugin

Adds Google Analytics javascript code to specified pages.

Since version 2.1, this plugin reads settings from configure. It no longer uses a specific template or skin.

You now have the control which pages to track:
  • for specific users
    • for instance, do not track your own visits
  • for specific webs
    • for instance, do not track visits to System and Trash web
  • for bin scripts
    • for instance, do not track login pages

If you are using a version of this plugin older than 2.1: if you don't change anything, the plugin will continue to work as it did:
  • The previous setting GOOGLESITEKEY will be used as long as the new setting {WebPropertyId} in configure is not set
  • The skin setting googleanalytics will be ignored

About Google Analytics

Google Analytics is a free statistics tool to track website visitors. While this service is especially meant to measure the effectiveness of AdWords, it can be used for any site.

Google presents visitor data in a visually rich dashboard:
Screenshot of Google Analytics application
view large image

Settings

After installation, configure this plugin by changing settings in configure.

Site ID

Google provides its users with a piece of html to copy-paste into pages. For this plugin you don't need that html, but the "Web Property ID" only. Enter this ID at {WebPropertyId}.

Tracking per web

Enable tracking with {Plugins}{GoogleAnalyticsPlugin}{Tracking}{Enable}{Webs}.
  • Enter * to track visits to topics in all webs (default value).
  • Enter specific web names to limit tracking to these webs only.

Disable tracking with {Plugins}{GoogleAnalyticsPlugin}{Tracking}{Disable}{Webs}.
  • Enter '' (nothing) to not disable tracking in any web (default value).
  • Enter specific web names to not track visits to these webs.

Tracking per user

Enable tracking with {Plugins}{GoogleAnalyticsPlugin}{Tracking}{Enable}{Users}.
  • Enter * to track visits by all users (default value).
  • Enter specific user (Wiki) names to limit tracking the visits by these users only.

Disable tracking with {Plugins}{GoogleAnalyticsPlugin}{Tracking}{Disable}{Users}.
  • Enter '' (nothing) to not disable tracking of any user (default value).
  • Enter specific user names to not track visits from these users.

Tracking per script

Enable tracking with {Plugins}{GoogleAnalyticsPlugin}{Tracking}{Enable}{Scripts}.
  • Enter * to track visits to topics from all scripts (default value).
  • Enter specific script names to limit tracking from these scripts only.

Plugin Installation Instructions

Note: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the TWiki server.

  • Download the ZIP file from the Plugin web (see below)
  • Unzip GoogleAnalyticsPlugin.zip in your root ($TWIKI_ROOT) directory. Content:
    File: Description:
    data/TWiki/GoogleAnalyticsPlugin.txt Documentation
    lib/TWiki/Plugins/GoogleAnalyticsPlugin.pm Perl code
    lib/TWiki/Plugins/GoogleAnalyticsPlugin/Config.spec Configuration
  • Visit configure in your TWiki installation, enable the plugin in the {Plugins} section, and configure the plugin in the {Extensions} section.

Plugin Info

  • Set SHORTDESCRIPTION = Adds Google Analytics Javascript code to specified pages

Authors: TWiki:Main.ArthurClemens
Copyright: © 2006, 2009 Arthur Clemens
© 2009 Will Norris
© 2006-2011 TWiki:TWiki/TWikiContributor
License: GPL (Gnu General Public License)
Version: 21272 (2011-05-14)
Release: 2011-05-14
Change History:  
2011-05-14: TWikibug:Item6701: Small fix in Config.spec -- TWiki:Main.PeterThoeny
27 Aug 2009 2.1 Arthur Clemens: Moved settings to configure. No longer uses a skin template. Tracking can be specified per web, user and script.
26 Feb 2009 2.0.1 converted to skin template, increased apparent page rendering speed (TWiki:Main.WillNorris)
25 Feb 2009 2.0.0 Ported to ga.js (TWiki:Main.WillNorris)
21 Sep 2006 1.0.0 First Version
TWiki Dependency: $TWiki::Plugins::VERSION 1.1
CPAN Dependencies: none
Other Dependencies: none
Perl Version: 5.005
Home: http://TWiki.org/cgi-bin/view/Plugins/GoogleAnalyticsPlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/GoogleAnalyticsPluginDev
Appraisal: http://TWiki.org/cgi-bin/view/Plugins/GoogleAnalyticsPluginAppraisal

Related Topics: TWikiPreferences, Main.TWikiPreferences
Topic revision: r0 - 15 May 2011, TWikiContributor
This site is powered by FoswikiCopyright © by the contributing authors. All material on this site is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback