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
Tag Bag Bundle

Tag Bag Bundle Laravel Package

setono/tag-bag-bundle

Symfony bundle for centralized tag management. Collect and render analytics, tracking, and marketing tags such as Google Analytics or Facebook Pixel from one place in your templates, keeping scripts organized and easy to control.

View on GitHub
Deep Wiki
Context7

This Symfony bundle integrates the Tag Bag library, letting you collect and render tags—analytics snippets, meta tags, scripts—from anywhere in your application. Register tags through tag bags and tag bag providers, then output them in your templates via Twig.

  • Autoconfigured tag bag providers via Symfony DI
  • Twig functions for rendering collected tags
  • Queue-based tag rendering
  • Ready-made integrations for Google Analytics and Facebook Pixel
  • Configurable tag ordering and output
Frequently asked questions about Tag Bag Bundle
What does setono/tag-bag-bundle do?
It is a Symfony bundle that lets any service collect tags such as scripts, meta tags, and links into tag bags, then render them all at once in Twig templates. It decouples tag generation from your layout so controllers, services, and listeners can add assets without editing templates. The bundle is a thin integration layer over the framework-agnostic setono/tag-bag core library.
How do I install setono/tag-bag-bundle in a Symfony app?
Install it with Composer and register the bundle in your Symfony application, which is the expected integration path for a Symfony bundle. Because the bundle is glue over the core tag-bag library, you will also be adopting that library transitively. Check the package constraints and your Symfony bundle registration file before wiring it into production.
Which PHP and Symfony versions does this bundle support?
The provided material does not list exact PHP or Symfony version constraints, so verify them in the package's composer.json before adopting it. The evaluation recommends checking the PHP and Symfony constraint matrix against your target runtime and pinning both the bundle and the core tag-bag library. Treat the Twig extension and service definitions as the compatibility-critical surface.
Does setono/tag-bag-bundle work with Laravel?
No. It is a Symfony bundle built around Symfony's service container, event subscribers, Twig extension, and configuration tree, so it does not target Laravel. Laravel applications would need a different package or a custom integration. The underlying tag-bag library is framework-agnostic, but this bundle is Symfony-specific.
How do I add a tag from a controller or service?
The bundle lets any service collect tags into tag bags, so controllers, services, and event listeners can add scripts, meta tags, links, and similar assets without touching templates. You inject the relevant tag bag service and add tags during the request lifecycle. Rendering happens centrally at output time rather than at the point of collection.
How do I render collected tags in Twig?
Rendering is handled by the bundle's Twig extension, which outputs the collected tags at the point you choose in your layout. The overview describes rendering all tags at once in Twig templates. Confirm which rendering entry points the bundle covers, such as head, body, and deferred output, by reading the source.
Does it support consent or GDPR gating for scripts?
The provided material does not confirm whether consent and GDPR gating live in this bundle, the core tag-bag library, or must be built by the application. The evaluation explicitly lists this as a key question to resolve before relying on the package for compliance-sensitive tags. Validate conditional rendering against your consent requirements in a spike.
Can I control tag ordering and deduplication?
The evaluation says the abstraction enables ordering, deduplication, and conditional rendering in one place, which is a main reason to use it for e-commerce workloads. It also asks how ordering and deduplication behave under concurrent or edge-cached requests, so test those cases. Do not assume behavior without verifying it in the core library and bundle source.
Is setono/tag-bag-bundle production-ready and well maintained?
The evaluation flags ecosystem maturity as the dominant risk: five stars and zero dependents means little community validation, and the bus factor is likely one. It also notes a future-dated release timestamp as a data anomaly worth confirming against the repository. MIT licensing removes legal friction but does not de-risk abandonment, so assume you may need to own it.
Can I override the Twig extension or rendering without forking?
The evaluation lists this as an open question: whether the rendering layer can be overridden cleanly without forking. Because the bundle is additive and does not own persistence or routing, rollback is trivial if you keep existing template snippets. The recommended approach is to wrap it behind a thin internal TagRenderer-style interface so you are not coupled to Setono's API.
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.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource