README.txt 2.4 KB

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