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

Utm Cookie Bundle Laravel Package

medelse/utm-cookie-bundle

A Symfony bundle that stores UTM campaign parameters in a cookie so attribution data survives across requests and redirects. It captures traffic source details and keeps them available for later tracking, lead attribution, or analytics.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit — poor, and the framing needs correcting first. Despite the brief describing this as a "Laravel/PHP package," medelse/utm-cookie-bundle is a Symfony Bundle. It ships a Symfony Bundle class, DI service definitions, and an event subscriber bound to Symfony's HTTP kernel lifecycle. There is no Laravel service provider, no config publishing, no middleware registration, and no facade. In a Laravel codebase it is not installable-and-usable; it is raw material to be read and ported.

The underlying capability is also very small: intercept a request, read a fixed set of query parameters (utm_source, utm_medium, utm_campaign, utm_term, utm_content, plus possibly gclid/fbclid), serialize them, and write a cookie with a configurable TTL. This is on the order of 80–150 lines of application code. The value of the package is therefore almost entirely in the decisions it encodes (which params, first-touch vs. last-touch, cookie name and lifetime, encoding), not in the code volume.

Integration feasibility — technically easy, commercially pointless. A Laravel equivalent is a single global or web-group middleware plus a config file. Any mid-level Laravel engineer can reproduce and improve on this in under a day, with tests. Porting the bundle as-is would mean translating Symfony event subscriber semantics into Laravel middleware and inheriting its assumptions uncritically.

Technical risk — high, concentrated in maintenance and compliance.

  • Abandonment: last release November 2021. No commits, no issues triage, no security response. Score 0.22 and 0 stars/0 dependents confirms no community, no third-party review, and no one else to absorb breakage.
  • Version drift: a 2021-era Symfony bundle will declare constraints around PHP 7.2–8.0 and Symfony 4.4/5.x. Laravel 10/11 require PHP 8.1+/8.2+, so composer require will most likely fail on platform constraints — and forcing it installs code that has never been executed against the runtime we would deploy it on.
  • Compliance exposure: attribution cookies in the EU/UK are non-essential under ePrivacy/GDPR and generally require consent before being set. A 2021 UTM utility of this size almost certainly sets the cookie unconditionally on every request, with no consent hook. That is a legal issue, not a code issue, and it is the single largest risk here.
  • Cookie hygiene: five UTM values plus click IDs easily reach several hundred bytes; naive serialization plus other cookies pushes toward the ~4KB per-domain browser limit, and there is no evidence of Secure, SameSite, or HttpOnly handling beyond Symfony defaults.

Key questions to resolve before any decision:

  1. Does the package gate cookie writes behind a consent signal, or does it write unconditionally? (Assume unconditional until proven otherwise.)
  2. Is attribution first-touch (preserve original) or last-touch (overwrite on each campaign visit)? Marketing stakeholders must pick one explicitly.
  3. Which parameters are in scope — standard UTM only, or also gclid, fbclid, msclkid, affiliate IDs?
  4. Cookie TTL, name, domain scope (root vs. subdomain), and SameSite policy — do these match our existing analytics stack?
  5. Does anything consumer-side (CRM, data warehouse, ad platforms) expect a specific cookie name or payload shape we must remain compatible with?
  6. What is the actual PHP/Symfony constraint set in composer.json, and does it resolve on our runtime?

Integration Approach

Stack fit — do not adopt as a dependency. The correct integration approach for a Laravel application is reimplement, using the bundle only as a reference implementation. Read it, extract the parameter list and cookie conventions, then write idiomatic Laravel: one middleware, one config file, one feature test.

Migration path:

  1. Inventory existing attribution behavior — what the marketing/analytics stack already reads, and whether a UTM cookie is already being set by a tag manager or front-end script. Duplicating this server-side can silently overwrite or conflict with client-side values.
  2. Specify the contract: parameter set, first-vs-last touch, cookie name, TTL, domain, flags (Secure, SameSite=Lax, not HttpOnly if front-end JS must read it).
  3. Implement as app/Http/Middleware/CaptureUtmParameters.php, registered on the web group, reading $request->query() against an allowlist and writing via Laravel's cookie API. Store a timestamp and a source-of-truth marker in the payload.
  4. Gate on consent — make the middleware a no-op unless a consent signal (cookie, session flag, or CMP callback) is present. This is non-negotiable in EU/UK traffic and should be built in from the start rather than retrofitted.
  5. Test with feature tests covering: params present, params absent (cookie preserved, not cleared), repeated visits (touch semantics), oversized/malicious input (length caps, no raw reflection).

Compatibility: treat the Symfony bundle as incompatible-by-default with Laravel 10/11. If a team insists on vendoring it, expect to fork and rewrite — at which point the fork is the codebase you maintain, and the package contributes only its original design choices.

Sequencing: consent policy → attribution spec (marketing sign-off) → middleware implementation → analytics/CRM consumer validation → rollout behind a flag → measurement. Do not start with the package; it is the least important input.

Operational Impact

Maintenance — the burden transfers fully to us. With no upstream, any bug, PHP deprecation, or Laravel upgrade breakage is our problem. The realistic maintenance load for a self-written middleware is near zero; for a vendored abandoned Symfony bundle it is a permanent fork-owner obligation disproportionate to 100 lines of functionality. Opportunity cost is the decisive argument: the cost of writing this exceeds the cost of owning this package within roughly one upgrade cycle.

Support — nonexistent. No maintainer response, no issue history, no documentation beyond a README. Internal engineers cannot escalate. Any incident is entirely first-line.

Scaling — negligible on the happy path, watch the edges. One cookie read and one Set-Cookie per request is trivially cheap; no database, cache, or external call. The real scaling concerns are: (a) cookie size growth as parameters and click IDs accumulate, and (b) header size at the CDN/edge if the cookie is forwarded on every request — ensure it is scoped narrowly and consider excluding it from edge cache keys.

Failure modes to design against:

  • Cookie bloat / truncation: browser silently drops oversized cookies or the header exceeds proxy limits → attribution lost with no error signal.
  • Silent overwrite: a later organic visit with a single stray utm_source replaces a high-value paid attribution record.
  • Consent violation: cookie set pre-consent → regulatory exposure and CMP/legal escalation.
  • Client/server divergence: tag manager sets a cookie of the same name with different semantics → nondeterministic attribution and unresolvable data disputes.
  • PII leakage: a UTM parameter containing an email or identifier (common with partner links) persisted into a cookie and forwarded to third parties.
  • No observability: the package provides no logging or metrics; failures are invisible until revenue reporting looks wrong weeks later.

Ramp-up — low for the work, high for the context. Any Laravel engineer can implement this in half a day. The actual ramp-up cost is cross-functional: aligning marketing, legal/privacy, and analytics on touch semantics and consent gating typically takes longer than the code. Budget days for the spec and hours for the build.

Recommendation: do not adopt medelse/utm-cookie-bundle. Close it at intake on stack mismatch (Symfony vs. Laravel) and abandonment (2021, 0 dependents, 0.22 score). Deliver the same capability as first-party Laravel code with consent gating and tests, using the bundle's README only to confirm the parameter list. Revisit only if the organization standardizes on Symfony, and even then the package's staleness argues for in-house implementation.

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