Free training
Free Matomo Analytics Training – 2026
At a time when data protection has become crucial, Matomo has established itself as the sovereign alternative to Google Analytics. An open-source, self-hostable solution that complies with the GDPR (and CNIL recommendations), Matomo enables companies to keep full control over their audience data.
- Matomo is one of the few audience measurement tools that can be used without consent under strict conditions of parameterization, it benefits from this functionality because it is part of the solutions exempted by the CNIL.
- The data is stored in Europe or on your own servers, with no transfer to the United States (unlike Google Analytics 4, where data may be stored in Europe but remains subject to U.S. control).
- It is particularly well-suited for highly sensitive sectors (healthcare, local governments, public services, banking, etc.) due to its ability to be deployed on the organization’s own servers (on-premises).
The Role of Matomo Compared to More Established Analytics Solutions
In a landscape dominated by proprietary solutions, Matomo stands out for its open-source approach, self-hosting capability, and native GDPR compliance without dependence on the United States.
| Solution | Hosting | GDPR compliant by default | Code access | Advanced customization |
|---|---|---|---|---|
| Matomo | On-premise or EU cloud | ✅ Yes (with or without consent) | ✅ Yes (open-source) | ✅ Fully customizable |
| Piano Analytics | 100% cloud (hosted in the EU) | ✅ Yes (with or without consent) | ❌ No | ⚠️ Limited to product options |
| GA4 (Google Analytics) | Google Cloud (US) | ❌ No, requires mandatory consent for user tracking | ❌ No | ⚠️ Limited, dependent on Google Ads |
Why is Matomo the preferred choice in a sovereign context?
- Total control over data (self-hosting possible)
- No dependence on an American cloud
- Possibility of operating without consent with appropriate settings
- Active community rich documentation, customizable plugins
⚠️ Piano Analytics although European and modern, cannot be self-hosted. It remains a good choice for large groups with strong Data governance, but less suited to the requirements of complete technical sovereignty.
Knowing Matomo's limits to make an informed choice: between simplicity and frustration
Although Matomo is a robust and compliant solution, it quickly reaches its limits as soon as we try to go beyond standard analyses. Unlike Piano Analytics which offers multi-level data exploration (drill-down, segmented metrics, retroactive reports & complex boards) or GA4 whose interface allows more advanced cross-referencing via the explorer, Matomo remains limited to a rather rigid report structure.
Here are the main constraints to be aware of:
- Inflexible reports 3 dimensions maximum in customized reports, with limited retroactivity (or none at all in cloud versions).
- Advanced features that are either paid or unstable: funnels, heatmaps and custom reports are sometimes imprecise or buggy, depending on the version.
- No in-depth behavioral analysis (such as advanced cohort analysis or churn modeling) natively integrated.
- Numerous minor interface bugs These include approximate sorting, poorly named metrics, unstable segments on certain dimensions, and masked sampling problems as soon as 10M hits/month are exceeded.
- Costly infrastructure if self-hosted on a large scale Matomo is heavy on scaling without precise server tuning.
- Few connectors exist to link it to dataviz tools such as Tableau (only a lookerstudio connector exists).
Matomo remains an excellent audience measurement tool that's simple, sovereign, ethical and useful for raw statistics or basic business objectives. On the other hand, for complex data-driven strategies, it must be complemented by a data warehouse (DWH = datawarehouse) or an external visualization tool (Looker Studio, Tableau, etc.).. For this last point, unfortunately the connection possibilities are limited, so it's best to query your database directly.
Matomo's technical operation
2.1 How Matomo collects data
Matomo is based on a JavaScript script embedded on all site pages, which is executed on every page load. This script sends requests to a Matomo server, where the data is stored in a database.
By default, Matomo follows:
- Page views
- The referrer (source of traffic)
- Browser and system used
- Triggered JavaScript events (if implemented)
Each hit generates an HTTP request to matomo.phpcontaining all the information encoded in the URL parameters.
2.2 Sessions, visitors and cookies
Matomo distinguishes:
- A session (or "visit"): period of user activity on the site (30 minutes of inactivity = new visit)
- A unique visitor: recognized thanks to a cookie
pk_idcontaining a pseudo-anonymous identifier
Multi-visit tracking is possible thanks to this cookie. Without it, Matomo recognizes the user in a single session, based solely on IP and browser fingerprint.
📌 The "cookie-free" mode is therefore GDPR-compatible, but severely limits the possibilities for longitudinal tracking.
2.3 Advanced tracking via customized events
To go beyond page views, you need to instrument personalized events (clicks, downloads, interactions, etc.). This is done via a line of JS:
_paq.push(['trackEvent', 'Formulaire', 'Soumission', 'Contact']);
These events are not automatically tracked They must be declared manually or via a TMS such as Matomo Tag Manager (see next section).
They are then used to:
- Creating goals
- Building conversion funnels
- Segment visitors
- Analyze key interactions (e.g. videos, CTA buttons)
2.4 Campaign tracking: UTM vs MTM and Google Ads tracking
UTM: universal standard, compatible by default
Matomo automatically detects UTM parameters used for your marketing campaigns, just like Google Analytics:
utm_source=google&utm_medium=cpc&utm_campaign=soldes2025
These parameters are already recognized by Matomo without additional configuration. They can also be supplied in other forms (mtm_, pk_, piwik_etc.), all of which are supported by default:
| Recognized variant | Accepted example |
|---|---|
mtm_campaign |
?mtm_campaign=campagne-printemps |
pk_campaign |
Old Matomo version |
utm_campaign |
GA-compatible |
💡 If you're already using campaign parameters for your GA urls, you don't need to change anything in your URLs: Matomo will retrieve the existing parameters.
MTM: Personalized Campaigns via the TMS
With Matomo Tag Manager (MTM) You can define your own campaign parameter names to recognize:
_paq.push(['setCampaignNameKey', 'my_campaign']);
_paq.push(['setCampaignKeywordKey', 'kw']);
This allows you to:
- Use internal parameter names (eg:
?src=email_mars) - Track internal campaigns or unconventional ones
- Combine with more advanced triggers (cookie, referrer, click...)
📣 Track Google Ads campaigns with Matomo
By default, Google Ads clicks will appear as undefined organic traffic in Matomo if you don't tag them.
✅ For proper tracking:
- Use the Campaign URL Builder of Matomo (in
Acquisition > Campaign URL Builder) - Tag your URLs with parameters
mtm_campaign,mtm_kwd,mtm_source,mtm_mediumetc. - Integrate these parameters via tracking templates from Google Ads:
{lpurl}?mtm_campaign={campaignid}&mtm_kwd={keyword}&mtm_source=google&mtm_medium=cpc
💡 Be careful not to use utm in Google Ads campaigns if you want to leave the Google Ads automatic tagging option activated & you're using Google Analytics in parallel, as this would cut off synchronization between GA4 & Google Ads.
Ad Conversions Without a Google Tag (via Matomo Export)
With the Advertising Conversion Export you can send conversion data back to Google Ads without using third-party tags (no external cookie):
-
Matomo captures the
gclid(Google Click ID) in the URL -
When a goal is reached, Matomo stores and associates this gclid with the conversion.
-
Export can be:
- By Manual CSV
- Or via a Synchronized secure URL with Google Ads
📌 Warning, solution not GDPR and ePrivacy compliant, also compatible with Microsoft Ads & Yandex.
2.5 The key role of the tagging plan
A tracking plan (or tagging plan) is an indispensable strategic document that lists all the actions to be tracked, the category/ event names, the triggering rules, and the associated business objectives.
Example of a plan extract:
| Tracked action | Category | Action | Label | Related objective? |
|---|---|---|---|---|
| Click on CTA "Free quote | CTA | Click | Quotation - Home | Yes |
| Video tutorial playback | Video | Playback | Tutorial - Page X | No |
| Send contact form | Form | Submission | Contact - Footer | Yes |
⚠️ Without a clear plan, tracking quickly becomes incoherent and unusable.
2.6 A word about structural limits
Matomo is not based on an analytical OLAP database like some modern tools. Its calculation engine is relatively slow especially when self-hosted. Cross queries between several dimensions quickly become resource-intensive, which explains:
- Restrictions on customized reports (max. 3 dimensions)
- Slowness on volumes > 10M hits/month
- Performance highly dependent on infrastructure quality
💡 In the case of large volumes, it is advisable to export data via API or webhooks then reprocess them in a DWH or BI tool.
2.7 Cookies used by Matomo: which cookies are actually active?
Matomo's JavaScript tracking code uses internal cookies (first-party), defined on your site's domain. These cookies enable you to track users between pages and over time. Here are the main ones:
Standard Tracking Cookies
| Cookie | Main use | Default lifetime |
|---|---|---|
_pk_id |
Unique visitor ID (used to track a user) | 13 months |
_pk_ref |
Stores the initial origin of the visit (traffic source) | 6 months |
_pk_ses / _pk_cvar |
Temporary storage of session information | 30 minutes |
_pk_hsr |
Used for heatmaps and session recordings | 30 minutes |
Cookies Related to Consent and Privacy
| Cookie | Main use | Default duration |
|---|---|---|
mtm_consent |
Consent given (tracking activated) | 30 years |
mtm_consent_removed |
Withdrawn consent | 30 years |
mtm_cookie_consent |
Specific consent for cookies | 30 years |
matomo_ignore |
Tracking opt-out (by cookie or iframe opt-out) | 30 years |
matomo_sessid |
CSRF token for opt-out security (contains no personal data) | 14 days |
Other
_pk_testcookieused to test the browser's ability to store cookies immediately deleted._pk_uid(optional): third-party cookie deactivated by default, to be used only for specific needs (multi-domain without SSO, for example).
Matomo & GDPR - collecting without consent
3.1 Regulatory context
Since the entry into force of the GDPR (2018) and the CNIL directives (2020), any collection of data for analytical purposes requires the prior consent of users, with very strict exceptions.
But good news: Matomo is one of the few tools validated by the CNIL for collection without consent under certain conditions.
3.2 Matomo: a cookieless, compliant solution
Matomo can work:
- With cookies + consent Full tracking, but data collection rate dependent on acceptance rate.
- No cookies + no consent: limited tracking but 100 % legal.
- Semi-hybrid (cookies activated after opt-in): partial collection, requiring a consent management system (CMP).
3.3 CNIL checklist: 9 criteria to respect
To be exempted from consent, you must configure Matomo exactly as follows:
- ✅ Use a version listed as compliant by the CNIL (Matomo, AT Internet, Piwik Pro...).
- ✅ Provide clear information in the privacy policy.
- ✅ Offer an accessible, permanent opt-out option (e.g. Matomo iframe or HTML link).
- ✅ Do not cross-reference data with other sources (e.g. CRM, Google Ads).
- ✅ Limit cookies to strictly anonymous statistical uses.
- ✅ Do not track browsing on other sites.
- ✅ Anonymize IP address (last 2 bytes masked).
- ✅ Do not store IPs and cookies for more than 13 months.
- ✅ Do not store collected data beyond 25 months.
📄 Official Matomo configuration validated by the CNIL (PDF)
3.4 Technical settings to meet these criteria
Here are the parameters to be applied in Matomo for GDPR-compatible collection without consent:
_paq.push(['disableCookies']);
_paq.push(['HeatmapSessionRecording::disable']);
And in the Matomo administration:
- Enable IP anonymization →
Administration > Vie privée > Anonymiser les données - Hide last 2 bytes of IP address
- Do not activate real-time tracking without consent
- Add an "I refuse to be tracked" link with the Matomo opt-out iframe
3.5 Limitations of collection without consent
Collecting without consent is possible, but this has a functional cost:
| Functionality | Available without consent? |
|---|---|
| Multi-visit identification | ❌ No (no visitor cookie) |
| Conversion funnels | ⚠️ Partial (fragmented data) |
| Real time | ❌ Disabled (cookie required) |
| Geolocation data | ✅ Yes, but city-wide (IP anonymized) |
| User segmentation | ⚠️ Limited to non-personal data |
3.6 Example of "no consent" configuration
<!-- Script Matomo cookieless sans consentement -->
<script type="text/javascript">
var _paq = window._paq = window._paq || [];
_paq.push(['disableCookies']);
_paq.push(['HeatmapSessionRecording::disable']);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//stats.votresite.fr/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '1']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
3.8 Specific procedures for activating the exemption
To be recognized as "consent-exempt", you must disable or verify several key functions:
a) Disable visitor data exports
- In Matomo:
Administration > Système > Paramètres généraux > Live - Disable visit logs, visitor profiles and real-time maps.
b) Offer an opt-out option
Add a Matomo tracking opt-out link on the privacy policy page accessible via Settings > Privacy > Users opt-out
<iframe frameborder="no" width="600px" height="200px" src="https://example.com/index.php?module=CoreAdminHome&action=optOut&language=en"></iframe>
3.9 Essential checks in Matomo
| Item to be checked | Why | How to |
|---|---|---|
| 🔒 IP anonymization | GDPR requirement | Vie privée > Anonymiser les données |
| 🍪 No third-party cookies | Tracking prohibited | Do not enable cross-domain tracking |
| 👤 No User ID | Personal data | Visiteurs > ID Utilisateur must be empty |
| 🛒 No E-Commerce tracking | Forbidden without consent | Éléments mesurables > Gérer > Désactiver E-Commerce |
| 🔥 No heatmaps/session recording | Consent required | Add to JS: _paq.push(['HeatmapSessionRecording::disable']); |
3.10 Never collect personal data (even indirectly)
Here are some common pitfalls to avoid:
- ❌ Custom dimensions containing name, email, customer ID...
- ❌ URLs or page titles containing identifying information (GET parameters, custom slug...)
- ❌ Events with sensitive labels (
trackEvent('Form', 'Soumission', 'Jean Dupont')→ to be avoided!)
Clean up URLs, titles, and variables using server-side or client-side filtering logic before sending them to Matomo.
💡 In case of doubt, if you collect identifiable data you must obtain explicit consent.
Installing and configuring Matomo
4.1 Choosing the right hosting solution
Option 1: Self-hosted Matomo (On-Premise)
-
Benefits:
- Total control over data
- Possibility of being 100 % GDPR compliant (consent-free mode)
- Extensible via plugins, crons, log access
-
Disadvantages:
- Requires a high-performance dedicated or shared server
- Do-it-yourself maintenance, security and updates
- Complex management beyond 1M hits/month without tuning
📌 Recommended if you have a dedicated tech team or a strong need for sovereignty.
Option 2: Matomo Cloud (SaaS)
-
Benefits:
- Managed hosting, no servers to configure
- SLA, backups, monitoring supported
- GDPR compatible via strict DPA contracts
-
Disadvantages:
- Some advanced features are not free
- Limited backend access (no database access)
- Collection without consent possible, but dependent on client-side configuration
📌 Recommended for small marketing teams or pilot projects.
4.2 Initial setup: essential steps
After installation (or cloud subscription), here are the key configuration steps:
- Create a site (or several, depending on your domains) in
Éléments mesurables > Gérer - Add tracking script in the
<head>or via a TMS - Activate essential modules (Goals, Segments, Custom reports...)
- Configure GDPR settings in
Vie privée - Disable what's not in use (e-commerce, heatmaps, User ID...)
💡 Don't leave any plug-ins unnecessarily activated by default: this is detrimental to performance and can cause problems for the CNIL.
4.3 Optimization tips (self-hosting)
For on-premise installations with medium to high traffic (> 500,000 visits/month), apply these best practices:
-
✅ Enable cron archiving: bashCopyEdit
sudo crontab -e */30 * * * * /usr/bin/php /chemin/matomo/console core:archive --url=https://stats.votresite.fr > /var/log/matomo-archive.log -
✅ Optimizing the database:
- Column index
idvisit,visit_last_action_time,idaction - Automatic cleaning:
Administration > Vie privée > Supprimer anciennes données
- Column index
-
✅ Monitor CPU/RAM usage:
- Matomo can consume > 2 GB RAM in processing by default
- A dedicated server is recommended for more than 1M hits/month
-
✅ Enable GZIP compression and caching on Apache/Nginx
4.4 Extensions and useful modules
Here are the recommended plugins depending on your use:
| Plugin | Main purpose | Version required |
|---|---|---|
| Custom Reports | Cross reports (3 dimensions) | Premium (paid) |
| Tag Manager | TMS integrated with Matomo | Free |
| Funnels | Conversion funnels | Premium (paid) |
| Media Analytics | HTML5, YouTube, Vimeo video tracking | Premium (paid) |
| Heatmaps & Session Rec. | Behavioral analysis (to be activated with consent) | Premium (paid) |
🔒 Avoid activating plugins that process personal data without a clear consent framework.
Matomo Tag Manager (MTM)
5.1 What is MTM?
Matomo Tag Manager is a tag management system (TMS) integrated with Matomo. It allows you to deploy, modify and organize JavaScript tags without touching the site's source code.
Similar to Google Tag Manager or Commanders Act, MTM is a sovereign solution hosted on your own servers if you use Matomo on-premise.
📌 Objective: delegate tag triggering and injection logic to a visual interface, without depending on developers for every modification.
5.2 MTM container architecture
An MTM container is an entity comprising 3 main elements:
| Element | Description |
|---|---|
| 🏷️ Tags | Code execution (Matomo, custom JS, HTML, Facebook Pixel, etc.) |
| ⚡ Triggers | Tag activation conditions (page view, click, scroll, etc.) |
| 📦 Variables | Dynamic values injectable into tags (URL, CSS classes, referrer, cookie...) |
💡 Each site or environment (staging, production...) can have its own container.
5.3 Typical use cases
Event Tracking Without Coding
Add button click tracking with just 3 clicks in the MTM interface:
- Trigger: click on element
#btn-inscription - Tag:
trackEventMatomo - Variables: dynamic labeling via
element text
Multi-site management
With a global container, you can propagate shared tags to multiple domains (via separate versions of the container).
5.4 Advantages and limitations of MTM
| Benefits | Limits |
|---|---|
| ✅ Easy-to-use interface | ⚠️ Fewer advanced options than GTM |
| ✅ GDPR-compatible / cookieless | ⚠️ No integrated visual debug mode |
| ✅ Fast script deployment | ⚠️ Limited technical documentation |
| ✅ Native integration with Matomo | ⚠️ No integrated A/B testing |
5.5 Example of a complete MTM configuration
Objective: track a click on the "Download brochure" button
-
Custom variable:
- Name:
elementText - Type:
Text of clicked element
- Name:
-
Trigger:
- Type:
Click - CSS selector:
#download-brochure - Conditions:
elementText contains "Télécharger"
- Type:
-
Tag:
- Type:
Matomo Event - Category:
CTA - Action:
Clic - Name:
{{elementText}}
- Type:
-
Publication of the container:
- Create a new version
- Publishing on the production environment
5.6 Integration of a CMP (Consent Management Platform) with Matomo Tag Manager
To ensure GDPR-compliant collection you need to synchronize your consent manager (CMP) with Matomo Tag Manager so that tracking tags are only triggered if the visitor has given his consent.
This integration enables:
- Do not load Matomo or its cookies without consent
- Dynamically manage tracking activation/deactivation
- Centralize management logic in the TMS, without modifying the site
Generic integration steps with a CMP
Prerequisites
- You have an active account with a CMP provider (e.g. Axeptio, Cookiebot, Didomi...).
- The Matomo Tag Manager container code is already integrated on your site
- Your consent banner is operational (tested on the site)
1. Remove the direct inclusion of the CMP script
Most CMPs offer a script <script src=...> to be included in the <head>. For clean integration via MTM, this script must be removed from the source code and injected via Matomo Tag Manager.
2. Create a dedicated CMP tag in Matomo Tag Manager
- Tag type: CMP-specific tag or Custom HTML
- Name:
Consentement CMP - Content: use the client SDK script supplied by the service provider
- Trigger:
Pageview – All pages
3. Create a custom HTML tag to manage consent
<script>
window._cmpcb = window._cmpcb || []; // adapt this prefix for your CMP (e.g. _axcb for Axeptio, _didomiCallback, etc.)
window._mtm = window._mtm || [];
window._cmpcb.push(function(sdk) {
sdk.on("cookies:complete", function(choices) {
let matomoAllowed = false;
for (let vendor in choices) {
if (vendor.toLowerCase() === "matomo" && choices[vendor] === true) {
matomoAllowed = true;
}
}
if (matomoAllowed) {
enableMatomo();
} else {
disableMatomo();
}
});
});
function enableMatomo() {
_paq.push(['rememberCookieConsentGiven']);
_paq.push(['setConsentGiven']);
}
function disableMatomo() {
_paq.push(['forgetCookieConsentGiven']);
_paq.push(['deleteCookies']);
}
</script>
- Tag position:
Head Start - Trigger:
DOM Ready
4. Activate the "Require Consent" option in Matomo Tag Manager
In the settings of the Matomo Configuration variable:
- Activate the "Require Cookie Consent
- Activate (if necessary) the "Require Tracking Consent
This prevents any tracking if consent has not been explicitly given.
5. Trigger Matomo tracking based on consent
Your tracking tags (Page View, Events...) must:
- Be conditioned by a variable or a "Consent given" event
- Do not trigger by default
6. Test behavior
Before going into production:
- Check banner operation (accept, refuse, withdraw)
- Test the cookies: they should appear only after acceptance
- Observe the JS console for events
_mtm(debug tracking)
Important Notes
- The logic presented here works with all CMPs with a JS SDK and an event system.
- In the event of a configuration error, you risk illegally collecting personal data without a legal basis.
- If your CMP doesn't allow fine-tuned Matomo activation, prefer integration via a server wrapper or tracking proxy.
Event and goal tracking in Matomo
6.1 Why instrument events?
In Matomo, page views alone are not enough to understand users' intentions and actions. This is why tracking personalized events is essential:
- Identify strategic clicks (CTAs, downloads, videos)
- Track complex interactions (forms, carousels, internal navigation)
- Define concrete business objectives (registration, add to cart, lead generated...)
Events enrich raw behavioral data, enabling analysis focused on business objectives.
6.2 Event structure in Matomo
Each Matomo event is based on 3 main components (a 4th is optional):
_paq.push(['trackEvent', 'Catégorie', 'Action', 'Libellé', 'Valeur']);
| Element | Description | Example |
|---|---|---|
| Category | Logical grouping | CTA, Vidéo, Formulaire |
| Action | Type of interaction | Clic, Lecture, Soumission |
| Label | Action context or target | Header - Contact, Brochure.pdf |
| Value (optional) | Associated numerical value | 1 or prix, durée en secondes |
💡 It is recommended to define a consistent event taxonomy from the outset to avoid duplication and confusion in the reports.
6.3 Examples of strategic events
| Business cases | Tracking example |
|---|---|
| Document download | trackEvent('Téléchargement', 'Clic', 'fiche-produit.pdf') |
| Form submission | trackEvent('Formulaire', 'Soumission', 'Contact footer') |
| Video playback | trackEvent('Vidéo', 'Lecture', 'Page produit') |
| Click on newsletter button | trackEvent('CTA', 'Clic', 'Inscription NL header') |
| Basket stage | trackEvent('Tunnel', 'Étape 2', 'Adresse livraison') |
6.4 Creating goals in Matomo
Goals let you automatically measure the completion of a key action, such as a purchase or a form submission. They are based on rules.
Types of goals:
- Destination URL reached (
/merci,/confirmation) - Custom event triggered (
trackEvent(...)) - Time spent on site
- Number of pages viewed in a session
Example:
Creation of a "Contact form sent" goal
- Type: Event
- Category
Formulaire - Action =
Soumission - Label =
Contact footer
📌 Goals then appear in all reports as metrics: conversion rate, rate per channel, etc.
6.5 Best practices for advanced monitoring
- ✅ Centralize event names in a tagging plan shared with teams
- ✅ Use dynamic variables via Matomo Tag Manager to customize values
- ✅ Test all triggers via debugging tools (
?mtmPreviewMode=1) - ✅ Add secondary goals to monitor micro-conversions (e.g. scroll at 75 %)
- ❌ Avoid overly generic event names (
Clic,OK,Submit...)
Analyze your data in Matomo
7.1 Overview of reports
Matomo offers a modular interface, organized into standard reports grouped into large families:
| Category | Key reports |
|---|---|
| 🧭 Acquisition | Channels, Keywords, Referrers, UTM Campaigns |
| 👥 Visitors | Browser, Device, Geolocation, Recurrence |
| 📄 Contents | Page views, Entries, Exits, Followed pages |
| 🎯 Goals | Conversions, Value, Funnel (if plugin active) |
| 🛍️ E-commerce | Products, Orders, Revenues (if enabled) |
| ⚙️ Customization | Events, Custom variables |
📌 Each report is segmentable, can be filtered by text search, and can display comparisons between periods.
7.2 Filters, segments and comparators
Segments
Segments let you analyze a subset of users (mobile visitors, new visitors, Google Ads traffic, etc.)
Useful examples:
Canal = Référent / Campagne UTM = newsletterType d'appareil = smartphoneA atteint l’objectif : "Lead généré"
The segments are persistent and reusable in all reports.
Comparison of Time Periods
Matomo compares two date ranges:
- Side-by-side display or % variation
- Supports segments for each period
⚠️ Limitation: no multi-site or multi-goal views in a single interface.
7.3 Custom Reports
With the premium plugin Custom Reports it is possible to:
- Combine up to 3 dimensions in a report
- Choose the metrics to be displayed (conversions, rates, events...)
- Generate pivot tables or dynamic drop-down lists
Example: cross Page, Type d'appareil, Campagne with Taux de conversion.
⚠️ This feature depends on the Matomo version used (premium only).
7.5 Limits to be aware of
| Technical limits | Recommended workaround |
|---|---|
| Max 3 dimensions in reports | Export via API > processing in BI |
| No native funnel visualization (without plugin) | Activate plugin Funnels |
| No advanced cohort analysis | Export + external display |
| Segments sometimes unstable on large volumes | Pre-calculation via archiving API / cron |
💡 For multi-channel or multi-source analysis, connect Matomo to Looker Studio, Tableau, Power BI or BigQuery is strongly recommended.
Implement Matomo via Google Tag Manager (GTM)
8.1 Why use GTM with Matomo?
Although Matomo has its own Integrated Tag Manager (MTM) I recommend that you continue to centralize tag management via Google Tag Manager for reasons of:
- team or agency standardization,
- dependency on other Google tools (Ads, Optimize...),
- better GTM documentation/ergonomics.
Good news: Matomo is fully compatible with GTM The key is to follow a rigorous configuration.
8.2 Adding the Matomo base tag to GTM
Steps:
- Create a custom HTML tag in GTM: (script to be adapted according to your consent configuration, see previous sections)
<!-- Matomo Tag (HTML personnalisé) -->
<script type="text/javascript">
var _paq = window._paq = window._paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//stats.votresite.fr/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '1']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
- Trigger: Initialization (all site pages)
📌 This installs the Matomo code on all pages and allows you to report the basic metrics.
8.3 Monitoring e-commerce
To trigger e-commerce tracking on the Matomo side you need to send a JS command via _paq.push().
💡 You need to dynamically inject data from the GTM data layer (dataLayer).
Product view
var _paq = _paq || [];
var productsDetails = {{Ecommerce Items}};
productsDetails.forEach(function(product){
_paq.push(["setEcommerceView", product.item_id.toString(), product.item_name,
product.item_category, parseFloat(product.price||0)])
});
_paq.push(['trackPageView']);
Add to cart (via a cookie storing previously added products)
var products = {{checkoutproduits}};
products.forEach(function(product){
_paq.push(["addEcommerceItem",product.item_id.toString(),
product.item_name,
product.item_category, parseFloat(product.price||0), parseFloat(product.quantity||0)])
});
// Envoyer le total au format numérique
_paq.push(["trackEcommerceCartUpdate", parseFloat(total_price)]);
Purchase
var _paq = _paq || [];
var orderDetails = {{Ecommerce (dataLayer)}};
var products = orderDetails.purchase.products;
var order_id = orderDetails.purchase.actionField.id;
var grand_total = parseFloat(orderDetails.purchase.actionField.revenue||0);
var sub_total = grand_total - parseFloat(orderDetails.purchase.actionField.shipping||0);
var tax = parseFloat(orderDetails.purchase.actionField.tax||0);
var shipping = parseFloat(orderDetails.purchase.actionField.shipping||0);
products.forEach(function(product){
_paq.push(["addEcommerceItem",product.id.toString(), product.name, product.category, parseFloat(product.price||0), parseFloat(product.quantity||1)])
});
_paq.push(["trackEcommerceOrder",order_id.toString(), grand_total, tax, shipping]);
8.4 Tracking customized events with GTM
Matomo accepts classic events via:
_paq.push(['trackEvent', 'Catégorie', 'Action', 'Label', 'Valeur']);
Example (click PDF button):
_paq.push(['trackEvent', 'Téléchargement', 'Clic', 'Guide Tarif 2025']);
- Create an HTML tag in GTM
- Trigger:
Clickon a link containing.pdf
8.7 Technical recommendations
- Use a Structured DataLayer (
ecommerce,event,userId...) to dynamically inject values - Avoid Matomo tags in
document.write()(GTM incompatible) - Activate the Require Consent option if the tracking depends on a CMP
- Always test with GTM's debugging tools AND with the Matomo Debugger extension
Audit & tips
9.1 Matomo configuration audit (technical checklist)
For any project using Matomo, start with a technical audit structured to check implementation efficiency and compliance.
✅ Checklist for a quick audit of a Matomo account:
- The Matomo script is available on all pages
- GDPR data are properly anonymized
- Event tracking is structured (coherent taxonomy)
- A tagging plan exists and is up to date
- Goals are correctly configured and tested
- Automatic archiving (
cron) is active if on-premise - Reports display consistent bounce rates
- No personal data (email, raw customer ID, etc.) is visible
🔍 Use the Matomo Debugger tool or the browser with JS console to inspect hits in real time.
9.2 Debugging & common errors
Before a project is handed over to the customer or the marketing team, a rigorous debugging is essential.
Common Problems & Solutions
| Symptom | Probable cause | Recommended solution |
|---|---|---|
| No Matomo hits in the network | Missing or poorly integrated script | Check DOM, GTM, JS console |
| Page views doubled | Script injected 2x (GTM + MTM) | Eliminate duplicates, centralize the tag |
| Goals never reached | Wrong trigger or condition | Manually simulate each interaction |
| Segments always empty | Poor syntax / inconsistent casing | Standardize names in the tag plan |
| Empty conversion funnel | Poorly ordered goals or poorly activated funnel | Reconfigure the steps in the plugin |
| Uncategorized events | Missing labels or incorrectly injected dynamic labels | Testing in Matomo Debugger / console _paq |
| Ecommerce tracking not activated | Module disabled or site not marked as such | Éléments mesurables > Gérer > E-commerce |
| Hits filtered or absent in cookieless | GDPR settings misconfigured or _paq incomplete |
Review cookieless configuration (see 3.6) |
📌 The browser plugin Matomo Debugger (Chrome) displays live hits, active segments, sent events and JS errors.
9.6 Going further with Matomo: API, BI and expert modules
Once Matomo has been properly configured, technical and data teams can go much further by exploiting:
1. The Matomo REST API
- JSON, XML or CSV export of any report
- Automated dashboard creation
- Integration with external tools (Looker, Power BI, Notion, Zapier, etc.)
Example:
https://stats.monsite.fr/index.php
?module=API&method=VisitsSummary.get
&idSite=1&period=week&date=today
&format=JSON&token_auth=XXXX
2. Integration with BI tools
- Export logs to database (if self-hosted) → PostgreSQL / BigQuery
- Aggregation in Looker Studio (ex-Datastudio)
- Enriched visualization in Tableau / Power BI
💡 For large volumes, remember to extract the tables log_visit, log_link_visit_action via cron or Python script.
3. Recommended Premium Modules
| Module | Advanced function |
|---|---|
| Funnels | Visualization of conversion funnels |
| Custom Reports | Reports with more than 3 dimensions |
| Media Analytics | Advanced video tracking |
| Roll-Up Reporting | Multi-site aggregation |
| Form Analytics | Detailed analysis of forms |
⚠️ These modules are not free of charge (cloud subscription or on-premise license), but are essential for business needs.
4. Useful Integrations
- CRM (via webhook or API): push Matomo leads into Hubspot, Pipedrive, Salesforce...
- CMP (consent manager): dynamic tracking control (see 5.6)
- Google Ads / Bing Ads: conversion tracking with UTM parameters and cross-referencing