simplestats-io/laravel-client
A lightweight Laravel client for Simple Stats, the privacy-friendly, cookie-free analytics platform. Track pageviews and custom events from your app using a clean API, Blade directives, and middleware, with GDPR-friendly defaults, simple configuration, and no complex setup required.
Verdict: update warranted. v5.1.0 is a minor version bump but introduces (a) a meaningful new capability that changes where data comes from, (b) a new public HTTP surface on the host application, and (c) a de facto breaking change for anyone subclassing the tracking middleware. All three are worth recording before rollout.
Architecture fit
Referer carries the full URL and query string, so page path and utm_* are derived server-side without JavaScript; only external referrer needs document.referrer. The <noscript> pixel is a real fallback rather than decoration.Integration feasibility
beacon block, add the layout snippet, choose the path, verify with the cache enabled. Off by default and inert without the config key, so the upgrade itself is a no-op.Referrer-Policy review, catch-all route precedence, WAF/bot-management allowlisting, and multi-domain/www vs apex handling (the design requires the pixel request to be same-origin with the page).Technical risk
CheckTracking::getPage() and CheckTracking::doTracking() gained an optional parameter. Optional parameters are not compatible with overrides that omit them — PHP fatals with an incompatible declaration. It fails loudly at boot rather than silently, which is the better failure mode, but it is a hard error shipped in a minor. Any project that subclasses the middleware, or wraps it in a shared internal package, must audit before upgrading. Worth raising with the vendor: a new method, a variadic, or a major bump would have been safer.Referer header is client-controlled, so the foreign-domain check reduces accidental inflation from scraped or mirrored HTML, not deliberate abuse. Confirm what throttling exists and whether the endpoint can be scripted to burn API quota.fetch calls, and sites that leave the snippet on pages PHP also serves. Silent double counting or silent undercounting both corrupt trendlines without raising an error.middleware_groups, and can be swallowed by a catch-all route, blocked by ad-blocker path heuristics, blocked by a WAF, cached by the CDN, or stripped by Referrer-Policy. Every one of these degrades to "fewer or zero visits," which looks like a traffic drop rather than a bug.track, stats, analytics, beacon, collect, pixel, and avoids file extensions so the CDN does not cache it. The default assets/v is a deliberate evasion of blocklists and will need revisiting if list maintainers catch up. Budget for re-testing after blocklist updates.Key questions
route:cache, and does it take precedence over a catch-all route in the supported configurations?Referrer-Policy values are known-good and known-bad, and what is the observable symptom when it is misconfigured (missing page path only, or no visit at all)?www/apex sites where "same origin" is not a single value?Stack fit
env(). Fits Laravel 9–12-era projects and Statamic add-on installs without an adapter layer.<noscript> image; no build step, no framework coupling, safe to drop into an Antlers/Blade layout or a shared partial.Migration path
^5.1. The release is inert until the config block and template snippet are added, so the code upgrade and the feature enablement can be separate deploys — use that.beacon block to the published config/simplestats-client.php, or republish. Prefer hand-editing or a documented diff; vendor:publish --force overwrites local customisations. Then php artisan config:clear / config:cache on deploy.SIMPLESTATS_BEACON_ENABLED per environment so staging can be validated against production-like caching.5.0.x until the override is retired. Add a boot/smoke test that boots the app so an incompatible declaration is caught in CI rather than at deploy.Compatibility
Referrer-Policy review.navigator.sendBeacon is explicitly unsupported (POST-only), so the provided fetch(..., { keepalive: true }) pattern must be used verbatim; ad-blocker heuristics on path naming; WAF/bot-management scoring of cookie-less image requests; catch-all routes shadowing the endpoint.?utm_source[]=x style payloads from being rejected upstream. Low compatibility risk, but it is a validation change and belongs in release notes for anyone constructing those parameters programmatically.Sequencing
CheckTracking; search for existing server-side tracking assumptions on cached pages.^5.1, clear/rebuild config and route caches, deploy with the beacon off. Verify no route or boot regressions.utm_* values, verify the <noscript> path separately by disabling JS.Maintenance
Referrer-Policy settings that made the beacon work are now load-bearing and must not be changed casually by other teams.Support
Referrer-Policy, catch-all route precedence, or a config block that never made it into the deployed config. Publish a short triage runbook mapping symptom → cause → check.Scaling
Failure modes
Referrer-Policy: no-referrer, catch-all route shadowing, stale route:cache, or a config block missing from a deployed environment. None raise errors; all present as a traffic decline.Referer; do not treat these numbers as adversarially robust.Ramp-up
www/apex routing, a strict Referrer-Policy, an aggressive WAF/bot-management tier, or a strict change-approval process for CDN rules: 2–3 days of engineering plus cross-team coordination with whoever owns CDN/WAF/security, and a longer validation window.Referrer-Policy. If nobody on the team can answer those, that gap is the real ramp-up cost.How can I help you explore Laravel packages today?