setono/google-analytics-server-side-tracking-bundle
A Symfony bundle for sending Google Analytics events server-side via the Measurement Protocol, helping you capture purchases, conversions, and interactions from your backend even when client-side JavaScript tracking is blocked or unavailable.
Architecture fit. Unchanged by this release. Despite the brief framing this as a "Laravel/PHP package," it is a Symfony bundle, not a Laravel package. It registers services, configuration trees, and compiler passes against the Symfony kernel. Laravel reuses Symfony components but does not consume bundles; there is no service provider bridge, no auto-discovery, and no config translation layer. Adopting it as-is in a Laravel codebase is not viable — the realistic path is extracting its core tracking logic (client-ID handling, payload assembly, dispatch, and now bot filtering) into a Laravel-native service. Budget for this as a port, not an install.
Integration feasibility. Low-to-moderate, unchanged. The functional core — building a Measurement Protocol payload and POSTing it server-side — is small and well-understood; a competent engineer can replicate the useful 20% in a day or two. The bundle's value-add is Symfony wiring (DI, config, event subscribers, plausibly a Doctrine-based client-ID store), most of which is disposable in a Laravel context. v0.3.9 adds a genuinely useful piece of domain logic (user-agent filtering) but it is ~tens of lines, not an architectural dependency. Treat the repository as reference implementation and design input, not as a dependency.
What v0.3.9 changes. Two PRs: an empty-user-agent filter and a configurable user-agent filter. Both are bot/traffic-quality filtering — a real gap in the original assessment, where bot filtering was listed as work that had shifted from the browser to us. This is welcome, but it is a narrow, incremental feature:
Technical risk. Still the dominant concern, though the abandonment sub-risk moves from severe to high:
tid/cid/t=pageview). GA4 uses a different endpoint and payload contract (measurement_id/api_secret, client_id, events[]). v0.3.9 does not change this. Confirm before anything else.Key questions for the maintainer or code review:
api_secret configurable? (Still unanswered — the blocking question.)client_id generated and persisted across requests/sessions, and where (cookie, DB, cache)?Stack fit. Poor for a Laravel shop, unchanged. Symfony bundle ≠ Laravel package, and the version constraints from a 2022-era release will likely collide with modern Laravel/Symfony dependency trees if forced in via a compatibility shim. Do not attempt to install it into a Laravel app; do not stand up a Symfony sidecar purely to host it — that adds an operational surface for a few hundred lines of logic.
Recommended path — reimplement, don't adopt. Unchanged, and v0.3.9 strengthens the case rather than weakening it: the useful additions are small, self-contained pieces of domain logic that port cleanly. Build a small internal AnalyticsServerSide service in Laravel: a queued job that assembles a GA4 Measurement Protocol payload, resolves/persists client_id, injects consent state, strips PII, applies a user-agent/bot filter, and POSTs with retry and dead-lettering. Use this repository to shortcut design decisions (payload shape, client-ID strategy, config surface, filter patterns) and to sanity-check edge cases; cite it as prior art in the ADR.
Compatibility. Pin the GA4 Measurement Protocol contract (/mp/collect, measurement_id, api_secret, client_id, events[], user_properties). Verify request size and event-count limits; validate with GA4 DebugView before production. If the business genuinely still needs UA-format hits, stop — UA is sunset and that requirement should be challenged.
Sequencing:
composer.json version constraints against our Laravel/PHP target.Maintenance. Adopting the package still means owning a fork on day one. v0.3.9 softens the "no upstream releases" objection but does not remove it: no guaranteed PHP 8.3/8.4 or Symfony 7 support, no CVE response, no triage SLA. Reimplementation remains less maintenance because we own a small, tested surface we understand. Either way, someone must own GA4 protocol changes — Google revises Measurement Protocol behavior without much notice.
Support. No vendor, no SLA, 4 stars and 0 dependents means effectively no community to escalate to. The recent activity is a single contributor, not a support structure. Internal knowledge must be documented in the ADR; do not let it live in one engineer's head.
Scaling. Server-side moves load from the user's browser to our infrastructure. Non-negotiable design points:
Failure modes to plan for:
Ramp-up. Low technical ceiling, non-trivial domain ceiling. Any mid-level Laravel engineer can implement the HTTP call and the filter; the hard parts are analytics semantics (client-ID/session stitching, event naming parity, consent, traffic-quality thresholds) and compliance review. Plan for a TPM/analytics owner plus a legal/privacy review before production, not just engineering time. Given the maturity signals — a low-cadence maintainer, UA-era design, zero adoption, and a feature release that fixes a gap but not the blocking one — the honest recommendation is unchanged: reference-only, do not depend, and size the work as a 1–2 week internal build plus validation, not a package integration.
How can I help you explore Laravel packages today?