Skip to main content

Matomo Analytics for Laravel

Privacy-first Matomo tracking for Laravel. The package covers both sides of a Matomo integration — the server-side Tracking API and the client-side JavaScript tracker — plus the read-side Reporting API, the GDPR data-subject tools and the Annotations plugin. It works identically against a self-hosted Matomo and Matomo Cloud: only the host differs.

Three properties shape every design decision in it:

  • A tracking error never surfaces in your application, and in queue and batch mode the hits are delivered out of band, so tracking does not block a response either. (sync mode sends inline by design — see transmission modes.)
  • It is built not to lose hits. Queued jobs retry with escalating backoff; the batch buffer keeps hits until Matomo confirms a 200; a batch that cannot be delivered lands in a dead-letter table you can inspect and re-queue. There is one precondition worth knowing before you pick the redis driver — an instance allowed to evict its keys drops buffered hits with every signal staying green. See reliability.
  • It is private by default. Cookieless visitor identification, Do-Not-Track and Sec-GPC honored server-side, URL redaction on by default, and bots and AI crawlers excluded unless you ask for them.

Start here

  • Installationcomposer require, matomo:install, the two environment variables that switch tracking on, and the connectivity check.
  • Configuration — how the published config file relates to the package defaults, which settings belong in .env, and what each block covers.
  • Matomo Cloud — the same code path as self-hosted, plus the three Cloud-specific things worth knowing.

Tracking

Delivery

  • Transmission modesqueue, sync and batch, and what changes operationally when you pick one.
  • Scaling — where the real ceiling is, the load simulator, and how the package composes with Matomo's QueuedTracking plugin.
  • Reliability — retries, throttled alerting, poison batches and the dead-letter queue.

Privacy and gating

Reading data back

Reference

Guides

Requirements

  • PHP 8.4+
  • Laravel 12 or 13

The package depends on focused illuminate/* components rather than the whole framework, so it stays light in an application that only needs part of Laravel.

License and source

MIT. The source lives at github.com/pushery/matomo-analytics-for-laravel; vulnerabilities go to the security policy rather than a public issue. Built and maintained by PUSHERY.