MCPSERV.CLUB
Matomo

Matomo

Self-Hosted

Open‑source web analytics with full data ownership

Active(100)
20.9kstars
2views
Updated 1 day ago

Overview

Discover what makes Matomo powerful

Matomo (formerly Piwik) is a self‑hosted, open‑source web analytics platform that offers full control over data collection and reporting. From a developer’s standpoint, it is a PHP‑based application that runs on any LAMP/LEMP stack and stores its data in MySQL or MariaDB. The core of the system is a set of PHP classes that expose a rich RESTful API, an event‑driven plugin architecture, and an extensible data layer that can be swapped for alternative storage backends (e.g., ElasticSearch, ClickHouse).

Language & Frameworks

Database

Web Server

Cache

Overview

Matomo (formerly Piwik) is a self‑hosted, open‑source web analytics platform that offers full control over data collection and reporting. From a developer’s standpoint, it is a PHP‑based application that runs on any LAMP/LEMP stack and stores its data in MySQL or MariaDB. The core of the system is a set of PHP classes that expose a rich RESTful API, an event‑driven plugin architecture, and an extensible data layer that can be swapped for alternative storage backends (e.g., ElasticSearch, ClickHouse).

Technical Stack & Architecture

  • Language & Frameworks: Pure PHP (≥ 7.2) with a modular MVC‑like structure. Core components are organized in plugins/ and libs/, enabling hot‑reloadable extensions.
  • Database: Relational (MySQL 5.5+ / MariaDB) for the core data model; optional support for a dedicated analytics warehouse (e.g., ClickHouse via the Data Warehouse Connector).
  • Web Server: Apache, Nginx, or any server capable of serving PHP; the tracker is a lightweight JavaScript snippet that posts to /piwik.php (or /index.php).
  • Cache: Built‑in caching layers (file, Redis, or Memcached) for query optimization and session handling.
  • Deployment: Docker images are available (official matomo/matomo), and a DDEV environment is bundled for local development. Kubernetes manifests are also published in the community repository.

Core Capabilities & APIs

  • Real‑time Tracking: The JavaScript tracker pushes events via HTTP POST; the backend processes them in near‑real time, populating tables such as visits, events, and actions.
  • REST API: Exposes endpoints for reading reports (/api/?module=API&method=VisitsSummary.get), writing data (via the tracker), and managing configuration (/api/?module=CoreAdminHome&method=Settings.get).
  • Event System: Developers can hook into Tracker and Reporting events (Tracker::on('visit', function($event) {})) to inject custom logic or forward data to external services.
  • Plugin Architecture: Plugins live under plugins/ and can register routes, widgets, reports, and database tables. The plugin API follows a clear contract (initialize(), registerEvents(), getConfig()), allowing third‑party extensions such as GDPR compliance, eCommerce, or custom visualizations.
  • Data Warehouse Connector: A dedicated plugin that streams raw logs to a columnar store (ClickHouse), enabling high‑performance aggregations and long‑term retention without impacting the primary database.

Deployment & Infrastructure

  • Self‑Hosting: Requires a web server, PHP runtime, and MySQL/MariaDB. The installer is wizard‑based but can be scripted; a Composer‑managed source repository allows version pinning.
  • Scalability: Horizontal scaling is achieved by load‑balancing the tracker endpoint across multiple PHP workers and replicating the database layer. The Data Warehouse Connector decouples analytics queries from the transactional DB, enabling near‑unlimited read throughput.
  • Containerization: Official Docker images expose environment variables for DB credentials, site URLs, and caching options. Compose files are available for multi‑container setups (web + DB + Redis).
  • CI/CD: The project publishes GitHub Actions for unit tests and integration tests. Developers can fork the repo, run ./tests/ci.sh, and push PRs that are automatically linted against the test suite.

Integration & Extensibility

  • SDKs: Official PHP SDK for server‑side event tracking; community libraries exist for Python, Node.js, and Go.
  • Webhooks: Matomo can emit webhooks on specific events (e.g., new visitor, conversion), enabling downstream automation.
  • Custom Reports: Developers can create custom report widgets via the API, injecting arbitrary SQL queries or aggregations.
  • Theme & UI: The admin UI is built with Twig templates; developers can override views or create new dashboards.
  • Internationalization: All strings are i18n‑ready; the plugin system supports adding new locales via PO files.

Developer Experience

  • Documentation: The official docs (developer.matomo.org) cover API reference, plugin development guides, and architecture overviews. Inline code comments are extensive, and the community wiki provides real‑world examples.
  • Community & Support: Active GitHub issue tracker, Slack channel, and a dedicated forum. The license (GPL v3+) guarantees no vendor lock‑in.
  • Testing: PHPUnit test suite covers 80 %+ of core code; continuous integration ensures regressions are caught early.
  • Versioning: Semantic versioning with backward‑compatibility guarantees; the CHANGELOG is machine‑parsable for CI pipelines.

Use Cases

ScenarioWhy Matomo?
Privacy‑conscious SaaSFull data ownership, GDPR compliance out of the box.
Enterprise AnalyticsData Warehouse Connector for high‑volume clickstream analysis.
Custom DashboardsPlugin API to expose metrics via Grafana or Kibana.
DevOps MonitoringWebhooks and API enable integration with CI/CD pipelines for real‑time performance metrics.
Educational PlatformsOpen source nature allows modification of tracking logic for learning analytics

Open SourceReady to get started?

Join the community and start self-hosting Matomo today

Weekly Views

Loading...
Support Us

Featured Project

$30/month

Get maximum visibility with featured placement and special badges

Repository Health

Loading health data...

Information

Category
data-analysis
License
GPL-3.0
Stars
20.9k
Technical Specs
Pricing
Open Source
Database
MySQL
Docker
Community
Supported OS
LinuxDocker
Author
matomo-org
matomo-org
Last Updated
1 day ago