DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:ganalytics

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
plugin:ganalytics [2010-03-06 06:59] 219.144.133.11plugin:ganalytics [2019-08-16 16:37] – ​!discontinued tag Aleksandr
Line 11: Line 11:
 conflicts  conflicts 
 similar    :  similar    : 
-tags       : media, images, diagram, chart, google, statistics, embed+tags       : ​!discontinued, media, images, diagram, chart, google, statistics, embed
 ---- ----
 ===== Download and Installation ===== ===== Download and Installation =====
  
-Download and install the plugin using the [[plugin:plugin|Plugin Manager]] using the following URL. Refer to [[:Plugins]] on how to install plugins manually.+Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually
 + 
 +Google Analytics requires additional configuration for best use with DokuWiki (e.g., site search and goals). See [[http://en.seowiki.info/best_practices/seo_optimized_dokuwiki/integration/google_analytics|Google Analytics integration for DokuWiki]] for details.
  
 ^ Download | [[http://www.greenbird.info/_media/dokuwiki/ganalytics.zip|ganalytics.zip (20.8 Kb)]] |  ^ Download | [[http://www.greenbird.info/_media/dokuwiki/ganalytics.zip|ganalytics.zip (20.8 Kb)]] | 
Line 21: Line 23:
 FIXME (download link is broken) FIXME (download link is broken)
  
 +Blog entry: http://greenbird.tweakblogs.net/blog/3420/ganalytics-dokuwiki-plugin.html
 ==== Changes ==== ==== Changes ====
   * 2009-05-04: Original version   * 2009-05-04: Original version
Line 32: Line 35:
  
 ^ Parameter ^ Default ^ Required ^ Allowed Options ^ Description ^ ^ 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).  |+|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 visitor 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  | |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  | |bgcolor:<bgcolor>  |FFFFFF  |N  |<hex color>  |Background color of the line and pie chart. Color of the water on map charts  |
Line 107: Line 110:
 </code> </code>
  
- It also uses classes for connecting with the google analytics server, which also requires, and is supported by, PHP5 or up.+ It also uses classes for connecting with the Google analytics server, which also requires, and is supported by, PHP5 or up.
 >> >>
  
  
 >Just a question about howto get the param "Google Analytics profiel ID" >Just a question about howto get the param "Google Analytics profiel ID"
->> It is simply the ga:+"id"  param that appear when you navigate on analytics report :+>> It is simply the ga:+"id"  param that appear when you navigate on analytics report:
   https://www.google.com/analytics/reporting/?reset=1&id=13129515&pdr=20090406-20090506   https://www.google.com/analytics/reporting/?reset=1&id=13129515&pdr=20090406-20090506
   "Google Analytics profiel ID" = ga:13129515   "Google Analytics profiel ID" = ga:13129515
  
  
-THank you for this plugin , have a suggestion : could it be possible to display a list of the most visited pages ?+Thank you for this plugin, have a suggestion: could it be possible to display a list of the most visited pages?
  
-for instance :+for instance:
  
 $data = $api->data($id, 'ga:pageTitle,ga:pagePath', 'ga:pageviews',false, date('Y-m-d', strtotime('1 week ago')), false, 15); $data = $api->data($id, 'ga:pageTitle,ga:pagePath', 'ga:pageviews',false, date('Y-m-d', strtotime('1 week ago')), false, 15);
Line 125: Line 128:
 where "15" and "1 week" should be  implemented.  where "15" and "1 week" should be  implemented. 
  
->I have two sites, and I want to monitor them at the same time. So is it possible to make "Google Analytics profiel ID" one of the parameter in syntaxFor example, %%{{ganalytics>ID:12345}}%%+====Monitor two sites==== 
 +>I have two sites, and I want to monitor them at the same time. So it will be more useful to make "Google Analytics profile ID" one of the parameter in syntaxFor example, %%{{ganalytics>id:12345/data:<metrics>}}%%。I modified the syntax.php to achieve this. 
 + 
 +First, add the id parameter. That is, change: 
 +<code php> 
 +switch($parameter){  
 +    case 'data':  
 + $img['data'] = $value;    
 +</code> 
 +to 
 +<code php> 
 +switch($parameter){ 
 +    case 'id': 
 +         $img['id']=$value;  
 +    break;     
 +    case 'data':  
 + $img['data'] = $value;    
 +</code> 
 +Then, replace 
 +<code php> 
 +$oAnalytics->setProfileById($this->getconf('ganalytics_id')); 
 +</code> 
 +with 
 +<code php> 
 +if(array_key_exists('id', $img)){ 
 +    $oAnalytics->setProfileById("ga:".$data['id']); 
 +
 +else{ 
 +    $oAnalytics->setProfileById($this->getconf('ganalytics_id')); 
 +
 +</code>
plugin/ganalytics.txt · Last modified: 2019-08-16 16:39 by Aleksandr

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki