Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Marketing Kit Bundle

CI Packagist Version Packagist Downloads License PHP Symfony GitHub stars Coverage

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.

FrankenPHP Friendly Worker Mode

This bundle is FrankenPHP worker mode friendly.

Features

  • Providers (v1)gtm, ga4, meta_pixel, linkedin, tiktok, hotjar, clarity, custom
  • YAML profilesdefault_profile + profiles (REQ-CFG-001)
  • Database overrideuse_database_config: true replaces YAML tools when DB rows exist for the profile
  • Twig helpersnowo_marketing_head(), nowo_marketing_body_start(), nowo_marketing_body_end()
  • CookieConsent-compatible — reads Cookie_Category_{analytics|marketing} (soft dependency)
  • Admin CRUD/admin/marketing to configure services (seed catalog, import YAML, toggle, typed option fields)
  • Admin securitysecurity.access_roles / custom access_checker (demo-only allow_unauthenticated)
  • Embeddable admin UIweb_ui.layout_template + css_framework for host layouts

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).

Version information

Version PHP Symfony Status
1.2.x >= 8.2, < 8.6 7.4 – 8.x Stable
1.1.x >= 8.2, < 8.6 7.4 – 8.x Maintenance
1.0.x >= 8.2, < 8.6 7.4 – 8.x Maintained

Installation

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

Requirements

  • PHP >= 8.2, < 8.6
  • Symfony >= 7.4 || >= 8.0
  • Doctrine ORM (for entities / optional DB config)

Quick configuration

# config/packages/nowo_marketing_kit.yaml
nowo_marketing_kit:
    use_database_config: false
    respect_cookie_consent: true
    security:
        access_roles: ['ROLE_ADMIN']
        allow_unauthenticated: false
    web_ui:
        layout_template: '@NowoMarketingKitBundle/admin/layout.html.twig'
        css_framework: none
    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'

Demos

make -C demo up-symfony8
# Demo started at: http://localhost:8060

Documentation

Additional documentation

Tests and coverage

Language Lines (approx.) Command
PHP 100% make test-coverage
TypeScript N/A
Python N/A
composer test
composer test-coverage

About

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.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages