label84/laravel-tagmanager
A lightweight Laravel package for Google Tag Manager integration. Configure your GTM container, inject the required scripts, and push data layer events from PHP or Blade with a clean, simple API - no manual snippet handling.
TagManager facade giving a single, testable call site.merge()-on-array fix removes a known sharp edge when composing event payloads from multiple sources (e.g. base product data + user context + promo attributes), which de-risks scheduling analytics work alongside feature work rather than as a separate hardening sprint.Adopt when:
dataLayer, with merge() for combining payload fragments — trivial to unit test and to review in PRs.Look elsewhere when:
To executives: This is a small, free, open-source Laravel library that lets our application tell Google Tag Manager what happened — purchases, signups, funnel steps — using one consistent, code-reviewed mechanism. It replaces ad-hoc tracking snippets scattered across templates with a single, testable integration point, which means faster analytics changes, fewer "the conversion pixel broke" incidents, and less engineering time spent on marketing requests. The v1.5.3 patch fixes a bug where combining event data from multiple sources could silently fail — precisely the kind of silent tracking gap that distorts reporting and spend decisions. Cost is effectively zero; risk is manageable with version pinning.
To engineering: Adopt Label84/laravel-tagmanager as the single sanctioned way to push to dataLayer. Rationale: MIT license, tiny dependency surface, a TagManager facade that makes tracking calls explicit and greppable, and merge() for composing payloads without array-merge boilerplate. Note v1.5.3 corrects merge() behavior when passed an array — worth a quick regression test on any multi-source payload construction (product data + user context + promo). Caveats to own deliberately: single maintainer and low release cadence, so pin the version, add a thin internal wrapper if our event schema stabilizes, and keep an escape hatch — the package is small enough to vendor or reimplement in an afternoon. Keep consent handling and PII hygiene outside this package and in our own layer; do not let raw user identifiers flow into the dataLayer payloads.
How can I help you explore Laravel packages today?