matomo
Open-source, privacy-first web and app analytics that puts you in complete control of your data.
Matomo is the leading open-source alternative to Google Analytics, giving organizations of every size full ownership of their web and app analytics data. Deployed on your own server and backed by a MySQL or MariaDB database, it collects visitor behavior through a lightweight JavaScript tracking snippet, processes it through a powerful archiving engine, and surfaces the results in real-time dashboards — all without sending a single byte of data to a third party.
Built around a plugin-first architecture with 98 bundled plugins and hundreds more in the marketplace, Matomo lets teams enable only the features they need — from heatmaps and session recordings to e-commerce funnel tracking, Tag Manager, and custom dimensions — while keeping everything else out of the way. Role-based access control with site-level granularity makes it practical for agencies managing dozens of client websites from a single installation.
Privacy compliance is a first-class concern rather than an afterthought. Built-in tools for IP anonymization, consent management, cookie-free tracking, and Do Not Track respect allow Matomo deployments to meet GDPR, CCPA, HIPAA, and other data protection frameworks out of the box. A direct Google Analytics importer preserves historical reporting continuity when teams migrate. With over 1.4 million websites relying on it globally and active releases shipping multiple times per month, Matomo combines the depth of an enterprise analytics suite with the transparency and flexibility of open-source software.
What You Get
- 100% Data Ownership - All raw logs and aggregated reports are stored in your own MySQL/MariaDB database; no data ever leaves your infrastructure unless you explicitly configure an export.
- Privacy Compliance Toolkit - Built-in IP anonymization, consent management screens, cookie-free tracking mode, and Do Not Track support allow deployments to satisfy GDPR, CCPA, and similar frameworks without add-ons.
- Real-Time Dashboard - Live visitor counts, page views, and geographic maps update without page refreshes, giving marketing and ops teams instant visibility during campaigns or traffic spikes.
- Custom Segment Editor - Define reusable audience segments using any combination of visit attributes — device type, geographic region, referrer source, custom variables, or e-commerce behavior — and apply them across all reports.
- Google Analytics Importer - Migrate historical GA Universal Analytics or GA4 data directly into Matomo so you retain reporting continuity when switching platforms.
- Built-in Tag Manager - A full open-source tag orchestration engine equivalent to Google Tag Manager is included as a core plugin, letting you manage all marketing tags and custom tracking scripts without a third-party SaaS.
- E-commerce and Goal Tracking - Track product views, add-to-cart events, and conversions with unsampled accuracy; set up arbitrary conversion goals and measure funnel drop-off at each step.
- Unlimited Websites and Users - No per-seat pricing or site quotas — manage hundreds of properties and user accounts from a single Matomo installation with site-level permission granularity.
- Programmatic REST API - Every report Matomo can display is also accessible via a stable, versioned API endpoint, enabling integration with internal BI dashboards, alerting pipelines, and data warehouses.
- Extensible Plugin System - Enable, disable, and install community plugins from the Marketplace without touching core code; build your own plugins using documented hooks and a generated plugin scaffold.
Common Use Cases
- Privacy-regulated public sector websites - Government agencies and universities deploy Matomo to measure citizen engagement without transferring visitor data to US-based cloud providers, satisfying local data residency laws.
- E-commerce conversion optimization - Online retailers use unsampled e-commerce tracking and goal funnels to identify checkout drop-off points and measure the true impact of merchandising changes with full data accuracy.
- Digital agencies managing multiple client properties - Agencies run a single Matomo installation and create isolated site environments with per-client user accounts, delivering white-labeled analytics dashboards under their own domain.
- Healthcare and financial services with strict data governance - Organizations subject to HIPAA or PCI-DSS audit requirements deploy Matomo on-premise to keep analytics data inside their existing security perimeter and audit trail.
- Media publishers replacing third-party analytics - Editorial teams hosting Matomo server-side bypass browser ad-blockers that routinely block third-party analytics scripts, recovering the 20-40% of traffic typically missed by GA.
- Internal product analytics for SaaS applications - Engineering teams instrument Matomo’s API directly in backend services to track feature adoption and retention metrics without exposing usage data to external vendors.
Under The Hood
Architecture Matomo employs a deeply modular, plugin-first architecture where the core framework remains intentionally minimal, delegating all analytics functionality to independently managed plugins via a central publish-subscribe event dispatcher. Plugins register named event handlers — for archiving lifecycle events, asset injection, site management actions, and more — without coupling to each other or to core internals. A PHP-DI based dependency injection container manages service lifetimes across the application, enabling the access control layer, archiving engine, and tracking request pipeline to each be independently configurable. The tracking path (matomo.php entry point through Tracker, RequestHandler, RequestProcessors, to Visit recording) is cleanly separated from the reporting path, where CronArchive pre-aggregates raw logs into period-specific archive blobs stored in dedicated database tables — a design decision that enables fast report generation without raw-data scans at query time and scales well for installations accumulating years of data.
Tech Stack The backend is PHP 7.2.5+ with MySQL or MariaDB as the primary persistence layer, using hand-crafted SQL optimized for time-series aggregation rather than a general-purpose ORM. PHP-DI provides declarative dependency injection configured through PHP definition files. The frontend uses Vue 3 with TypeScript for all interactive dashboard components, compiled via Vue CLI and co-existing with a jQuery and Materialize CSS base retained for legacy views. The tracker exposes a customizable JavaScript beacon library (matomo.js) and a full Tag Manager runtime for client-side orchestration. GeoIP2 handles geographic lookups, device-detector classifies user agents, PHPMailer delivers scheduled reports, and Monolog handles structured logging. Testing spans PHPUnit for unit, integration, and system scenarios plus Jest for Vue component testing, all orchestrated through GitHub Actions.
Code Quality The test infrastructure reflects the platform’s age and maturity: unit tests cover individual classes in isolation, integration tests verify database interaction behavior, and system tests use XML snapshot assertions to catch regressions in report output across hundreds of scenarios. PHP 8 strict typing is applied throughout with typed method signatures, return types, and domain-specific exception classes. PHPStan static analysis runs with a maintained baseline for gradual coverage improvement, and a custom matomo-coding-standards PHP_CodeSniffer ruleset enforces consistent style. PHPDoc annotations are abundant and accurate across the codebase. The coexistence of legacy jQuery patterns alongside modern Vue 3 components introduces some frontend inconsistency, though new work is consistently landing in the Vue layer.
What Makes It Unique Matomo’s most architecturally distinctive feature is its pre-aggregating archiving engine, which transforms raw tracking logs into compressed period blobs at archive time rather than query time — enabling fast, scalable reporting without database indexing tricks or query caches. The segment engine compiles human-readable filter expressions (combining visit attributes, custom dimensions, and e-commerce events) into optimized MySQL JOINs at runtime, enabling arbitrary audience slicing without materialized views. The built-in Tag Manager implements a complete client-side tag orchestration runtime comparable to Google Tag Manager, entirely open-source. The plugin event system enables third parties to add custom archiving processors, inject custom dimensions, and intercept tracking requests without forking core — a capability depth that distinguishes Matomo from lighter-weight self-hosted analytics tools.
Self-Hosting
Matomo is released under the GNU General Public License v3.0, which means you can freely run it on your own servers, inspect and modify the source code, and redistribute modified versions — as long as you share those modifications under the same license. Commercially using Matomo to track your own websites or your clients’ websites carries no restriction and requires no license fee. The copyleft obligation applies only if you distribute a modified version of Matomo itself to third parties; operating it internally or as a hosted service for your own customers does not trigger redistribution requirements.
Running Matomo yourself requires a PHP 7.2.5+ web server, MySQL 5.5+ or MariaDB, and enough disk space to store raw visit logs and archive blobs — installations with high traffic volumes can accumulate hundreds of gigabytes over time, and you will want a regular archiving cron job and a database backup strategy in place from day one. The initial setup takes under ten minutes through the web installer, but ongoing operations include managing plugin updates, monitoring archive processing health, and applying security patches promptly, as Matomo’s large PHP surface area means vulnerabilities are occasionally discovered. Scalability beyond a single server requires manual work — database replication, load-balanced web tiers, and shared storage for the tmp/ and config/ directories are all on you.
Matomo Cloud (the official SaaS offering) adds managed infrastructure, automatic updates, a 99.9% uptime SLA, priority support with guaranteed response times, and cloud backup storage — all of which you replace with your own operational resources when self-hosting. The Marketplace offers premium plugins (Heatmaps, Session Recordings, A/B Testing, Funnels, Roll-Up Reporting) available only as paid add-ons for self-hosted installations, though their code runs entirely on your server. Free community support is available through the Matomo forums; paid on-premise support plans with SLA commitments are sold separately.
Related Apps
OpenBB
Databases · Analytics · Invoicing Finance
The AI Workspace for Finance: Connect Data, Run AI Agents, Build Analytics
OpenBB
OtherMetabase
Analytics
The open-source BI platform that lets anyone ask questions and build dashboards without writing SQL — with an embedded analytics SDK and AI-powered query assistant included.
Metabase
OtherClickHouse
Databases · Analytics · Data Engineering
Open-source column-oriented database that delivers real-time analytical queries on petabyte-scale data with millisecond latency.