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

Data Layer Bundle Laravel Package

lexik/data-layer-bundle

Lexik DataLayerBundle provides a flexible data layer abstraction for Symfony applications, letting you organize and query business data through configurable layers. Lightweight, easy to integrate, and maintained by Lexik.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Analytics and measurement strategy: The package gives a single place to assemble the GTM dataLayer payload in PHP and render it in Twig, instead of hand-writing JSON blobs across templates. That is the technical enabler for the real product decision: whether we standardize an event taxonomy (e.g. view_item, add_to_cart, begin_checkout, purchase) rather than letting each squad invent its own keys.
  • Build vs. buy (and "adopt vs. copy"): At 14 stars, zero dependents, and a last release of February 2018, this is not a strategic dependency. It is a reference implementation of a pattern that costs roughly a day to reproduce. The decision it informs is "do we want a shared internal DataLayer service, and do we vendor this or write our own?"
  • Roadmap input for the ecommerce funnel: If the roadmap includes funnel instrumentation, remarketing/audience rollout, or a tag-manager migration, a centralized data layer is a prerequisite. Dispersed dataLayer.push calls make attribution and conversion reporting unreliable and A/B test bucketing inconsistent.
  • Consent and privacy gating: Centralizing the layer is the cheapest way to enforce "no PII and no marketing tags before consent." A shared service gives you one choke point for GDPR/CCPA gating; scattered template snippets give you none. This is the strongest product argument for the pattern, independent of this specific package.
  • Framework fit as a gating decision: This is a Symfony bundle, not Laravel. If the platform decision is Laravel-first, this package does not apply — the equivalent is a small service class plus a Blade component (or @inertia/view composer) writing a JSON-encoded layer. Do not let a low-effort wrapper drive a framework decision.
  • Not a differentiator: Nothing here is user-facing. Justify it only by the measurement quality and consent compliance it unblocks, never as a headline roadmap item.

When to Consider This Package

Consider it when:

  • The codebase is Symfony 3.x/4.x era and already uses Google Tag Manager, and you want a proven small abstraction rather than inventing one.
  • You need a fast spike to prove out a data-layer shape (keys, event names, ecommerce schema) before committing to a real instrumentation program.
  • You are comfortable pinning an unmaintained dependency and accepting the upgrade cost yourself — treat it as vendored source you now own.
  • Your use case is modest: page-level and simple event payloads rendered server-side, no consent orchestration, no server-side GTM.
  • You want a worked example of Twig + service-container integration to reference while writing your own version.

Look elsewhere when:

  • You are on Laravel. This package does not integrate; its value does not transfer. Budget a day for an in-house DataLayer service, a facade, and a Blade partial instead.
  • You are on modern Symfony (5/6/7) or PHP 8+. Eight years without a release means deprecation drift in the Twig extension and container wiring; expect to fork and patch before you get value.
  • You need server-side GTM, GA4 event modeling, or warehouse-first analytics. A 2018 client-side dataLayer helper does not address that architecture.
  • Consent management is in scope. This package predates serious consent-mode tooling; gating logic will be yours to build, and it must live outside the templates.
  • You need schema validation or typing. There is no contract enforcement here — malformed events fail silently in the tag manager, which is the most expensive failure mode in measurement.
  • Procurement requires a maintained dependency with a support path. Zero dependents and a dormant maintainer means you are the maintainer.

How to Pitch It (Stakeholders)

For executives: This is a small Symfony helper for sending structured event data to Google Tag Manager. The strategic value is not the library — it is the pattern: one governed place where we define what we measure, so marketing, growth, and finance report off the same numbers. The package itself is a 2018 artifact with trivial adoption and no community; I would not fund it as a dependency. I would fund a short instrumentation initiative — an event taxonomy, a consent gate, and a small internal service — and use this repository as a reference for the shape. The measurable payoff is trustworthy funnel and attribution reporting and a defensible consent posture; the cost is roughly one engineer-week and no ongoing vendor risk.

For engineering: This is a thin, unmaintained Symfony bundle that collects an array in a service and renders it into a dataLayer script tag via Twig. Last release Feb 2018, 14 stars, no dependents — treat it as read-only reference, not a composer require. If we are on Symfony, spike it in a branch against our actual Symfony/PHP versions before committing, and expect to fork the Twig extension. If we are on Laravel — which we are — it does not apply at all: we write a DataLayer service with a push()/render() contract, a Blade partial that emits the JSON, and a DataLayerFake for tests. The genuinely hard parts are not the wiring: they are (1) an event schema with validation so bad events fail loudly in CI rather than silently in GTM, (2) consent gating before any marketing tags fire, and (3) a review step so product and marketing cannot add untyped keys ad hoc. Recommend a one-week time-boxed spike covering the service, a schema test, and one instrumented funnel step, then decide on scope.

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.
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table
siberfx/flysystem-wasabi
hollyit/token-replace
ippanelcom/laravel-sdk
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel