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

Piwik Laravel Package

robbrazier/piwik

Laravel package that integrates the Piwik (Matomo) analytics API into your app, providing a simple facade to track visits and query reports, stats, and metrics without writing raw API calls.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

robbrazier/piwik is a thin Laravel adapter around Matomo's PHP tracker (the piwik/piwik-php-tracker library, renamed upstream to Matomo). It ships a service provider, a facade, and a config file that wires environment variables — Matomo base URL, site ID, and an optional token — into the tracker. Release 4.2.0 materially changes one prior characterization: the package is no longer write-only. Two new modules (DevicesDetection, UserCountry) expose Matomo Reporting API read methods (e.g. getUserCountry), meaning the facade now covers a query path back into Matomo, not just fire-and-forget event submission. That is an architectural expansion, not a patch.

Architecture fit. Still a good fit for server-side event tracking: backend conversions, payment/registration events, authenticated flows invisible to matomo.js, and deployments blocking third-party JS. The new reporting modules widen the fit to lightweight in-app reporting — surfacing visitor country or device breakdowns inside an admin dashboard without standing up a separate BI/export path. The fit remains poor for anything resembling a full analytics abstraction or warehouse: the facade still leaks Matomo semantics (doTrackPageView, doTrackEvent, getUserCountry, idSite/period/date argument shapes) directly into application code. 4.2.0 increases that coupling surface by adding report method signatures whose parameters mirror Matomo's Reporting API conventions.

Integration feasibility. Still low for tracking: composer require, publish config, set PIWIK_URL / PIWIK_SITE_ID / PIWIK_TOKEN_AUTH, call the facade. The reporting additions raise the bar slightly. Reporting calls require a token with sufficient scope (not just the tracking token), are subject to Matomo's archiving model, and return data whose freshness depends on whether archives have been processed — so a "working" integration can silently return stale or empty results. Expect the reporting path to take longer to validate than the tracking path.

Technical risk. In ascending order of concern. First, semantic drift: the package is still branded for Piwik, a name Matomo abandoned in 2018, so documentation and issue threads no longer match current Matomo behavior. Second, upstream currency: the tracker library is the real dependency for writes; the adapter's value is only as long as its composer constraints keep it patched. Third, request-path coupling: the underlying tracker performs synchronous outbound HTTP calls — now on two axes. Tracking inline adds latency on writes; reporting inline adds latency and can be slow, because Matomo reporting queries are heavier than ingestion. Both must be moved off the request path. Fourth, new-surface fidelity: the release itself contains a corrective commit removing idSite/period from methods that don't support them, which is evidence that the reporting wrapper's parameter mapping was initially wrong. Assume other methods in these two modules carry similar mismatches and that the failure is silent. Fifth, adoption signal: 110 stars and zero dependents means essentially no third-party production exposure — you are close to being the primary user. 4.2.0 brings a second contributor, a mildly positive bus-factor signal, but the project is still small and volunteer-driven. Sixth, compliance: server-side tracking still transmits IP and identifiers to Matomo; GDPR posture depends on Matomo-side anonymization settings, not this package. Reporting adds a second dimension — stored report data now surfaces in your application UI, so access control on those views is your responsibility.

Key questions to resolve before adoption. Which Laravel and PHP versions do the current release's composer constraints actually support — 4.2.0 ships docs and API changes but no stated framework support bump, so assume the Laravel 9/10 ceiling still applies until verified? Does the reporting path require a broader token_auth scope than the tracking path, and are we willing to hold that token in the app? Are reporting results cached or fetched live on every call, and what is the acceptable staleness given Matomo's archiving cadence? Does the wrapper expose bulk tracking and custom dimensions, or only common pageview/event methods? Is the tracker library version pinned or floating, and do the new modules introduce a separate dependency or version constraint? Does the facade fail loudly or silently on endpoint errors, for both writes and reads? And can the package be isolated behind an internal AnalyticsClient interface so the write and read paths can be swapped independently?

Integration Approach

Stack fit. Any Laravel application on PHP 8.x talking to self-hosted Matomo or Matomo Cloud. It assumes outbound HTTPS egress, a configured site ID, and — for the new modules — a token with reporting scope. It still assumes no Redis, queue, or particular hosting model, which makes trialing easy and means nothing enforces good operational behavior. With 4.2.0 the package now spans two distinct workloads (ingest and query) with different latency, caching, and credential profiles; treat them as two integrations that happen to share a config file.

Migration path. Inbound: applications relying solely on client-side matomo.js add this package for server-only events — a hybrid requiring disciplined setUserId/setCustomUrl correlation or Matomo counts the same journey twice. The new reporting modules also open an inbound reporting path: replacing ad-hoc dashboards or manual Matomo lookups with facade calls, which is the fastest way to realize value from 4.2.0 but also the fastest way to couple a UI to Matomo's report schema. Outbound: applications already calling the Matomo tracker or Reporting API directly can adopt the adapter for config/facade convenience — 4.2.0 makes this more attractive since both directions are now covered — but should plan an exit. Wrap the facade in an internal service so a move to the upstream tracker and Reporting API, or to another backend, is a one-file change per path.

Compatibility. Verify composer constraints against the target Laravel major before committing — the release notes show docs and API additions but no framework support statement, so the prior assumption of a Laravel 9/10 ceiling stands until proven otherwise. On Laravel 11+, expect to override illuminate/support constraints, fork, or skip the package. Note the reporting methods are new and lightly tested (one test added for getUserCountry); budget for validating each method you actually call rather than trusting the module surface.

Sequencing. (1) Stand up a non-production Matomo site and fire a single event end-to-end to confirm URL, site ID, and token wiring. (2) Move the write call behind a queued job with retries and a dead-letter/log path so tracking never blocks a request. (3) Wrap the facade in an internal interface; keep write and read methods behind separate interfaces so they can be replaced independently. (4) Add proxy-aware IP/user-agent resolution. (5) Roll out tracking per-event, starting with highest-value conversions. (6) Only then pilot the reporting modules — one method, one dashboard widget, with an explicit cache TTL in front of it — validating parameter mapping and archive freshness against the Matomo UI for the same period before trusting the output. (7) Document the fork contingency before go-live.

Operational Impact

Maintenance. Still the dominant cost, and 4.2.0 slightly increases it while slightly improving the outlook. On the positive side, a second contributor is actively working the package, and the release includes tests and doc updates — evidence of maintenance rather than abandonment. On the negative side, the package now covers a larger, faster-moving slice of Matomo's API surface (reporting methods change more often than the tracking endpoint), so the surface you must regression-test on each Matomo upgrade has grown. Assume low bus factor and no guaranteed response to Laravel or Matomo breaking changes. Budget for owning a fork: pinning the tracker dependency, patching composer constraints at each Laravel upgrade, and reviewing Matomo Reporting API changes for the specific methods you call. The cost lands on whoever owns the analytics integration, not the platform team.

Support. Community-only with a small issue surface. No dependents means no shared operational knowledge — no blog posts on production failure modes, no downstream patches to borrow. The corrective commit in 4.2.0 is a useful signal: defects in the new modules are likely to be found by users, not by the maintainer, so file issues rather than working around them silently. Internal documentation is the support contract; write it at integration time, and record which reporting methods you depend on so an upstream rename is a known blast radius.

Scaling. Tracking still sends one HTTP request per call, so event volume translates directly into requests against Matomo and into latency if inline; queueing is mandatory above trivial volume. Reporting scales differently and worse: each call hits Matomo's archiving and query layer, which is expensive and not designed for per-request application traffic. Never call reporting methods on a user-facing request path without a cache — a dashboard refreshing per pageview against an unarchived period will both slow your app and load the Matomo host. Watch Matomo's ingestion and archiving limits (--concurrent-archivers, database growth) as event count grows; the bottleneck moves from the Laravel app to the Matomo host. Multi-environment config drift (site IDs and tokens per environment) remains a common and silent source of polluted data and confusing empty reports.

Failure modes. Matomo unreachable or slow → request-path timeouts if not queued, or dropped events if errors are swallowed. Token misconfiguration → now two distinct failure profiles: insufficient scope silently rejects reporting calls while pageviews succeed, and mixed-scope tokens can make writes work and reads return partial or empty data. Reporting-specific: an unarchived or partially archived period returns plausible-looking but incomplete numbers — the most dangerous failure mode in this release, because it is indistinguishable from a real decline. Proxy misconfiguration → all traffic geolocated to the load balancer and deduplicated incorrectly, which corrupts UserCountry output specifically. Duplicate tracking → double-counted conversions where JS and PHP both fire. Version skew → facade methods that exist but no longer map cleanly to current Matomo parameters, failing quietly. Design for observability: log send failures, count events queued vs. delivered, alert on a drop to zero, and for reporting, log cache hits/misses plus the requested period and archive status so stale data is visible rather than assumed.

Ramp-up. For a Laravel developer, a few hours to first event and roughly one to three days to a production-hardened tracking integration including queueing, correlation, compliance settings, and abstraction. The reporting modules add a separate ramp: half a day to a working call, and longer to trust it — validating parameter semantics, archive freshness, caching, and access control on the resulting views. For a team unfamiliar with Matomo, add time for the Matomo-side model — sites, visits vs. actions, token auth scopes, archiving, and anonymization — because most integration mistakes are Matomo configuration mistakes surfaced through this package rather than defects in it. Net read on 4.2.0: a genuine capability expansion with a modestly better maintenance signal, but not a change to the core framing. Treat adoption as "take a small dependency and accept ownership of it," now with a larger surface to own, and confirm that framing with the team before the first commit.

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.
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
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels