Google Analytics Plugin

A plugin to insert the Google Analytics tracking code into Redmine based on user roles.


Adds your Google Analytics code to every pageview depending on your User roles; Anonymous user, Authenticated User, and Administrator.


0.1.0 version thumbnail

Installation and Setup

  1. Download the plugin. There are three supported ways:
    • Downloading the latest archive file from Little Stream Software projects
    • Checkout the source from Git
      git clone git:// vendor/plugins/google_analytics_plugin
    • Install it using Rail's plugin installer
      script/plugin install git://
  2. Login to your Redmine install as an Administrator.
  3. Configure your settings in Administration > Plugins > Configure


0.1.0 Release Announcement
0.2.0 Release Announcement

Hints and Tips

Tracking Logged In Users

You may add logged in user name using _setCustomVar call just before _trackPageview. Following Google Analytics code examples store user name in visitor-level slot #1 named 'Login'. They were tested on Redmine 0.9.3.

  • traditional code:
    pageTracker._setCustomVar(1, 'Login', document.getElementById('loggedas') != null
      ? document.getElementById('loggedas').childNodes[1].textContent : '(anonymous)', 1);
  • asynchronous code:
    _gaq.push(['_setCustomVar', 1, 'Login', document.getElementById('loggedas') != null
      ? document.getElementById('loggedas').childNodes[1].textContent : '(anonymous)', 1]);

Results will be available in "Visitors" -> "Custom Variables" -> "Login" report.

Tracking Redmine Search Queries

Follow appropriate Google Analytics Guide and use "q" (without quotes) as "Query Parameter". Results will be available in "Content" -> "Site Search" reports.

google_analytics_plugin.png - 0.1.0 version (40.9 KB) Eric Davis, 2008-10-01 05:08

google_analytics_plugin_thumb.png - 0.1.0 version thumbnail (24.4 KB) Eric Davis, 2008-10-01 05:09

ru.yml Magnifier - Russian language file (config/locales) (651 Bytes) Dmitriy Malyhin, 2010-05-25 17:10

ru.yml Magnifier - Russian strings go here (662 Bytes) Dmitriy Malyhin, 2010-05-25 17:10

fi.yml Magnifier - Finnish strings go here (508 Bytes) Niko Hallikainen, 2011-02-05 13:57

fi.yml Magnifier - Finnish language file (config/locales) (496 Bytes) Niko Hallikainen, 2011-02-05 13:59