Dokumentation - we_cookie_consent 4.01 - English
- 1. Introduction
- 1.1. What does the extension do?
- 1.2. Properties
- 1.3. Compatibility
- 1.4. Demo
- 2. Setup
- 2.1. Prerequisites
- 2.2. Installation
- 2.3. Receive extension
- 2.3.1. Via the Extension Manager in the TYPO3 backend
- 2.3.2. From the TYPO3 Extension Repository or Packagist
- 2.3.3. Via Composer
- 2.4. Integration
- 2.4.1. Installation of the static template supplied
- 2.4.2. Linking the data record storage locations
- 3. Configuration
- 4. Administration
- 4.1. Maintaining the service without Google Tag Manager
- 4.1.1. Maintenance of an integrated service
- 4.1.2. Maintenance of an individual service
- 4.2. Maintaining the services with Google Tag Manager
- 4.2.1. Creating the Google Tag Manager in the Cookie Consent Extension
- 4.2.2. Creation of a service/script in the extension, which is integrated via the GTM
- 4.2.3. Adding categories
- 4.2.4. Creating the service in Google Tag Manager
- 4.2.5. Use of the Google Tag Manager export function within the Cookie Consent Extension
- 5. Adding the cookie overview in the privacy policy
- 6. Test mode
- 7. Additional
- 7.1. Customizing the TYPOScript parameters
- 7.2. Localization
- 7.3. Adjustments to the design
- 8. Use of the Google Consent Mode
- 8.1. Consent Mode Update
- 8.2. Consent Mode WITHOUT Google Tag Manager
- 8.3. Consent Mode WITH Google Tag Manager
- 9. Do not forget!
- 10. Acknowledgments
1. Introduction
1.1. What does the extension do?
According to the ruling of the European Court of Justice (ECJ), website operators must obtain the active consent of users for the use and storage of cookies or scripts on the user's computer. It is therefore not sufficient to simply point these out or to use them before active consent has been given. With the we_cookie_consent extension, you can integrate cookies or scripts on your website in compliance with data protection regulations.
In the current version, the extension also includes the option of playing the Google Consent Mode for the services "Google Analytics" and "Google Tag Manager Services".
1.2. Properties
- Activates cookies only after consent
- Data protection compliant consent solution
- Provision of user settings
- Simple Google Tag Manager export
- Provision of cookie information in the privacy policy
- Preconfigured modules for Google Analytics, Google Tag Manager, Facebook, YouTube and Vimeo
- Can be extended with tracking scripts as required
- Activation of Google Consent Mode Basic and Advanced
- Activation of the Google Consent Mode consent types: ad_storage, analytics_storage, ad_user_data, ad_personalization, personalization_storage, functionality_storage
- Provision and connection of a Google Tag Manager template
1.3. Compatibility
- TYPO3 10.4
- TYPO3 11.5
- TYPO3 12.4
1.4. Demo
2. Setup
2.1. Prerequisites
The extension uses jQuery in the frontend. If you are already using the jQuery libary, no customization is necessary. Otherwise, you must integrate jQuery. Future versions of the extension should work without jQuery.
2.2. Installation
The extension is installed like any TYPO3 extension. There are 4 sources of supply:
TYPO3 TER: https://extensions.typo3.org/extension/we_cookie_consent
Packagist: https://packagist.org/packages/websedit/we-cookie-consent
Github: https://github.com/websedit/we_cookie_consent
Composer: composer req typo3-ter/we-cookie-consent
2.3. Receive extension
2.3.1. Via the Extension Manager in the TYPO3 backend
- As a user with admin rights, navigate to the Extensions module
- In the select box, navigate to the Add extensions sub-module.
- Click on "Update now"
- Enter the key we_cookie_consent in the search field
- Click on the cloud symbol in the hit list to import and install the extension.
2.3.2. From the TYPO3 Extension Repository or Packagist
(https://extensions.typo3.org/extension/we_cookie_consent)
- Download the ZIP file
- Unzip the ZIP file and move the content to the TYPO3 extension directory (typo3conf/ext/)
- Navigate to the Extensions module in the TYPO3 backend as a user with admin rights
- Search for the extension we_cookie_consent
- Click on the cube icon with the plus to install the extension
2.3.3. Via Composer
Installation via Composer is possible via TYPO3's own repository (https://composer.typo3.org/satis.html).
Three steps are necessary:
- Make the TYPO3 repository known in composer.json:
composer config repositories.0 composer https://composer.typo3.org/ - Install the extension with the package name typo3-ter/we-cookie-consent:
composer req typo3-ter/we-cookie-consent - Activate the extension via the extension manager in the ba
2.4. Integration
2.4.1. Installation of the static template supplied
- As a user with admin rights, navigate to the Template module
- In the page tree, navigate to the page in which you have stored your templates.
- Select the Info/Edit submodule in the select box (usually preselected)
- Switch to edit mode by clicking on the Edit complete template data record button
- Click on the Contains tab
- Select Cookie Consent (we_cookie_consent) in the Available objects area on the right-hand side
- This then moves to the left to the Include static templates (from extensions) area
- Click on Save
- The integration is complete
2.4.2. Linking the data record storage locations
- As a user with admin rights, navigate to the Template module
- Navigate to the root page (globe) in the page tree
- Select the Constants editor sub-module in the select box
- Select WEBSEDIT COOKIE CONSENT in the select box
- Enter the UID of your privacy page as Privacy Page
- Under Default storage PID, enter the UID of the Cookie Consent data record folder, see chapter 3
3. Configuration
Creating a data record folder
Navigate to the List module in TYPO3
Create a new data record folder in the page tree
Give the folder the name Cookie Consent
Activate the folder
4. Administration
Find out which cookies are used on your website
- For example, you can call up the URL https://www.cookiemetrix.com/ and analyze your website. We will also be offering a cookie analysis tool shortly.
- Check your cookies and identify the cookies that require labeling
INFO: When creating services with version 2.0.0 and TYPO3 7.6, the following error message may occur:
Method Websedit\WeCookieConsent\ViewHelpers\Format\EscapeViewHelper::render() does not exist
If you encounter this problem, change the EscapeViewHelper from renderStatic() to render():
public function render() {
$value = $this->renderChildren();
if (!is_string($value) && !(is_object($value) && method_exists($value, '__toString')))
{return $value;
}
$value = preg_replace("/\r|\n/", " ", $value);
$value = addslashes($value);
return $value;
}
4.1. Maintaining the service without Google Tag Manager
4.1.1. Maintenance of an integrated service
4.1.1.1. Google Analytics, Facebook and Matomo
The we_cookie_consent extension offers simplified integration for certain services. These are Google Analytics, Google Analytics Universal, Facebook Pixel and Matomo. For these scripts, you only need the ID of the service and not the complete tracking code.
- Navigieren Sie zum Modul Liste
- Klicken Sie im Seitenbaum auf den Ordner Cookie Consent
- Für das erstmalige Erstellen eines Datensatzes klicken Sie im Inhaltsbereich auf das „+“. Wählen Sie unter dem Punkt GDPR: Cookie Consent --> Service aus.
- Für das Anlegen aller weiteren Datensätze, klicken Sie auf das „+“ neben Anbieter
- Wählen Sie unter „Anbieter“ den Service aus, den Sie integrieren möchten (Google Analytics, Google Analytics Universal, Facebook oder Matomo)
- Geben Sie unter Titel des Service oder Skripts einen Namen ein
- Fügen Sie im Feld Beschreibung eine Beschreibung hinzu (Erklärung zur Verwendung des Service oder Skripts)
- Navigieren Sie zu dem Tab Cookies und klicken auf + Weiteres Cookie hinzufügen
- Fügen Sie den Cookie-Namen, den Cookie-Zweck und die Cookie Lebenszeit gemäß der DS-GVO Vorgaben hinzu (Im Eingabefeld Cookie Lebenszeit, können Sie Minuten, Tage oder Stunden eintragen. Wichtig hierbei ist, das Sie die Zeiteinheit dahinter schreiben)
- Nehmen Sie in dem Tab Einstellung die gewünschte Einstellung vor, wie das Script geladen werden soll
- Im Tab Authentifizierung fügen Sie den Key des gewünschten Service ein
- Klicken Sie auf Speichern
- Navigate to the List module
- Click on the Cookie Consent folder in the page tree
- To create a data set for the first time, click on the "+" in the content area. Under GDPR: Cookie Consent --> Service, select Service.
- To create all further data records, click on the "+" next to Provider
- Under "Provider", select the service you would like to integrate (Google Analytics, Google Analytics Universal, Facebook or Matomo)
- Enter a name under Title of the service or script
- Add a description in the Description field (explanation of how to use the service or script)
- Navigate to the Cookies tab and click on + Add another cookie
- Add the cookie name, the cookie purpose and the cookie lifetime in accordance with the GDPR requirements (in the Cookie lifetime input field, you can enter minutes, days or hours. It is important that you write the time unit behind it)
- In the Settings tab, make the desired setting for how the script should be loaded
- In the Authentication tab, enter the key of the desired service
- Click on Save
Your service is now displayed in the cookie consent overview.
4.1.1.2. Youtube and Vimeo
The we_cookie_consent extension offers simplified integration for certain services. These are Youtube and Vimeo. You do not need a service ID or tracking code for these scripts. There is a contextual consent for these services.
- Navigate to the List module
- Click on the Cookie Consent folder in the page tree
- To create a data set for the first time, click on the "+" in the content area. Under GDPR: Cookie Consent --> Service, select Service.
- To create all further data records, click on the "+" next to Provider
- Under "Provider", select the service you want to integrate (Youtube or Vimeo)
- Enter a name under Title of the service or script
- Add a description in the Description field (explanation of how to use the service or script)
- Navigate to the Cookies tab and click on + Add another cookie
- Add the cookie name, the cookie purpose and the cookie lifetime in accordance with the GDPR requirements (in the Cookie lifetime input field, you can enter minutes, days or hours. It is important that you write the time unit behind it)
- In the Settings tab, make the desired setting for how the script should be loaded
- Click on Save
Your service is now displayed in the cookie consent overview.
4.1.2. Maintenance of an individual service
- Navigate to the List module
- Click on the Cookie Consent folder in the page tree
- To create a data set for the first time, click on the "+" in the content area. Select the GDPR: Cookie Consent Service item.
- To create all further data records, click on the "+" next to Provider
- Under "Provider", select Additional service
- Enter a name under Title of the service or script
- Add a description in the Description field (explanation of how to use the service or script)
- Navigate to the Cookies tab and click on + Add another cookie
- Add the cookie name, the cookie purpose and the cookie lifetime in accordance with the GDPR requirements
- In the Settings tab, make the desired setting for how the script should be loaded
- In the Development tab, add the script for the desired service
- Click on Save
Your service is now displayed in the Cookie Consent overview
There is a contextual consent for this service. This can be accessed via "other-ID", "data-name" and "data-src".
The ID corresponds to the ID of the provider.
The attributes "data-name" and "data-src" are used to automatically output the contextual consent in the code if there is no consent for the provider yet.
Example with provider "other-43":
<iframe
width="560"
height="315"
data-name="other-43"
data-src=https://maps.google.de/maps?hl=de&q=%20Seestraße+35%20Ravensburg&t=&z=10&ie=utf8&iwloc=b&output=embed
frameborder="0"
scrolling="no"
marginheight="0"
marginwidth="0"
style='height:315px;width:560px;'>
</iframe>
4.2. Maintaining the services with Google Tag Manager
4.2.1. Creating the Google Tag Manager in the Cookie Consent Extension
- Navigate to the List module
- Select Cookie Consent in the page tree
- Click on the "+" to create a new data record
- Under "Provider", select Google Tag Manager
- Enter a name under Title of the service or script
- Add a description in the Description field
- Navigate to the Cookies tab and click on + Add another cookie
- Add a cookie name, the cookie purpose and the cookie lifetime
- In the Settings tab, make the desired setting for how the script should be loaded
- In the Authentication tab, add the Google Tag Manager ID in the format GTM-XXXXXXX
- Click on Save
4.2.2. Creation of a service/script in the extension, which is integrated via the GTM
- Navigate to the List module
- Select Cookie Consent in the page tree
- Click on the "+" to create a new data record
- Under "Provider", select Google Tag Manager - Service
- Enter a name under Title of the service or script
- Add a description in the Description field
- Navigate to the Cookies tab and click on + Add another cookie
- Add a cookie name, the cookie purpose and the cookie lifetime of the service
- In the Settings tab, make the desired setting for how the script should be loaded
- Add the ID of the desired service in the Authentication tab
- Navigate to the "Google Tag Manager" tab. Fill in all fields here! You will need these entries again in the Google Tag Manager interface
- Click on Save
4.2.3. Adding categories
The categorization of a service is based on TYPO3's own system category data set. To do this, proceed as follows:
- Navigate to the List module
- Select Cookie Consent in the page tree
- Click on the "+" to create a new category
- Save the category
- Go back to the Cookie Consent overview
- Edit the service to which you want to assign a category
- Click on the Categories tab
- Select the desired category and click on save
4.2.4. Creating the service in Google Tag Manager
(https://www.google.com/intl/de/tagmanager/)
- Log in (https://www.google.com/intl/de/tagmanager/)
- Click on Variables in the left-hand area
- Create a new user-defined variable in Google Tag Manager
- Give the variable a name
- Select the variable type data layer variable
- Give the data layer variable the identical name that you selected in the Cookie Consent Extension for the corresponding service.
- Save the variable
- Create a new trigger in Google Tag Manager
- Give the trigger a name
- Select the trigger type "User-defined event"
- Give the trigger the identical event name that you have selected in the Cookie Consent Extension for the corresponding service.
- Select some user-defined events under "Trigger this trigger"
- For "Trigger this trigger when an event occurs and all these conditions are met", select the variable created for this service "is equal to" "true"
- Create a tag for the corresponding service and select the associated trigger that you created previously
- Click on the "Send" button at the top left of the Google Tag Manager interface
- Enter a version name and a version description
- Click on "Publish" at the top left of the Google Tag Manager interface
4.2.5. Use of the Google Tag Manager export function within the Cookie Consent Extension
- Needs to be done -
5. Adding the cookie overview in the privacy policy
- Navigate to the module Page
- In the page tree, navigate to the page with your privacy policy
- Create a new content element by clicking on + Content
- In the "Create new content element" window, navigate to the Plug-ins tab
- Click on Cookie list
- Click on the Plug-in tab
- Click on the folder icon in the Services & Scripts area on the left
- The Data set selection window opens
- Select the folder in which you have created your cookies
- Select the desired data set
- Under Provider, add all the cookies that you want to be displayed later in the privacy policy
Click on Save after you have added all cookies
6. Test mode
The Cookie Consent Extension can be run in test mode during setup and before going live. To do this, append #klaro-testing to your domain.
7. Additional
7.1. Customizing the TYPOScript parameters
- Storage folder: The ID of the data record folder is stored here. See point 2.4.2.
- Privacy page: You must enter the UID of your privacy page in the Privacy page input field. See point 2.4.2.
- Style Prefix: In the Style Prefix input field, you can adjust the positioning of the cookie banner.
Input options:- Display at the bottom of the screen: klaro we_cookie_consent (default)
- Display at the top of the screen: klaro we_cookie_consent notice--top
- Display in the middle with the buttons below each other: klaro we_cookie_consent notice--center
- Display in the center with the buttons below and next to each other: klaro we_cookie_consent notice--center--floated
- Unstyled output without CSS: nostyle
- Additonal Class: Here you can add an additional CSS class for the styling
- Storage Method: Here you can set whether the user settings should be saved in a cookie or in the browser's local storage. (Default: Cookie)
- Cookie Name: You can change the name of your consent cookie in the Cookie Name input field. This was designed for the use of different language versions with different services that are provided via directories and not via different top level domains.
- Lifetime: In the Lifetime input field, you can specify the validity period of the cookie. After this time has expired, the user is asked to accept the cookies again. The default setting is 365 days.
- State: In the State input field, you can set whether your cookies are preset to activated or deactivated in the cookie banner. Input options: false (default), true (not GDPR compliant!)
- Must Consent: In the Must Consent input field, you can set whether users can use your website without interacting with the cookie banner. Input options: false (default), true (not GDPR compliant!)
- Group Service: Here you can activate or deactivate the grouping of services into categories. The grouping is based on TYPO3 system categories.
- Accept all: Here you can set whether all services are activated when the banner is clicked away without user action.
- Hide Decline all: Here you can set whether the "Decline" button should be displayed. (The button is displayed by default)
- Hide Learn more: Here you can set whether the "Edit settings" button should be displayed. (The button is displayed by default)
- Cookie domain: Here you can configure whether the settings made are only valid for the current domain or also for subdomains.
- Consent Mode Basic: The default settings for Google Consent Mode Basic can be activated here: With Google Consent Mode Basic, NO Consent Mode default settings are initially loaded for the consent types!
- Consent Mode Advanced: The default settings for Google Consent Mode Advanced can be activated here: With Google Consent Mode Advanced, ALL Consent Mode default settings for the consent types are initially loaded with "Denied"! This makes it possible to model the data with Google Analytics, for example, without consent.
IMPORTANT: Before using Google Consent Mode, please check how you are allowed to handle the data and which jurisdiction or company guidelines apply to you!
7.2. Localization
In the settings of the constant editor, do not enter a value for Language or leave it set to Default (en).
All labels are stored in the locallang.xlf files. These can be overwritten using TypoScript, for example. This could then look like this:
#Override locallang.xlf Labels
config.tx_extbase._LOCAL_LANG {
default {
klaro\.consentNotice\.description = My custom Cookie message
}
de {
klaro\.consentNotice\.description = Mein eigener Cookie Text
}
}
7.3. Adjustments to the design
If you want to make CSS adjustments, please first create a copy of the supplied CSS file so that your changes are not lost with the next update.
To do this, proceed as follows:
- Copy the file from the path /typo3conf/ext/we_cookie_consent/Resources/Public/Stylesheet/style.css
- Into the fileadmin, your sitepackage, or another location of your choice
- Overwrite the path to the CSS file using page.includeCSS.we_cookie_consent_style=/fileadmin/mypackagename/css/we_cookie_consent_style.css
- Make the adjustments in your copied file
You want to make adjustments but don't know how. Our support team will be happy to help you.
You can find our contact details at:
https://consent.websedit.de/
8. Use of the Google Consent Mode
The current version of the extension we_cookie_consent offers the activation of the Google Consent Mode in the modes "Basic" or "Advanced".
Differences | Advanced | Basic |
Tag behavior |
| Google tags are blocked until consent is given |
Behavior modeling in GA4 | Yes | No |
Conversion modeling in GA4 | Yes | Yes* |
Conversion modeling in Google Ads | Yes | Yes* |
* If tags are blocked due to the user consent settings, no data is collected. A general model is then used for conversion modeling in Google Ads. Characteristics such as browser type, type of conversion action, time of day and other general, non-identifiable variables are used for the models.
Source: https://support.google.com/analytics/answer/9976101
The default content types are activated via the TYPOScript parameters, as described in section 7.1. Initially, the following content types are supported and set depending on whether they work WITH or WITHOUT Google Tag Manager:
Consent type | Initial state | Description |
ad_storage | denied | Enables storage in the browser (e.g. cookies) in connection with advertising. |
analytics_storage | denied | Enables the storage by the browser (e.g. cookies) in connection with the analysis, e.g. the duration of the visit. |
ad_user_data | denied | Permits the collection of personal data for advertising purposes. |
ad_personalization | denied | Enables the use of personal data for advertising purposes such as remarketing or interest-based targeting. |
personalization_storage | denied | Enables browser storage in connection with personalization, e.g. video recommendations. |
functionality_storage | denied | Enables storage in the browser that supports the functionality of the website or app, e.g. language settings. |
security_storage | granted | Enables storage in the browser that supports the functionality of the website or app, e.g. language settings. |
8.1. Consent Mode Update
When selecting a Google service such as Google Analytics or Google Tag Manager Service, the respective consent types can be selected via the data records in the Google Consent Mode tab after an update. These are set in the cookie as soon as a user agrees to the service.
There are three modes to choose from:
Not set | Default state: Selection if this content type has no reference to the service |
denied | Selection if the consent type is to be "denied" after approval of the service |
granted | Selection if the consent type is to be "granted" after approval of the service |
IMPORTANT: Leave consent types on "Not set" if they do not play a role for a service and only set consent types to "denied" or "granted" if they are relevant.
8.2. Consent Mode WITHOUT Google Tag Manager
When using an integrated or individual service WITHOUT Google Tag Manager (e.g. Google Analytics), proceed as follows:
- Activate the Consend Mode "Basic" or "Advanced" in the TYPO3Script parameters
- Navigate to the List module and select Cookie Consent in the page tree
- Click on the edit icon of the corresponding Google service
- In the Google Consent Mode tab, make the settings for the consent types in case of consent
- Click on Save
- Done
8.3. Consent Mode WITH Google Tag Manager
When using an integrated or individual service WITH Google Tag Manager (Google Tag Manager service), proceed as follows:
- Activate the Consend Mode "Basic" or "Advanced" in the TYPOScript parameters
- Navigate to the List module and select Cookie Consent in the page tree
- Click on the edit icon of the corresponding Google service
- In the Google Consent Mode tab, make the settings for the consent types in the event of consent
- Click on Save
- Download the GTM template (template.tpl) for we_cookie_consent from Github (https://github.com/websedit/gtm-template-typo3-we_cookie_consent-cmp)
- Switch to the Google Tag Manager interface (https://www.google.com/intl/de/tagmanager/)
- Click on Templates in the left-hand area
- Click on "New" in the "Tag templates" area on the right to create a new template
- In the subsequent window, click on the three dots at the top right and select "Import"
- Select the downloaded template.tpl file and click on "Open"
- Finally, click on "Save" in the top right-hand corner of the template editor. The template is now imported.
- Switch to Tags in the left-hand area
- Create a new tag, give it the name "TYPO3 we_cookie_consent CMP" and select the template "TYPO3 we_cookie_consent CMP" in the tag configuration
- Configure the setting options (Default consent settings, Wait for Update, Redact Ads Data, Enable URL passthrough, Cookie ID to check) according to your requirements.
Important: You do not need to carry out any configuration. The template is structured in such a way that it is compatible with the default settings of the TYPO3 extension we_cookie_consent. Entries for the "Default consent settings" and "Cookie ID to check" are therefore not mandatory. - Set the value for "Wait for Update" to "500" ms. This is usually sufficient.
- Assign the trigger "Consent Initialization - All Pages" to the new tag
- Also assign each trigger that contains a Google service to the new tag using the "or" link
- Then use the preview function of the Google Tag Manager to check extensively whether all services with the correct consent types are being rolled out and your tags are being fired in the right place.
- Once all tests have been completed, you can publish the new tag via "Send"
9. Do not forget!
After maintaining the cookie consent extension, make sure that each tracking code only appears once on your website. If you have maintained the same tracking code multiple times on your website, this may result in data collection errors.
10. Acknowledgments
We use open source software.
We would like to thank all those involved in the Klaro!
https://github.com/KIProtect/klaro