|
| 1 | + |
| 2 | +Module: Piwik - Web analytics |
| 3 | +Author: Alexander Hass <http://www.hass.de/> |
| 4 | + |
| 5 | + |
| 6 | +Description |
| 7 | +=========== |
| 8 | +Adds the Piwik tracking system to your website. |
| 9 | + |
| 10 | +Requirements |
| 11 | +============ |
| 12 | + |
| 13 | +* Piwik installation |
| 14 | +* Piwik website account |
| 15 | + |
| 16 | + |
| 17 | +Installation |
| 18 | +============ |
| 19 | +* Copy the 'piwik' module directory in to your Drupal |
| 20 | +sites/all/modules directory as usual. |
| 21 | + |
| 22 | + |
| 23 | +Usage |
| 24 | +===== |
| 25 | +In the settings page enter your Piwik website ID. |
| 26 | + |
| 27 | +You will also need to define what user roles should be tracked. |
| 28 | +Simply tick the roles you would like to monitor. |
| 29 | + |
| 30 | +All pages will now have the required JavaScript added to the |
| 31 | +HTML footer can confirm this by viewing the page source from |
| 32 | +your browser. |
| 33 | + |
| 34 | + |
| 35 | +Custom variables |
| 36 | +================= |
| 37 | +One example for custom variables tracking is the "User roles" tracking. Enter |
| 38 | +the below configuration data into the custom variables settings form under |
| 39 | +admin/config/system/piwik. |
| 40 | + |
| 41 | +Slot: 1 |
| 42 | +Name: User roles |
| 43 | +Value: [current-user:piwik-role-names] |
| 44 | +Scope: Visitor |
| 45 | + |
| 46 | +Slot: 1 |
| 47 | +Name: User ids |
| 48 | +Value: [current-user:piwik-role-ids] |
| 49 | +Scope: Visitor |
| 50 | + |
| 51 | +More details about custom variables can be found in the Piwik API documentation at |
| 52 | +http://piwik.org/docs/javascript-tracking/#toc-custom-variables. |
| 53 | + |
| 54 | + |
| 55 | +Advanced Settings |
| 56 | +================= |
| 57 | +You can include additional JavaScript snippets in the advanced |
| 58 | +textarea. These can be found on various blog posts, or on the |
| 59 | +official Piwik pages. Support is not provided for any customisations |
| 60 | +you include. |
| 61 | + |
| 62 | +To speed up page loading you may also cache the piwik.js |
| 63 | +file locally. You need to make sure the site file system is in public |
| 64 | +download mode. |
| 65 | + |
| 66 | + |
| 67 | +Known issues |
| 68 | +============ |
| 69 | +Drupal requirements (http://drupal.org/requirements) tell you to configure |
| 70 | +PHP with "session.save_handler = user", but your Piwik installation may |
| 71 | +not work with this configuration and gives you a server error 500. |
| 72 | + |
| 73 | +1. You are able to workaround with the PHP default in your php.ini: |
| 74 | + |
| 75 | + [Session] |
| 76 | + session.save_handler = files |
| 77 | + |
| 78 | +2. With Apache you may overwrite the PHP setting for the Piwik directory only. |
| 79 | + If Piwik is installed in /piwik you are able to create a .htaccess file in |
| 80 | + this directory with the below code: |
| 81 | + |
| 82 | + # PHP 4, Apache 1. |
| 83 | + <IfModule mod_php4.c> |
| 84 | + php_value session.save_handler files |
| 85 | + </IfModule> |
| 86 | + |
| 87 | + # PHP 4, Apache 2. |
| 88 | + <IfModule sapi_apache2.c> |
| 89 | + php_value session.save_handler files |
| 90 | + </IfModule> |
| 91 | + |
| 92 | + # PHP 5, Apache 1 and 2. |
| 93 | + <IfModule mod_php5.c> |
| 94 | + php_value session.save_handler files |
| 95 | + </IfModule> |
0 commit comments