Privacy-friendly web analytics for OXID eShop 7 with full E-Commerce tracking, Klaro Consent Manager integration, and GDPR-compliant privacy features.
Why Matomo? Unlike Google Analytics, Matomo can be self-hosted on your own server, giving you complete control over your data. Combined with this module's privacy features, you can achieve:
| Feature | Description |
|---|---|
| Cookieless Tracking | Track visitors without cookies for reduced data collection |
| IP Anonymization | Configurable anonymization levels (0-3 bytes) |
| Do-Not-Track Respect | Honor browser DNT settings |
| Klaro Integration | Seamless integration with Klaro Cookie Consent Manager |
| E-Commerce Tracking | Product views, cart updates, order completions |
| Heartbeat Timer | Accurate time-on-page measurement |
| Link & Download Tracking | Track outbound links and file downloads |
| Opt-Out Widget | GDPR-compliant opt-out for visitors |
Add the private Composer repository to your shop's composer.json:
{
"repositories": [
{
"type": "composer",
"url": "https://packeton.markus-michalski.net"
}
]
}
Note: Repository credentials will be provided upon license purchase. Private repositories are managed via Packeton.
composer require mmd/oxid7-matomo-analytics
When prompted for authentication, enter the credentials provided with your license.
vendor/bin/oe-console oe:module:activate mmd_matomo_analytics
vendor/bin/oe-console oe:cache:clear
Update to the latest version:
composer update mmd/oxid7-matomo-analytics
vendor/bin/oe-console oe:cache:clear
After activation, find the settings under:
Extensions > Modules > Matomo Analytics > Settings
| Setting | Required | Description |
|---|---|---|
| Tracking Enabled | Yes | Master switch for all tracking |
| Matomo URL | Yes | Your Matomo installation URL (e.g., https://analytics.example.com) |
| Site ID | Yes | The Site ID from your Matomo installation (default: 1) |
| Setting | Default | Description |
|---|---|---|
| Cookieless Tracking | On | Track without cookies - reduces stored data |
| IP Anonymization | 2 bytes | How many bytes of the IP address to mask |
| Respect Do-Not-Track | On | Honor browser DNT settings |
| Require Cookie Consent | Off | Only track after explicit consent |
| Klaro Integration | Off | Use Klaro Consent Manager |
| Klaro Service Name | matomo | Must match the service name configured in Klaro |
IP Anonymization Levels:
| Setting | Default | Description |
|---|---|---|
| Enable E-Commerce Tracking | On | Master switch for E-Commerce features |
| Track Product Views | On | Track when users view product detail pages |
| Track Cart Updates | On | Track add-to-cart and cart changes |
| Track Orders | On | Track completed orders with revenue |
| Setting | Default | Description |
|---|---|---|
| Enable Heartbeat Timer | Off | Accurate time-on-page measurement |
| Heartbeat Interval | 15 | Seconds between heartbeat pings |
| Track Outbound Links | On | Track clicks on external links |
| Track Downloads | On | Track file downloads (PDF, ZIP, etc.) |
If you're using Klaro as Cookie Consent Manager and want to require user consent before tracking:
In Extensions > Modules > Matomo Analytics > Settings:
matomo (or your preferred name)Create a new service in your Klaro configuration:
var klaroConfig = {
services: [{
name: 'matomo',
title: 'Matomo Analytics',
purposes: ['analytics'],
cookies: ['_pk_*', 'mtm_*']
}]
};
If you're NOT using cookieless tracking, Matomo sets cookies that should be deleted when consent is revoked:
_pk_id - Visitor ID_pk_ref - Referrer information_pk_ses - Session cookie_pk_cvar - Custom Variables_pk_hsr - Heatmap/Session RecordingMATOMO_SESSID - Session IDpiwik_ignore - Opt-Out Cookiemtm_consent - Consent Cookiemtm_consent_removed - Consent RevocationNote: If you're using cookieless tracking, Matomo doesn't set any cookies and you can leave the cookie rules empty. However, you may still need consent depending on your legal assessment.
type="text/plain" instead of text/javascripttext/javascript and executes itThe module provides an opt-out widget that you can embed in your CMS pages.
Direct link to opt-out:
https://your-shop.com/index.php?cl=matomo_optout
[{include file="widget/matomo_optout.tpl"}]
The module automatically tracks E-Commerce events when enabled:
Tracked when a user visits a product detail page:
Tracked when the cart contents change:
Tracked on the order confirmation page:
The module extends the following templates:
layout/base.tpl - Block base_js for tracking codepage/checkout/thankyou.tpl - Block checkout_thankyou_info for order trackingWhen using custom themes, ensure these blocks are available.
src/
├── Config/
│ ├── MatomoConfig.php # Immutable Config Value Object
│ └── MatomoConfigFactory.php # Factory for Config from module settings
├── Controller/
│ └── MatomoOptOutController.php # Opt-Out Standalone Page
├── DataTransfer/
│ └── MatomoEcommerceData.php # DTO for E-Commerce data
├── EventSubscriber/
│ └── OrderSubscriber.php # Order Tracking via Events
├── Extension/
│ ├── Application/Controller/
│ │ └── ThankYouControllerExtension.php
│ └── Core/
│ └── ViewConfigExtension.php # Template methods
└── Service/
├── ConsentChecker.php # Consent validation
├── EcommerceTracker.php # E-Commerce JS generator
└── TrackingCodeRenderer.php # Tracking code generator
This module is designed with privacy in mind:
| Aspect | Implementation |
|---|---|
| Cookies | Optional - cookieless tracking available |
| IP Storage | Anonymized (configurable level) |
| DNT Header | Respected when enabled |
| Consent | Klaro integration available |
| Data Location | Your Matomo server (self-hosted) |
For privacy-friendly tracking:
Important Legal Note: Whether consent is required for analytics tracking depends on your jurisdiction and specific implementation. Even with cookieless tracking and IP anonymization, many legal experts recommend obtaining user consent for analytics. Consult with a legal professional to determine the appropriate consent requirements for your specific situation.
vendor/bin/oe-console oe:cache:clearvendor/bin/oe-console oe:module:listtype="text/plain" appears in the script tag (view source)Commercial License:
See LICENSE file for full terms.
For questions and support:
Markus Michalski
Email: support@markus-michalski.net