Adds the Matomo tracking system to your website.
- Matomo installation
- Matomo website account
- Install this module using the official Backdrop CMS instructions at https://backdropcms.org/guide/modules
In the settings page enter your Matomo website ID.
You will also need to define what user roles should be tracked. Simply tick the roles you would like to monitor.
All pages will now have the required JavaScript added to the HTML footer can confirm this by viewing the page source from your browser.
One example for custom variables tracking is the "User roles" tracking. Enter the below configuration data into the custom variables settings form under admin/config/system/matomo.
Slot: 1 Name: User roles Value: [current-user:matomo-role-names] Scope: Visitor
Slot: 1 Name: User ids Value: [current-user:matomo-role-ids] Scope: Visitor
More details about custom variables can be found in the Matomo API documentation at https://matomo.org/docs/javascript-tracking/#toc-custom-variables.
You can include additional JavaScript snippets in the advanced textarea. These can be found on various blog posts, or on the official Matomo pages. Support is not provided for any customisations you include.
To speed up page loading you may also cache the matomo.js file locally. You need to make sure the site file system is in public download mode.
Drupal requirements (https://drupal.org/requirements) tell you to configure PHP with "session.save_handler = user", but your Matomo installation may not work with this configuration and gives you a server error 500.
-
You are able to workaround with the PHP default in your php.ini:
[Session] session.save_handler = files
-
With Apache you may overwrite the PHP setting for the Matomo directory only. If Matomo is installed in /matomo you are able to create a .htaccess file in this directory with the below code:
<IfModule mod_php4.c> php_value session.save_handler files </IfModule>
<IfModule sapi_apache2.c> php_value session.save_handler files </IfModule>
<IfModule mod_php5.c> php_value session.save_handler files </IfModule>
Bugs and Feature requests should be reported in the Issue Queue: https://github.com/backdrop-contrib/matomo/issues
- Joseph Flatt (https://github.com/hosef)
- indigoxela (https://github.com/indigoxela)
- Ported to Backdrop CMS by Joseph Flatt (https://github.com/hosef).
- Maintained for Drupal by Alexander Hass (https://www.drupal.org/u/hass).
- Initial Drupal development by Alexander Hass (https://www.drupal.org/u/hass).
This project is GPL v2 software. See the LICENSE.txt file in this directory for complete text.