t3g/symfony-usercentrics-bundle

Integration of usercentrics.com for Symfony

Maintainers

👁 typo3com

Package info

github.com/TYPO3GmbH/symfony-usercentrics-bundle

Type:symfony-bundle

pkg:composer/t3g/symfony-usercentrics-bundle

Statistics

Installs: 21 272

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

2.1.0 2026-04-28 05:52 UTC

Requires

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT cd3bbf77b48897cb954d6d3c293797127a7367ed

This package is auto-updated.

Last update: 2026-06-28 13:29:15 UTC


README

This bundle provides a usercentrics.com implementation into Symfony.

Installation

Install this bundle via composer: composer req t3g/symfony-usercentrics-bundle

Configuration

Create a file config/packages/usercentrics.yaml that contains the following configuration:

usercentrics:
 id: xxxxxxxxx

Usage in Templates

At first, the usercentrics main library must be included. For this, the Twig function usercentrics() may be invoked without any additional arguments:

{{ usercentrics() }}

After that, additional Data Service Providers (DSP) may be included as well. See the following example for Google Analytics:

{{ usercentrics('Google Analytics', {async: true, src: 'https://www.googletagmanager.com/gtag/js?id=UA-XXXXXXXX-X'}) }}
{{ usercentrics(
 'Google Analytics',
 {},
 '
 window.dataLayer = window.dataLayer || [];
 function gtag(){dataLayer.push(arguments);}
 gtag(\'js\', new Date());

 gtag(\'config\', \'UA-XXXXXXXX-X\');
 '
) }}