A simple module to add the Piwik PRO container (with tracking code) to your Drupal site, making it easy to collect visitor data from any Drupal site. It also includes a submodule to view key metric data directly in Drupal.
What is Piwik PRO?
Piwik PRO is a privacy-first platform that offers advanced analytics features while allowing for full control of data. It provides flexible reports and data collection in addition to consent management, tag management and a customer data platform.
Analytics
Collect data across websites, apps, digital products and post-login areas. Customize how data is collected and analyze it with built-in audience, behavior, acquisition and conversion reports. Dive deeper with custom reports and access to raw data.
Installation
- If your site is managed via Composer, use Composer to download the webform module running composer require "drupal/piwik_pro". Otherwise copy/upload the webform module to the modules directory of your Drupal installation.
- Make sure you also install the dependencies:
- Path alias (this is a core module and should already be installed)
- Key module (required in Piwik PRO 1.4 and later)
- For nonce support you need the CSP module
- Enable the 'Piwik PRO' module and desired sub-modules in 'Extend'. (/admin/modules).
- Set up user permissions. (/admin/people/permissions#module-piwik_pro)
Configuration for Piwik PRO
- Navigate to Administration > Configuration > Webservices > Piwik PRO
to configure the Piwik PRO account. - Container address: The account address with containers added to the address.
- Should always ends in a slash
- Example: https://yourwebpage.containers.piwik.pro
- Site id
- As default, every page except the listed pages in section what to track are tracked. Same applies for roles and content types. You can read more in section Page specific tracking.
Configuration for Piwik PRO analytics dashboard
To find your Piwik PRO Client ID and secret, log in to your account, click on your email address in the top right corner, select "API keys," and create or view your credentials.
- Make sure you have completed the piwik pro setup
- Configure Key module with your user secrets. To use environment variables for your client secrets you can follow key modules developer guide
- Navigate to Administration > Configuration > Webservices > Piwik PRO
and switch to tab Dashboard. - Give your Client ID and select the secret you created with Key api.
- Select the tracking features you want to track
Page specific tracking
The default is set to "Add to every page except the listed pages". By
default the following pages are listed for exclusion:
/admin
/admin/*
/batch
/node/add*
/node/*/*
/user/*/*
These defaults are changeable by the website administrator or any other
user with 'Administer Piwik PRO' permission.
Analytics Dashboard (introduced in version 1.4.0)
Piwik PRO Dashboard is a submodule for the Piwik PRO module.
It enables site administrators to view key analytics data directly within the Drupal admin interface. The dashboard can be accessed from the Reports admin menu.
Currently, the dashboard includes:
- Overview metrics: Visitors, Page Views, Returning Visitor Rate, Bounce Rate, Visitors Over Time, Page Views Over Time
- Top Pages
- Device Breakdown
The displayed data can be toggled between the last 7 or 30 days.
The configuration for the Dashboard module can be found at /admin/config/services/piwik-pro/dashboard.
The dashboard can be accessed from /admin/reports/piwik-dashboard.
There are also new permissions that should be configured:
- "Administer Piwik PRO Dashboard": Allows setting the required API information.
- "Access Piwik PRO Dashboard": Allows viewing the dashboard and using the necessary API routes.
IMPORTANT:
To enable the dashboard, the site administrator must create an API key to obtain a Client ID and Client Secret. Remember to configure the base Piwik PRO module too.
For more information about authentication with Piwik PRO, see the official documentation:
https://developers.piwik.pro/reference/authentication
Dependencies
- Path alias
- Key module (required in Piwik PRO 1.4 and later)
Project information
- Project categories: Integrations
979 sites report using this module
- Created by joshahubbers on , updated
Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.





