waaseyaa / analytics
Shared Umami analytics integration for Waaseyaa apps — backend sender, JS helpers, and Twig partial.
Requires
- php: >=8.5
This package is auto-updated.
Last update: 2026-07-10 21:38:27 UTC
README
Layer 0 — Foundation
Shared Umami analytics integration for Waaseyaa apps.
Provides a server-side UmamiClient that proxies pageview and event records through the host server (avoiding browser-side ad-blocker collisions) and a tiny JS helper for client-side event reporting. No tracking scripts are loaded automatically — hosts opt in by injecting the bundled Twig partial and configuring the Umami URL.
Key classes: UmamiClient, Transport (interface), StreamTransport (default implementation).
Extension points
UmamiClient accepts two optional trailing constructor parameters that do not affect existing callers:
?Transport $transport = null— replaces the built-inStreamTransport(afile_get_contents+stream_context_createPOST). ImplementWaaseyaa\Analytics\Transportto swap in a different HTTP backend (e.g. cURL, async, test spy).Transportis marked@api.?\Closure $logger = null— a zero-dependency logger sink with the signature(string $message, array $context = []): void. When provided, it receives a message on both the misconfig early-return path (emptytrackerUrl/siteId) and any failed-send or transport-exception path.null(default) preserves the original silent fail-open behaviour.
This package has no waaseyaa/* dependencies — require is php >=8.5 only.