Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Matomo Tracker Laravel Package

alfrasc/laravel-matomo-tracker

Server-side Matomo analytics for Laravel. Track page views, events, goals, and e-commerce without client-side JavaScript, with a fluent API, configurable sites, and user attribution.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. The package is a thin Laravel service-provider wrapper around matomo/piwik-php-tracker, exposing config (Matomo URL, site ID, optional token) and a facade for firing server-side tracking hits (pageviews, events, goals) from controllers, jobs, or console commands. That is the right shape for Laravel: container-bound singleton, publishable config, env-driven credentials. Its real value is closing the gap between browser-only Matomo tracking and backend-only business events (signups, payments, provisioning, webhook-driven state changes) that never touch a pageview.

Integration feasibility. Low-friction on paper: composer require, publish config, set MATOMO_URL/MATOMO_SITE_ID, inject the tracker. The implementation surface is small, so a spike can be done in under a day against a non-production Matomo instance. The friction is entirely in the boundary conditions, not the happy path.

Technical risk. This is the dominant concern:

  • Abandonment. Last release November 2021, 20 stars, single maintainer. The package predates Laravel 10/11 and PHP 8.2/8.3; Composer constraints will likely need --ignore-platform-reqs, a fork, or an inline vendoring of the ~few-hundred-line wrapper.
  • License ambiguity. NOASSERTION means no recognized SPDX license was detected. Legal cannot approve this for a commercial codebase without clarification from the author or a clean-room reimplementation. For a package this small, reimplementation is often cheaper than the legal review.
  • Hidden dependency risk. Behavioral risk sits in matomo/piwik-php-tracker, not this wrapper. That library is maintained, but the pinned constraint here will drift from current releases.
  • Synchronous HTTP in the request path. Default usage fires a blocking call to Matomo. Without explicit timeouts and queueing, you couple request latency and availability to your analytics backend — an anti-pattern for anything user-facing.
  • No first-class consent/queue/batching semantics. These must be built around the package regardless.

Key questions.

  1. What is the actual license, and who can grant written clarification?
  2. Which Laravel/PHP versions are exercised in CI, and does it pass on our target matrix?
  3. Is our Matomo self-hosted or cloud, and which version — does the underlying tracker's API match?
  4. Are these events product analytics (tolerant of loss) or business metrics (revenue, conversions) that need durability guarantees?
  5. What is event volume per minute at peak, and can our Matomo instance absorb it?
  6. What is the consent model, and do we need IP anonymization / data minimization at the tracker layer?
  7. If the maintainer disappears, who owns the fork, and is that acceptable to legal and security?

Integration Approach

Stack fit. Best fit is Laravel 8/9 on PHP 7.4–8.1 with a self-hosted Matomo 4.x. On Laravel 10/11 + PHP 8.2+, assume you are forking or wrapping, not consuming as-is. Treat the package as a reference implementation of the Matomo tracking API rather than a dependency you inherit.

Migration path. Do not let the facade leak into application code. Define a narrow internal contract (e.g. AnalyticsTracker::event(string $category, string $action, ?string $label, ?float $value)) with a Matomo-backed implementation. That gives three exits with near-zero refactor cost: keep the package, swap to matomo/piwik-php-tracker directly, or swap to a raw HTTP call against Matomo's Tracking API. Also define an event taxonomy up front — retrofitting consistent category/action naming after launch is far more expensive than the integration itself.

Compatibility. Pin the package exactly, then explicitly constrain and test the transitive tracker version. Verify against the target PHP minor, not just the major. Check for facade alias collisions and confirm the config publish does not overwrite existing config/matomo-tracker.php in multi-tenant or modular setups. If on Laravel 10+, budget for a fork with updated illuminate/support constraints — a one-line change, but one that must be owned and re-applied on every upstream tick.

Sequencing.

  1. License and security review; decide fork-vs-vendor-vs-reimplement (recommend reimplement if license is unresolved).
  2. Spike in a branch against a non-prod Matomo, validating site ID routing and that hits land in the correct site and visit scope.
  3. Introduce the internal tracker contract and event taxonomy; wire the Matomo implementation behind it.
  4. Move dispatch to the queue with retries, backoff, and a dead-letter path; set aggressive connect/response timeouts.
  5. Add consent gating and PII scrubbing at the contract boundary, not inside the vendor call.
  6. Roll out behind a feature flag with a small percentage of events, reconcile counts against Matomo's own reports.
  7. Only then remove the direct-call fallback.

Operational Impact

Maintenance. Effectively zero upstream velocity. Plan on owning a fork: pin it, mirror it internally, and accept that dependency bumps are yours to make. The code volume is small enough that this is a half-day per year, but it must be explicitly assigned — unowned forks rot silently and break on the next PHP upgrade.

Support. No vendor, no SLA. Community support consists of a 20-star repo and a sole maintainer's goodwill. Internal runbooks and a named owner are mandatory; do not let this become tribal knowledge held by whoever did the initial spike.

Scaling. The default synchronous call is the scaling bottleneck, not Matomo's ingestion. At meaningful event volume you will need queue workers with concurrency limits, batching via Matomo's bulk tracking endpoint, and backpressure so a Matomo outage does not produce an unbounded job backlog. Size the queue and the Matomo instance together; server-side tracking can easily multiply request volume beyond what a lightly-provisioned Matomo expects.

Failure modes.

  • Matomo unreachable with no timeout → elevated p95/p99 latency or request timeouts. Mitigate with strict timeouts and circuit-breaking.
  • Silent failure — the tracker typically does not throw on a rejected hit → invisible data loss. Mitigate with response-code logging and periodic count reconciliation against Matomo reports.
  • Misconfigured site ID or URL in one environment → events land in the wrong property, corrupting historical data. Mitigate with startup validation and per-environment config assertions.
  • token_auth exposure → privileged API access leakage. Keep it out of the tracking path entirely; tracking hits do not need it.
  • Consent regression → compliance exposure. Gate at the contract layer so no future call site can bypass it.
  • Fork drift → breakage on the next Laravel/PHP upgrade, discovered late. Mitigate with a scheduled dependency-review job.

Ramp-up. A Laravel developer can integrate the happy path in a few hours; the facade and config are self-explanatory. The real ramp-up cost is elsewhere: Matomo's data model (sites, visits, visit scope vs. page scope, goals), event taxonomy design, and consent semantics. Budget days, not hours, for a team new to Matomo — and note that the wrapper hides none of Matomo's conceptual complexity. Given the license ambiguity and 2021 vintage, the pragmatic recommendation is to reimplement the thin wrapper internally against matomo/piwik-php-tracker (or the raw Tracking API): roughly identical effort, no license risk, no bus factor, and full control over queueing, timeouts, and consent.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log