PluginGoogleAnalytics » History » Version 7
Artem Naluzhnyy, 2010-04-20 19:35
add "Hints and Tips" section
| 1 | 1 | Eric Davis | h1. Google Analytics Plugin |
|---|---|---|---|
| 2 | |||
| 3 | A plugin to insert the Google Analytics tracking code into Redmine based on user roles. |
||
| 4 | |||
| 5 | h2. Features |
||
| 6 | |||
| 7 | Adds your Google Analytics code to every pageview depending on your User roles; Anonymous user, Authenticated User, and Administrator. |
||
| 8 | |||
| 9 | h2. Screenshot: |
||
| 10 | |||
| 11 | 2 | Eric Davis | !google_analytics_plugin_thumb.png!:/attachments/995/google_analytics_plugin.png |
| 12 | 1 | Eric Davis | |
| 13 | h2. Installation and Setup |
||
| 14 | |||
| 15 | |||
| 16 | # Download the plugin. There are three supported ways: |
||
| 17 | 3 | Eric Davis | #* Downloading the latest archive file from "Little Stream Software projects":https://projects.littlestreamsoftware.com/projects/list_files/redmine-analytics |
| 18 | 1 | Eric Davis | #* Checkout the source from Git |
| 19 | @git clone git://github.com/edavis10/redmine-google-analytics-plugin.git vendor/plugins/google_analytics_plugin@ |
||
| 20 | #* Install it using Rail's plugin installer |
||
| 21 | @script/plugin install git://github.com/edavis10/redmine-google-analytics-plugin.git@ |
||
| 22 | # Login to your Redmine install as an Administrator. |
||
| 23 | 5 | Jean-Philippe Lang | # Configure your settings in Administration > Plugins > Configure |
| 24 | 1 | Eric Davis | |
| 25 | |||
| 26 | h2. News |
||
| 27 | 4 | Eric Davis | |
| 28 | "0.1.0 Release Announcement":http://theadmin.org/articles/2008/10/1/redmine-google-analytics-plugin |
||
| 29 | 6 | Eric Davis | "0.2.0 Release Announcement":https://projects.littlestreamsoftware.com/news/49 |
| 30 | 7 | Artem Naluzhnyy | |
| 31 | h2. Hints and Tips |
||
| 32 | |||
| 33 | h3. Tracking Logged In Users |
||
| 34 | |||
| 35 | 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. |
||
| 36 | |||
| 37 | * "traditional code":http://code.google.com/apis/analytics/docs/tracking/gaTrackingOverview.html#standardSetup:<pre> |
||
| 38 | ... |
||
| 39 | pageTracker._setCustomVar(1, 'Login', document.getElementById('loggedas') != null |
||
| 40 | ? document.getElementById('loggedas').childNodes[1].textContent : '(anonymous)', 1); |
||
| 41 | pageTracker._trackPageview(); |
||
| 42 | ... |
||
| 43 | </pre> |
||
| 44 | |||
| 45 | * "asynchronous code":http://code.google.com/apis/analytics/docs/tracking/asyncTracking.html: <pre> |
||
| 46 | ... |
||
| 47 | _gaq.push(['_setCustomVar', 1, 'Login', document.getElementById('loggedas') != null |
||
| 48 | ? document.getElementById('loggedas').childNodes[1].textContent : '(anonymous)', 1]); |
||
| 49 | _gaq.push(['_trackPageview']); |
||
| 50 | ... |
||
| 51 | </pre> |
||
| 52 | |||
| 53 | Results will be available in "Visitors" -> "Custom Variables" -> "Login" report. |
||
| 54 | |||
| 55 | h3. Tracking Redmine Search Queries |
||
| 56 | |||
| 57 | Follow appropriate "Google Analytics Guide":http://www.google.com/support/analytics/bin/answer.py?hl=en&answer=75817 and use "q" (without quotes) as "Query Parameter". Results will be available in "Content" -> "Site Search" reports. |