GAnalytics dokuwiki plugin
As a means to display Google Analytics we have created the ganalytics plugin.
See available parameters for allowed options for <metrics>.
example











![]() |
---|
Download and Installation
Download and install the plugin using the Plugin Manager using the following URL. Refer to Plugins on how to install plugins manually.Changes
- 2009-05-04: Original version
Syntax
Basic statistics can be displayed like this:{{ganalytics>data:<metrics>}}
Parameters
A number of parameters can be set by appending them with / character to data parameter. Each parameter needs to be separated with a / character. Defaults for all parameters can be set in the config manager. Below is a list of all recognized parameters and allowed values:Parameter | Default | Required | Allowed Options | Description |
---|---|---|---|---|
data:<metrics> | - | Y | unique, pageviews, visitors,country, countrynewvisitors, browser, resolution, OS, referrers, searchwords, visitortype | Metrics which is displayed: unique: Displays a line chart with the unique visitors on your on a day-by-day basis. pageviews: Displays a line chart with the pageviews on your on a day-by-day basis. visitors: Displays a line chart with the non-unique visitors on your on a day-by-day basis. country: Displays a map chart with the location of your visitors for the selected range. countrynewvisitors: Displays a map chart with the location of new visitors to your site for the selected range. browser: Displays a pie chart with the browser used by your visitors for the selected range. resolution: Displays a pie chart with the screen resolution used by your visitors for the selected range. OS: Displays a pie chart with the operating system used by your visitors for the selected range. referrers: Displays a pie chart with the referrers used by your visitors for the selected range. searchwords: Displays a pie chart with the search engine keywords used by your visitors for the selected range. visitortype: Displays a pie chart with vistor type for your visitors for the selected range (new visitor or returning visitor). |
linecolor:<linecolor> | 000000 | N | <hex color>[[, hex color], …] | This parameter has different meanings for different charts: Line chart: Color of the line, last value is repeated if there are more lines then colors Pie chart: Color of the pie, colors are interpolated if there are more slices then colors Map chart: Color of country's, first color is for country's which are not in the dataset, the other colors are interpolated |
bgcolor:<bgcolor> | FFFFFF | N | <hex color> | Background color of the line and pie chart. Color of the water on map charts |
size:<size> | 200×200 | N | <integer>x<integer> | Size of the chart. Best is to make the at least twice as wide as height. |
history:<history> | 0 | N | <integer> | Selects how many previous months are included in the statistics. Example: setting it to 1 makes a pie chart display statistics of this month and the previous month |
now:<now> | - | N | <hex color> | Shows a marker on line charts at the current date in color <now> |
continent:<continent> | world | N | world, africa, asia, europe, middle_east, south_america, usa | Selects which area is displayed by the map chart |
title:<title> | - | N | <string> | Displays title above chart (not allowed for map charts) |
example
{{ganalytics>data:<metrics>[/linecolor:<linecolor>][/bgcolor:<bgcolor>][/size:<size>][/history:<history>][/now:<now>][/continent:<continent>][/title:<title>]}} {{ganalytics>data:unique/linecolor:007B9F,55A7BF,AAD3DF/size:550x220/history:2/now:FF0000}} {{ganalytics>data:countrynewvisitors/continent:world/size:440x220/linecolor:FFFFFF,FFFFFF,019E18/bgcolor:EAF7FE/history:5}}
Additional setting
There are a few additional settings in the Configuration Manager:Setting | Description |
---|---|
Google Analytics username | Google analytics username (email) |
Google Analytics password | Google analytics password |
Google Analytics profile ID | Google analytics profile ID (example ga:12345) |
Show browser version | When selected, the data:browser option shows the browser version. Example Firefox or Firefox 3. |
Show OS version | When selected, the data:osoption shows the OS version. Example Windows or Windows XP. |
Maximum slices for pie chart | The maximum number of slices in a pie chart. The remaining slices are combine as '(other)'. |
Show slice size | When selected, a pie chart shows the size of each slice. Example Windows or Windows (80%) |
Show referral path | When selected, the data:referrs shows the domain and referral path. Example example.com or example.com/dir/. |
3D pie chart | When selected, pie charts are shown in 3D. |
Use simple encoding (only for charts smaller then 300px) | When selected, all data is encoded. This limits both URL size and resolution. |
Adding metrics
Metrics are added in the following meaner:- Have a look at the Google Analytics Data Export API
- Add a new function at the bottom of analytics.class.php
- Add the new metric parameter in the handle-function. Adding it to the list of unique for a line chart, to country for a map chart or to browser for a pie chart.
- Add the new metric parameter in the render-function. Same as above.
- Add the new metric parameter in the PieChartGetData-function, MapChartGetData-function or LineChartGetData-function
- Done
Demo Installation
Unique visitors
{{ganalytics>data:unique/linecolor:007B9F,55A7BF,AAD3DF/size:550x220/history:2/now:FF0000/title:Unique visitors}}
Total visitors
{{ganalytics>data:visitors/linecolor:ED1C24,F68D91/size:550x220/history:1/now:0000FF/title:Total visitors}}
Total pageviews
{{ganalytics>data:pageviews/linecolor:FFC004,FFD558,FFEAAC/size:550x220/history:2/now:FF0000/title:Pageviews}}
Used browsers
{{ganalytics>data:browser/size:550x220/linecolor:22B14C/history:2/title:Browsers}}
Used screen resolution
{{ganalytics>data:resolution/size:550x220/linecolor:ED1C24/history:2/title:Screen resolution}}
Used operating system
{{ganalytics>data:OS/size:550x220/linecolor:007B9F/history:2/title:Operating system}}
Used keywords
{{ganalytics>data:searchwords/size:550x220/linecolor:22B14C/history:2/title:Searchwords}}
Referrers
{{ganalytics>data:referrers/size:550x220/linecolor:ED1C24/history:1//title:Referrers}}
Visitor type
{{ganalytics>data:visitortype/size:550x220/linecolor:22B14C,ED1C24/history:1/title:Visitor type}}
Visitor location
{{ganalytics>data:country/continent:world/size:440x220/linecolor:FFFFFF,FFFFFF,019E18/bgcolor:EAF7FE/history:5}}
Discussion
Ask your questions at the official dokuwiki page. 01-'10 Stereo Vision Experiment
01-'10 Blog statistieken
Comments
Ziet er nice uit hoor 

Title looks like something thats messed up completely but it correct indeed 
Nice one !

Nice one !
Kleine vertaalfout: Google Analytics profiel ID > Google Analytics profile ID
I got the same reaction from other dokuwiki users, when I posted the plugin at the official dokuwiki plugin page.Title looks like something thats messed up completely but it correct indeed
Nice one !
fixedKleine vertaalfout: Google Analytics profiel ID > Google Analytics profile ID

I'm really interested in this plugin but the link doesn't seem to work anymore. Would there be an alternative place to download it ?
Where can the plugin be downloaded???? Please
I would like to know where can I get this plugin. That's exactly what I was looking for, and I can't seem to find alternatives anywhere.
Great post. I was checking coouunintsly this blog and I'm impressed! Very useful info specifically the last part I care for such information a lot. I was looking for this particular information for a very long time. Thank you and best of luck.
Comments are closed