itzbund / gsb-consent
Consent management for websites. This is part of the Government Site Builder (GSB) 11. The GSB 11 is a measure of the Dienstekonsolidierung Bund (DKB) of the Federal Ministry of the Interior and for Homeland (BMI) and is carried out on behalf of the Information Technology Center of the Federal Gover
Package info
gitlab.opencode.de/bmi/government-site-builder-11/extensions/gsb_consent
Type:typo3-cms-extension
pkg:composer/itzbund/gsb-consent
Requires
- php: ^8.3
- typo3/cms-core: ^13.4
- typo3/cms-extbase: ^13.4
- typo3/cms-frontend: ^13.4
Requires (Dev)
- ergebnis/composer-normalize: ^2.47.0
- helmich/typo3-typoscript-lint: ^3.3.0
- phpmd/phpmd: ^2.13
- shipmonk/composer-dependency-analyser: ^1.8
- ssch/typo3-rector: ^3.5
- typo3/coding-standards: ^0.8
- typo3/testing-framework: ^8.2
Suggests
- itzbund/gsb-core: Direct dependency is not needed but this ensures installation order.
- 12.x-dev
- v2.1.10-rc.2
- v2.1.10-rc.1
- v2.1.9
- v2.1.8
- v2.1.7
- v2.1.6
- v2.1.5
- v2.1.4
- v2.1.3
- v2.1.2
- v2.1.1
- v2.1.0
- v2.1.0-rc.8
- v2.1.0-rc.7
- v2.1.0-rc.6
- v2.1.0-rc.5
- v2.1.0-rc.4
- v2.1.0-rc.3
- v2.1.0-rc.2
- v2.1.0-rc.1
- v2.0.0
- v2.0.0-rc.22
- v2.0.0-rc.21
- v2.0.0-rc.20
- v2.0.0-rc.19
- v2.0.0-rc.18
- v2.0.0-rc.17
- v2.0.0-rc.16
- v2.0.0-rc.15
- v2.0.0-rc.14
- v2.0.0-rc.13
- v2.0.0-rc.12
- v2.0.0-rc.11
- v2.0.0-rc.10
- v2.0.0-rc.9
- v2.0.0-rc.8
- v2.0.0-rc.7
- v2.0.0-rc.6
- v2.0.0-rc.5
- v2.0.0-rc.4
- v2.0.0-rc.3
- v2.0.0-rc.2
- v2.0.0-rc.1
- v2.0.0-beta.40
- v2.0.0-beta.39
- v2.0.0-beta.38
- v2.0.0-beta.37
- v2.0.0-beta.36
- v2.0.0-beta.35
- v2.0.0-beta.34
- v2.0.0-beta.33
- v2.0.0-beta.32
- v2.0.0-beta.31
- v2.0.0-beta.30
- v2.0.0-beta.29
- v2.0.0-beta.28
- v2.0.0-beta.27
- v2.0.0-beta.26
- v2.0.0-beta.25
- v2.0.0-beta.24
- v2.0.0-beta.23
- v2.0.0-beta.22
- v2.0.0-beta.21
- v2.0.0-beta.20
- v2.0.0-beta.19
- v2.0.0-beta.18
- v2.0.0-beta.17
- v2.0.0-beta.16
- v2.0.0-beta.15
- v2.0.0-beta.14
- v2.0.0-beta.13
- v2.0.0-beta.12
- v2.0.0-beta.11
- v2.0.0-beta.10
- v2.0.0-beta.9
- v2.0.0-beta.8
- v2.0.0-beta.7
- v2.0.0-beta.6
- v2.0.0-beta.5
- v2.0.0-beta.4
- v2.0.0-beta.3
- v2.0.0-beta.2
- v2.0.0-beta.1
- dev-main / 1.x-dev
- v1.7.11
- v1.7.10
- v1.7.9
- v1.7.8
- v1.7.8-rc.1
- v1.7.7
- v1.7.6
- v1.7.5
- v1.7.4
- v1.7.3
- v1.7.2
- v1.7.1
- v1.7.0
- v1.7.0-rc.1
- v1.6.4
- v1.6.4-rc.2
- v1.6.4-rc.1
- v1.6.3
- v1.6.2
- v1.6.2-rc.1
- v1.6.1
- v1.6.1-rc.1
- v1.6.0
- v1.6.0-rc.2
- v1.6.0-rc.1
- v1.5.1-rc.1
- v1.5.0
- v1.5.0-rc.1
- v1.4.3-rc.2
- v1.4.3-rc.1
- v1.4.2
- v1.4.1
- v1.4.0
- v1.4.0-rc.1
- v1.3.7
- v1.3.6
- v1.3.5
- v1.3.5-rc.1
- v1.3.4
- v1.3.3
- v1.3.3-rc.2
- v1.3.3-rc.1
- v1.3.2
- v1.3.2-rc.1
- v1.3.1
- v1.3.1-rc.5
- v1.3.1-rc.4
- v1.3.1-rc.3
- v1.3.1-rc.2
- v1.3.1-rc.1
- v1.3.0
- v1.3.0-rc.4
- v1.3.0-rc.3
- v1.3.0-rc.2
- v1.3.0-rc.1
- v1.2.1-rc.3
- v1.2.1-rc.2
- v1.2.1-rc.1
- v1.2.0
- v1.2.0-rc.1
- v1.1.2-rc.1
- v1.1.1
- v1.1.1-rc.2
- v1.1.1-rc.1
- v1.1.0
- v1.1.0-rc.2
- v1.1.0-rc.1
- v1.0.2-rc.1
- v1.0.1
- v1.0.1-rc.7
- v1.0.1-rc.6
- v1.0.1-rc.5
- v1.0.1-rc.4
- v1.0.1-rc.3
- v1.0.1-rc.2
- v1.0.1-rc.1
- v1.0.0
- dev-release
- dev-t3v13
This package is auto-updated.
Last update: 2026-05-02 18:20:35 UTC
README
GSB 11 Extension gsb_consent
About
The extension gsb_consent implements a comprehensive user consent management system for GSB11 websites. It provides a GDPR-compliant solution for managing user consent for various tracking scripts and cookies through a hierarchical data structure.
Documentation
📚 Complete Documentation Available
For detailed information about the extension's functionality, architecture, and usage, please refer to our comprehensive documentation:
- Main Documentation - Complete guide covering functionality, data models, setup, and usage examples
- Architecture Overview - Technical architecture, database schema, and data flow diagrams
Quick Start
The extension implements a three-tier data structure:
- Consent Manager - Main configuration container
- Consent Groups - Categories (e.g., "Analytics", "Marketing")
- Consent Scripts - Individual tracking scripts
See the Main Documentation for detailed setup instructions and examples.
Integration in Page Template
The consent banner is rendered via the Consent page partial:
<f:render partial="Consent" arguments="{consentManager: consentManager}" />
The partial:
- injects the banner container (
#cookie-banner) - loads either
cookieBanner.js(simple banner) orcookieBannerFull.js(manager mode) - exposes consent scripts via
window.gsbConsentScripts - provides a hidden footer trigger link (
#cookie-banner-link) to reopen consent settings
Installation
The best way to install this extension is to start with the GSB Sitepackage Kickstarter extension.
Quick installation without GSB Sitepackage Kickstarter
In a composer-based TYPO3 installation you can install the extension EXT:gsb_consent via composer:
composer require itzbund/gsb-consent
Feature Flags
This document explains how to use feature flags. We separate between two different kinds of feature flags:
Feature
Feature flags allow you to enable or disable specific features in your installation. \ This is of particular importance to disable features that have not passed the approval process.
Optional
Optional flags allow you to (de-)activate specific features for your installation. \ A practical use for these is the (de-)activation of an extension.
For more information about feature flags in TYPO3, please refer to the official TYPO3 Documentation on Feature Flags.
Feature Flag Configuration
Feature and Optional flags are configured in the .env or the local-dev/.ddev/docker-compose.environment.yaml file on ddev machine. To add a feature flag, use the following syntax:
# FEATURE FLAG
- TYPO3__SYS__features__GSB11_FEATURE_123_NEW_FEATURE=%const(bool:true)%
# OPTIONAL FLAG
- TYPO3__SYS__features__GSB11_OPTION_123_ENABLE_EXTENSION=%const(bool:true)%
In this example, both feature flags, GSB11_FEATURE_123_NEW_FEATURE and GSB11_OPTION_123_ENABLE_EXTENSION,
are set to true. To disable the feature, change the value to false or delete the setting.
Feature Flag Truth Table
This table illustrates the behavior of feature flags in various states.
| Feature Flag State | Evaluated Value | Description |
|---|---|---|
featureFlag = true | true | The feature is explicitly enabled. |
featureFlag = false | false | The feature is explicitly disabled. |
featureFlag = '' | false | An empty value is treated as false. |
featureFlag not exist | false | A non-existent flag defaults to false. |
Usage in PHP Code
To use a feature flag in your PHP code, you can check the flag's value with the isFeatureEnabled() method of the Features class:
if (GeneralUtility::makeInstance(Features::class)->isFeatureEnabled('GSB11_FEATURE_123_NEW_FEATURE')) {
echo 'Feature is enabled';
// Feature-specific code
...
}
Usage in Fluid Templates
Feature flags can also be checked in your Fluid templates with TYPO3's Feature ViewHelper.
Basic usage
<f:feature name="GSB11_FEATURE_123_NEW_FEATURE">
This is being shown if the flag is enabled
</f:feature>
Feature > then > else
<f:feature name="GSB11_OPTION_123_ENABLE_EXTENSION">
<f:then>
Flag is enabled
</f:then>
<f:else>
Flag is undefined or not enabled
</f:else>
</f:feature>
Current feature flags of gsb_consent
| Feature flag | Description |
|---|---|
GSB11_OPTION_4119_INTEGRITY_BASED_CSP_HASHES | Enables middleware registration from Configuration/RequestMiddlewares.php to append SHA-256 script hashes for consent scripts to CSP directives (script-src, script-src-elem). |
Runtime Behavior
Cookies used by the extension
The consent state is persisted in three cookies:
cookies_accepted_versioncookies_accepted_scriptscookies_accepted_userhash
Technical notes:
- Cookie lifetime is derived from the Consent Manager lifetime (
data-store-lifetime, fallback31536000seconds) - Cookies are written with
SameSite=Strict; path=/ - On restore, state is accepted only if all three cookies exist and version matches
Consent storage endpoint
Consent decisions are persisted by POST request to the page type endpoint:
- PageType:
1730672718 - Controller action:
ConsentController::storeConsentAction() - Payload: JSON with
acceptedScriptsand optionaluserhash - Response: JSON containing the resolved
userhash
Consent layer endpoint
The banner markup is fetched asynchronously from:
- PageType:
1698966645 - Template:
Resources/Private/Templates/Consentlayer.html
Usage
The extension works automatically once configured. See the Main Documentation for detailed setup instructions including:
- PageType configuration requirements
- Database setup steps
- Template integration
- Advanced configuration options
Site Set setting for privacy page link
The extension provides a site setting:
newsletter.privacyPageUid(type:page)
Usage in consent layer:
- If this setting is configured and the default consent layer text is used,
Datenschutzerklärung/privacy policyis rendered as a clickable page link. - If it is not configured (
0), the plain localized body text (consentLayer.body) is rendered without link.
Contribute
As with TYPO3, we encourage you to join the project by submitting changes. Development of the GSB 11 happens mainly in the GSB 11 TYPO3 extension repositories.
To get started, have a look at our detailed contribution walkthrough.