jeffersongoncalves/laravel-metrics-plausible
Laravel Metrics Plausible brings Plausible Analytics stats into your Laravel app, with a simple, fluent API to fetch pageviews, visitors, and other metrics for dashboards, reporting, and monitoring. Lightweight, easy to configure.
StatsQuery builder, enums for metrics/dimensions/date ranges, and typed exceptions (AuthenticationException, RateLimitException, PlausibleException). The buy decision is really "adopt Plausible + this client" versus "build a reporting pipeline" — this makes the adoption side cost days rather than weeks.pages, entryPages, exitPages)sources, channels, utm)countries, regions, cities, devices, browsers, operatingSystems)goalConversions, customEvents)realtimeVisitors)aggregate and timeseries let you measure adoption of specific features, onboarding steps or campaign landing pages from inside the app, without standing up a second analytics vendor or a warehouse.sites, site, createSite, deleteSite and the goal endpoints make analytics provisionable at signup or tenant creation, enabling white-labeled client reporting as a plan feature or upsell.PLAUSIBLE_BASE_URL supports self-hosted Community Edition and private instances, which is the lever for customers or regions where GA4-style third-party tracking fails legal/security review.spatie/laravel-settings seeded from env is a good default for single-instance use, but it is a signal to validate, not assume, per-tenant site configuration. Confirm override support before committing to a per-tenant analytics roadmap item.Adopt when:
Look elsewhere when:
PM verdict: worth a spike, not a blind dependency. Adopt behind a repository/adapter interface, pin the version, cache aggressively (the presence of RateLimitException tells you 429s are expected), and treat the 1.0.0 maturity and mixed v1/v2 surface as the two risks to retire in the spike.
To executives: We can offer privacy-first, cookieless analytics — hosted in the EU or fully self-hosted — surfaced inside our own product instead of sending customers to a third-party dashboard. Integration cost is days, not a sprint, because this package supplies the client, query builder and error handling. It is a thin, replaceable wrapper, so the lock-in is low and the decision is reversible.
To engineering: A typed Laravel client over Plausible's Stats API v2 plus v1 Sites/Goals, with a fluent StatsQuery builder (metrics, dimensions, filters, ordering, pagination, imports, time labels), ready-made shortcuts for the common dimensions, enums for Metric/Dimension/DateRange/GoalType, and typed exceptions for auth, rate limiting and general failures. Config is seeded from PLAUSIBLE_API_KEY, PLAUSIBLE_SITE_ID and PLAUSIBLE_BASE_URL. Known risks: 1.0.0 maturity, mixed v1/v2 endpoints, plan-gated API access, 429s requiring caching/backoff, and read-only scope — tracking remains a front-end concern.
How can I help you explore Laravel packages today?