⭐ Found this useful? Give it a star on GitHub! It helps us maintain and improve the project.
Symfony marketing kit: install and configure GTM, GA4, Meta Pixel, LinkedIn Insight, TikTok Pixel, Hotjar, Microsoft Clarity, and custom snippets via YAML profiles and/or Doctrine, with CookieConsent-compatible category gating.
This bundle is FrankenPHP worker mode friendly.
- ✅ Providers (v1) —
gtm,ga4,meta_pixel,linkedin,tiktok,hotjar,clarity,custom - ✅ YAML profiles —
default_profile+profiles(REQ-CFG-001) - ✅ Database override —
use_database_config: truereplaces YAML tools when DB rows exist for the profile - ✅ Twig helpers —
nowo_marketing_head(),nowo_marketing_body_start(),nowo_marketing_body_end() - ✅ CookieConsent-compatible — reads
Cookie_Category_{analytics|marketing}(soft dependency) - ✅ Admin CRUD —
/admin/marketingto configure services (seed catalog, import YAML, toggle, typed option fields)
FrankenPHP: Demos use a single PHP service (FrankenPHP, no nginx). Runtime mode is controlled by FRANKENPHP_MODE in .env (worker default, or classic). The entrypoint selects Caddyfile (workers) or Caddyfile.dev (no workers) accordingly; see docs/DEMO-FRANKENPHP.md. Demo URL: http://localhost:8060 (see demo/README.md and .env.example).
composer require nowo-tech/marketing-kit-bundle{# templates/base.html.twig #}
<head>
{{ nowo_marketing_head() }}
</head>
<body>
{{ nowo_marketing_body_start() }}
{% block body %}{% endblock %}
{{ nowo_marketing_body_end() }}
</body>Optional GDPR gate (recommended):
composer require nowo-tech/cookie-consent-bundle# config/packages/nowo_marketing_kit.yaml
nowo_marketing_kit:
use_database_config: false
respect_cookie_consent: true
default_profile: default
profiles:
default:
enabled: true
tools:
gtm:
type: gtm
enabled: true
category: analytics
position: head
options:
container_id: '%env(default::GTM_ID)%'
gtm_noscript:
type: gtm
enabled: true
category: analytics
position: body_start
options:
container_id: '%env(default::GTM_ID)%'
meta_pixel:
type: meta_pixel
enabled: false
category: marketing
position: head
options:
pixel_id: '%env(default::META_PIXEL_ID)%'Import admin routes when using the database admin:
# config/routes/nowo_marketing_kit.yaml
nowo_marketing_kit:
resource: '@NowoMarketingKitBundle/Resources/config/routing.yaml'- PHP >= 8.2, < 8.6
- Symfony >= 7.4 || >= 8.0
- Doctrine ORM (for entities / optional DB config)
- Installation
- Configuration
- Usage
- Contributing
- Code of Conduct
- Changelog
- Upgrading
- Release
- Security
- Engram
- Spec-driven development
- GitHub Spec Kit
- GitHub Actions CI requirements
- Demo with FrankenPHP (includes worker mode)
- Server cookbook (Nginx, php-fpm, FrankenPHP)
| Version | PHP | Symfony | Status |
|---|---|---|---|
| 1.0.0 | >= 8.2, < 8.6 | 7.4 – 8.x | Stable |
make -C demo up-symfony8
# Demo started at: http://localhost:8060| Language | Lines (approx.) | Command |
|---|---|---|
| PHP | 100% | make test-coverage |
| TypeScript | N/A | — |
| Python | N/A | — |
composer test
composer test-coverage