Detalhes do pacote

@68publishers/cookie-consent

68publishers985MIT1.4.0

Cookie consent wrapper based on orestbida/cookieconsent with GTM integration.

68publishers, consent, cookieconsent, cookie-consent

readme (leia-me)

Cookie Consent Logo

Cookie Consent

An extended integration of orestbida/cookieconsent with support of the Google Tag Manager.


  • :white_check_mark: Easy configurable GTM template
  • :white_check_mark: Configurable storages standardized by Google
  • :white_check_mark: Possibility to synchronize consents between more storages
  • :white_check_mark: Default translations
  • :white_check_mark: WCAG 2 compliant
  • :white_check_mark: Support for storing consents via CMP

Table of contents

Integration into the GTM

Open Google Tag Manager web administration and select a container for your website. Next, go through the Templates link in the left navigation and click on the button New inside a section Tag Templates.

All you need is a file gtm_template.tpl from the root directory of this package. Download the file and import it in the Template editor:

Right dropdown

After successful import click on the button Save, leave the Template editor, and go through the Tags link in the left navigation. Then create the new tag with the imported Template, as trigger set an option Consent Initialization - All Pages and save it.

Cookie consent tag

Now you can open a preview of the website and as you can see the cookie widget is here! But let's configure it a bit.

Configuration

:exclamation: Locking the package version is highly recommended (see the field Package version below) after you successfully configure the template. Avoid using the latest version in production containers!

The plugin is configurable using fields inside the tag definition.

Basic options

Field Description
Package version Version of the package 68publishers/cookie-consent. Valid inputs are the latest or a version in formats x.x.x, x.x.x-beta.x and x.x.x-alpha-x. For available versions see the releases.
Package source The URL where the package files are hosted. If the field is not filled, the unpkg.com CDN is used. To use a different source, please read the Using other CDN or self-hosted
Make consent required The page will be blocked until a user action.
Show the widget as soon as possible The widget will be displayed automatically on the page load. You must trigger the widget manually by calling CookieConsentWrapper.unwrap().show() if the option is disabled.
Init widget after DOMContentLoaded The widget is initialized as soon as possible by default. If the option is enabled, initialization will wait until the DOMContentLoaded event.
Hide from bots Enable if you don't want the plugin to run when a bot/crawler/webdriver is detected.
Revision Revision number of your terms of use of cookies. For more information see below.
Delay Number of milliseconds before showing the consent modal.

Consent & Setting modal options

Both sections contain these fields: Layout, Position, Transition. These settings affect where modals appear and what shape they take. The behavior of the consent modal buttons can be configured through fields Primary button role, Secondary button role (accept necessary cookies or open the settings modal), and Buttons order. See the widget documentation for more details.

The consent modal has also an option Show third button that adds the third button to the modal. If the secondary button's role is Open settings the third button's role is Accept necessary and vice versa.

The settings modal has one special option with the name Settings modal trigger selector. A value of the option can be CSS selector for automatic creation of the trigger button that opens the modal. Check the example.

Cookies options

Field Description
Cookie name The name of a cookie value that holds information about the user's consent.
Cookie domain The domain name for the cookie that holds information about the user's consent, for example ".example.com". If the value is empty, it is automatically set in a browser using the "window.location.hostname" variable.
Cookie expiration Expiration of the cookie in days.
Enable cookies auto-clear All cookies will be deleted based on the user's consent and a selected strategy if the option is enabled.
Cookies auto-clear strategy Strategy for cookies auto-clear feature.
Cookie names Names of the cookies that will be deleted or kept (based on a selected strategy).

The following strategies are implemented:

1) Clear all except defined - All cookies except those you define in the field Cookie names will be deleted when the user denies any storage. 2) Clear defined only - All cookies you defined in the field Cookie names will be deleted when the user denies any storage. 3) Use cookie tables - Cookie clearing is based on cookie tables from the original plugin. Integration of CMP application is required for this option.

* There is no need to define a name from the Cookie name field because this cookie is never automatically deleted.

Storage options

The following types of storage are available:

  • Functionality storage
  • Security storage
  • Personalization storage
  • Ad storage
  • Ad user data
  • Ad personalization
  • Analytics storage

Each storage defines the name of a trigger that will be invoked if the user provides consent. It is not necessary to use or display each storage in the widget. Also, the consent for the storage can be synchronized with the consent of another storage.

Field Description
Visibility and default state Defines whether the storage should be visible in the widget and what its default value is.
   - Visible, Enabled by default Storage is visible in the widget and is enabled by default.
   - Visible & Readonly, Enabled by default Storage is visible in the widget, it is always enabled and cannot be disabled (usually used for Functionality storage).
   - Visible, Disabled by default Storage is visible in the widget and is disabled by default.
   - Hidden, Synchronized Storage is not visible in the widget and the consent is synchronized with another storage.
   - Hidden, Disabled always Storage is not visible in the widget and is always disabled. Use for storages that are not used by the application at all.
   - Visible & Readonly, Disabled always Storage is visible in the widget and is always disabled.
Synchronize consent with The consent can be synchronized with another storage. The option is available only if the option Visibility and default state is set to Hidden, Synchronized.
If the storage is denied show the modal again after x days The settings modal will be opened again after the specified number of days if the storage is denied. The option is available only if the option Display in the widget is set to Visible, Enabled by default or Visible, Disabled by default.
Event trigger name The name of an event trigger that will be invoked on granted consent with storage. The name may not be unique for each storage (unique triggers are invoked only). No trigger is invoked if the option has an empty value.

Event triggers based on composite consent

As mentioned above, each storage can define a trigger that is invoked when consent with the storage has been granted. In some situations, you may want some trigger to be fired only if the user gives consent with multiple storage types. For example, if you have a trigger called fb_pixel_trigger and you want to fire it only if the user gives consent with the analytics_storage and the ad_stroage. Then your configuration may look like this:

Revision message translation

Translation settings

The package comes with the default translations for the following languages:

Translations that will be loaded and accessible for the widget are taken from the field Locales. Each locale must be defined on a new line. Alternatively, from version 1.0.0, the URL from which the translations are to be downloaded can also be entered.

Locale options

In the example above, the default translations for the English language are downloaded and the translations for the German language are downloaded from the URL https://www.example.com/public/cc-translations/de.json. A translation file must always be in JSON format and its name must match a locale.

If you want to rewrite default translations, or you want to add translations for a new locale then you can define them in a table Translations.

Locale detection

Locale detection can be affected with the following fields:

Field Description
Locale detection strategy Browser to get user's browser language or Document to read a value from <html lang="..."> of the current page.
Locale You must define the website locale when the detection strategy is disabled. The locale must be one of the previously defined locales in the field Locales.

How to manage revisions

The default revision number is 0 and the number can be changed through the field Revision. When you change the value the consent modal will be displayed for all users again. You can define a message that will be displayed in the consent modal's description. If you want to do that define custom translation with the key consent_modal_revision_message and rewrite a translation with the key consent_modal_description. The plugin will replace the placeholder [[revision_message]] in the consent modal description with your revision message.

Revision message translation

Note: the cookieconsent plugin uses the placeholder {{revision_message}} but this notation is used by GTM for variables so the package comes with the placeholder [[revision_message]] instead.

Stylesheets

Field Description
Include default stylesheets The default stylesheet for the widget will be loaded into the page if the option is checked. We recommend keeping the option checked and adding custom stylesheets through the next options.
External stylesheets The list of custom CSS stylesheets. One URL per line.
Internal stylesheet Custom CSS rules that will be injected into the page after default stylesheets and other external stylesheets.

Page scripts

Field Description
Manage page scripts Enable if you want to easily manage existing <script> tags.
Script selector The name of a data attribute that is used for managed <script> tags.

Managing page scripts is disabled by default. When the feature is enabled then the following notation can be used for scripts you want to manage:

<script type="text/plain" data-cookiecategory="analytics_storage" src="analytics.js" defer></script>

<script type="text/plain" data-cookiecategory="ad_storage" defer>
    console.log('Ad storage enabled!');
</script>

Using other CDN or self-hosted

The configuration gives the option to set the URL from which the package files (js, css and translation files) will be loaded via the Package source field.

If the field is left blank, the unpkg.com CDN is used. Alternatively, jsDelivr.com can be used by entering the following URL:

https://cdn.jsdelivr.net/npm/@68publishers/cookie-consent@{version}/dist/

The {version} placeholder is automatically replaced with the value from the Package version field.

Self-hosted package

It is possible to host package files at any URL. To do this, the following steps are required:

  1. The complete contents of the dist folder must be accessible from that URL.
  2. The "Package source" field needs to be set correctly.
  3. It is necessary to modify the "Inject script" permissions in the GTM template.

For example, if the package files are available at the URL https://www.example.com/static/cookie-consent/, the Package source field needs to be set to https://www.example.com/static/cookie-consent/. Also, the placeholder {version} can be used in the field.

Next, the GTM template needs to be modified. In the "Permissions" tab, it is necessary to add the URL https://www.example.com/ in the "Inject scripts" section.

:exclamation: Each time the GTM template is updated, the permissions need to be modified again, as an overwrite will occur.

Inject scrips permissions

Settings modal trigger

When the user dismisses the consent modal then the modal is not displayed until the consent cookie expires. But you want to give the ability to change preferences later. This can be done automatically with the configuration field Settings modal trigger selector. For example, if you have this HTML code on your website:

<footer>
    <div class="footer-container">
        <div class="footer-item">
            <a href="/terms-of-use">
                <span class="footer-item-text">Terms of use</span>
            </a>
        </div>
        <div class="footer-item">
            <a href="/faq">FAQ</a>
        </div>
        <div class="footer-item">
            <a href="/contact">
                <span class="footer-item-text">Contact</span>
            </a>
        </div>
    </div>
</footer>

And the field Settings modal trigger selector is configured like this:

Settings modal trigger selector field

Then the plugin injects a new item into the footer automatically:

<footer>
    <div class="footer-container">
        <div class="footer-item">
            <a href="/terms-of-use">
                <span class="footer-item-text">Terms of use</span>
            </a>
        </div>
        <div class="footer-item">
            <a href="/faq">FAQ</a>
        </div>
        <div class="footer-item">
            <a href="/contact">
                <span class="footer-item-text">Contact</span>
            </a>
        </div>
        <div class="footer-item">
            <a href="#cookie-settings" data-cc="c-settings">
                <span class="footer-item-text">Cookie settings</span>
            </a>
        </div>
    </div>
</footer>

However, it is not always possible to achieve the right result with this automation (depending on the website layout). In this case, leave the Settings modal trigger selector field blank and define the link in your layout manually. Opening of the settings modal will be triggered automatically to the link.

Triggering tags based on the consent

Tags are triggered after the consent with event triggers that are defined for each storage. For example, if you have the analytics_storage configured like this:

Analytics storage options

Then create a custom trigger with the following options:

Analytics storage trigger

And a tag that is fired with the trigger:

Analytics storage trigger

Accessing the wrapper in the JavaScript

The wrapper is accessible in the window under the name CookieConsentWrapper. The recommended way how to manipulate with it is through event callbacks because the wrapper may not be fully initialized at the time your script is executed. Callbacks are attached with calling of the method CookieConsentWrapper.on(), however since the version 1.0.0 the preferred method is to use the window.cookieConsentWrapperEvents variable.

The use of the variable avoids the situation when the wrapper does not exist in the window yet.

Init event

A callback is invoked when the wrapper is fully initialized or directly if everything has been already initialized.

<script>
    window.cookieConsentWrapperEvents = window.cookieConsentWrapperEvents || [];

    window.cookieConsentWrapperEvents.push(['init', function () {
        if (CookieConsentWrapper.allowedCategory('analytics_storage')) {
            // check if the analytics_storage is granted
        }

        CookieConsentWrapper.unwrap(); // get the original cookie consent plugin
    }]);
</script>

Consent events

<script>
    window.cookieConsentWrapperEvents = window.cookieConsentWrapperEvents || [];

    window.cookieConsentWrapperEvents.push(['consent:first-action', function (consent) {
        // called on the first user's action
    }]);

    window.cookieConsentWrapperEvents.push(['consent:accepted', function (consent) {
        // called on every page load after the first user's action
    }]);

    window.cookieConsentWrapperEvents.push(['consent:changed', function (consent, changedCategories) {
        // called when preferences changed
    }]);
</script>

Locale event

<script>
    window.cookieConsentWrapperEvents = window.cookieConsentWrapperEvents || [];

    window.cookieConsentWrapperEvents.push(['locale:change', function (locale) {
        // called when the plugin locale is changed through method `CookieConsentWrapper.changeLocale()`
        console.log(locale + '!');
    }]);

    // ...

    CookieConsentWrapper.changeLocale('cs', true) // cs!
    CookieConsentWrapper.changeLocale('en', true) // en!
</script>

Integration with CMP application

The widget can be integrated with the CMP application.

The first thing to do is to set up the user information under the Integration section. Each user must have an identity (ID). The default option is Generated UUID, however you can set a custom GTM variable that will return the ID of the current user of your website.

The ID will be accessible in all your translations with placeholder [[user_identity]].

You can also set other attributes that will be sent to the CMP application along with the consents.

User integration

Configuration of the CMP application is easy, just set the URL of your application and the project code (if you leave it blank, the site domain is used as the code).

CMP integration

The configuration includes two options

  • Consent API enabled
  • Cookies API enabled

If you check the Consent API enabled option, the widget will automatically send consents to the CMP application.

If you check the Cookies API enabled option then the widget will automatically pull all cookies from the CMP application for the project and creates cookie tables from them. Below this field you can define which columns the cookie table should contain.

Widget with cookie tables

How the GTM integration works

Consent initialization

  • :fire: A tag that is associated with the Cookie Consent Template is fired
    • :gear: A configuration for CookieConsentWrapper object is created from values defined inside the tag
    • :ballot_box_with_check: The default consent is resolved according to the configuration and already existent user preferences
    • :arrows_counterclockwise: The default consent is sent into native Google Consent API
    • :hourglass_flowing_sand: Custom triggers for granted storage types are scheduled into a gtag function
    • :arrow_double_down: A script with the wrapper initialization is injected into a page

GTM Container loaded

  • :fire: Custom triggers for granted storage types are fired

Page loaded

  • :fast_forward: The CookieConsentWrapper object is fully initialized
    • :fast_forward: The original plugin is initialized
    • :fire: Callbacks for an event CookieConsentWrapper.on('init') are fired
    • :eye: The consent modal is shown if a user has not yet agreed to the use of cookies
      • :fire: After user's action, callbacks for an event CookieConsentWrapper.on('consent:first-action') are fired
      • :arrows_counterclockwise: The consent is sent into the CMP application
    • :fire: Callbacks for an event CookieConsentWrapper.on('consent:accepted') are fired

User updates his preferences through the setting modal

  • :arrows_counterclockwise: The consent update is sent into native Google Consent API
  • :fire: Custom triggers for newly granted storage types are fired
  • :fire: Callbacks for an event CookieConsentWrapper.on('consent:changed') are fired
  • :arrows_counterclockwise: The consent is sent into the CMP application

How to update already published containers

If you want to update to the newer version please firstly look into releases to see what has changed until the release that you are using.

For update, you must reimport the Template in your GTM in the same way how you imported it for the first time. The template will be updated but existing configurations inside tags will be kept. Of course, if the Template wasn't changed between releases then you can skip this step.

Then open the associated tag and update the value of the field Package version.

If the package files are self-hosted, it is necessary to re-edit the Injects scripts in template permissions.

Migration from v0.4 to v0.5

For more detailed information on migrating from 0.4.x to 0.5.x, please continue to the page Migration from v0.4 to v0.5.

Development

Firstly download the package and install dependencies:

$ git clone https://github.com/68publishers/cookie-consent.git
$ cd cookie-consent
$ npm install

Use predefined commands for the package build:

$ npm run build:dev # or prod

Paths of output files are:

  • ~/demo/cookie-consent.js (dev mode)
  • ~/dist/cookie-consent.min.js (production mode)

A simple demo page without real GTM is located in ~/demo/index.html. To show the demo in your browser run:

$ npm run start:dev

Then visit the page http://localhost:3000.

License

The package is distributed under the MIT License. See LICENSE for more information.

changelog (log de mudanças)

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Unreleased

1.4.0 - 2025-06-17

Added

  • Added Basque translations.

Changed

  • Reverted change that removes a focus from an element created by the "Settings modal trigger selector" option after the settings modal is closed. Even if it prevented the page from scrolling, it is a violation of accessibility rules.

Fixed

  • Fixed accessibility for third button in the consent modal.
  • Fixed accessibility in both modals after a language update.
  • Third button is now re-translated after a language update.
  • Buttons in the settings modal are physically reordered in the DOM if they are ordered visually using CSS flexbox property order to keep right tabindex flow.

1.3.6 - 2025-05-15

Added

  • Added ability to define user attributes as callback functions. Callbacks will be invoked when interacting with the CMP.

1.3.5 - 2025-04-24

Changed

  • Information about storages in the settings modal (descriptions, cookies tables) are now automatically collapsed when the modal is closed.

1.3.4 - 2025-04-22

Fixed

  • Prevented page scrolling after consent has been made through a settings modal that was opened through an element created by the "Settings modal trigger selector" option.

1.3.3 - 2025-04-21

Fixed

  • Fixed "TypeError: Cannot use 'in' operator to search for 'functionality_storage' in undefined" when no storage is enabled.

1.3.2 - 2025-04-08

Fixed

  • Fixed displaying of fields "Synchronize consent with" and "If the storage is denied show the modal again after" in the GTM template when a variable is used in the field "Visibility and default state".

1.3.1 - 2025-04-03

Added

  • Added new field "Package source" in the GTM template that allows to specify the location of the package files.
  • Added section "Using other CDN or self-hosted" in the README.

1.3.0 - 2025-04-03

Added

  • Added new option "Visible & Readonly, Disabled always" for field "Visibility and default state" in the GTM template.

1.2.0 - 2025-01-10

Added

  • Added custom CSS build that is used as the default stylesheets source instead of the original plugin CSS.

Changed

  • Update the build - the final package size has been lowered.

Fixed

  • Fixed default (disabled) behaviour for cookies auto-clear.
  • Fixed clearing cookies with wildcard names (e.g. _ga*) when the cookie_tables strategy is used.

1.1.0 - 2024-09-19

Added

  • Added GTM template field "Init widget after DOMContentLoaded".
  • Added Portuguese translations.

Changed

  • Moved the package under the organization - @68publishers/cookie-consent.
  • The widget is now initialized as soon as possible instead of waiting for DOMContentLoaded event. This behavior can be changed back via the new option "Init widget after DOMContentLoaded".
  • Improved Interaction to Next Paint (INP) metric when a user gives a consent.
  • Updated README.

Fixed

  • Corrected Polish translations.

1.0.0 - 2024-06-21

Added

  • Added safe CookieConsentWrapper events attaching via window variable window.cookieConsentWrapperEvents.
  • DX: Added Eslint.
  • DX: Added GitHub Actions.

Changed

  • Default translations are loaded dynamically based on the settings in the GTM "Locales" field.
  • Added ability to load custom default translations in .json and .js format.
  • Reduced compiled cookie-consent script size.
  • Updated GTM template.
  • Updated README.
  • DX: Rewritten from CommonJS to ESM.

0.5.3 - 2024-05-10

Added

  • Added field User RFC cookie into the GTM template.
  • Added property CookieConsentWrapper.consentCookieValue that returns raw consent value as a string or null if no consent exists.

0.5.2 - 2024-04-04

Fixed

  • Fixed integration with CMP Cookies API.

0.5.1 - 2024-02-28

Added

  • Added default translations for Croatian (hr).
  • Added default translations for Italian (it).
  • Added default translations for Norwegian (no).
  • Added default translations for Swedish (sv).
  • Added default translations for Ukrainian (uk).

Changed

  • Updated translations for Bulgarian (bg).

0.5.0 - 2024-02-27

Added

  • Added new storages ad_user_data and ad_personalization in the GTM template (Google Consent Mode v2 integration).
  • Added new translation keys ad_user_data_title, ad_user_data_description, ad_personalization_title and ad_personalization_description.
  • Added the Migration from v0.4 to v0.5 guide.

Changed

0.4.8 - 2024-02-15

Added

  • Added fields Integration > CMP API > Default environment and Integration > CMP API > Environment code in the GTM template.
  • Added option evironment in the CmpApiOptions. The environment is taken into account in the integration with CMP.
  • Added getter CookieConsentWrapper.consentCookieData that returns data from the consent cookie (cc-settings by default) as an object or null if the consent doesn't exists.

Changed

  • Credentials are now omitted in CPM integration requests.

0.4.7 - 2023-10-04

Added

  • Added default translations for Dutch (nl) language.

Changed

  • Updated all dependencies including the original plugin (vanilla-cookieconsent@^2.9.2).
  • The wrapper now includes CSS styles of the original plugin corresponding to its version.

Fixed

  • Fixed npm audit vulnerability.

0.4.6 - 2023-09-01

Added

  • Added missing translation keys in the GTM template.
  • Added default translations for Finnish (fi) language.

0.4.5 - 2023-04-26

Added

  • Added default translations for German (de) language.
  • Added default translations for Bulgarian (bg) language.
  • Added default translations for Hungarian (hu) language.
  • Added default translations for Polish (pl) language.
  • Added default translations for Romanian (ro) language.
  • Added default translations for Slovenian (sl) language.

Fixed

  • Fixed the default consent initialization when any category is configured as "enabled_by_default" and user disables it.

0.4.4 - 2023-04-01

Added

  • added getter CookieConsentWrapper.version
  • the version is also exported via CookieConsentWrapper.configurationExport

0.4.3 - 2023-03-28

Added

  • Added default translations for French (fr) language.

0.4.2 - 2023-02-21

Added

  • Added default translations for Spanish (es) language.

0.4.1 - 2022-12-23

Fixed

  • Fixed typo in the czech dictionary.

0.4.0 - 2022-12-09

Added

  • Added the CMP application integration
  • Added the field Show third button in GTM template under the section Consent modal options.
  • Added the field Cookie domain in GTM template under the section Cookie options.
  • Added the cookie auto-clear option Use cookie tables
  • Added events consent:first-action, consent:accepted, consent:changed and locale:change
  • Added mentions of new fields and events in README
  • Added the section Integration with CMP application in README
  • Added all new translations for locales en, cs and sk

Changed

  • Updated the original plugin to the version ^2.8.6

0.3.8 - 2022-02-09

Fixed

  • The value of the key data from the cookie cc-settings could be null.

0.3.7 - 2022-02-09

Fixed

  • The data attribute last_action_date is automatically added into the cc-settings cookie for users that accepts/rejects consent before the plugin update.

0.3.6 - 2022-02-07

Added

  • Added fields Show the modal again if storage is denied for each storage in the GTM template. The settings modal can be opened again after the specified number of days if the storage is denied.

0.3.5 - 2022-01-08

Added

  • Added the section How the GTM integration works in README
  • Added the section How to update already published container in README

Changed

  • The original plugin is initialized directly if the DOM is loaded or inside a callback attached to an event document.DOMContentLoaded instead of window.load.

0.3.4 - 2022-01-05

Removed

  • Removed argument wrapper for an event init. Callbacks for the event now have no arguments now, please use directly CookieConsentWrapper inside a callback function.

0.3.3 - 2022-01-05

Changed

  • Default translations are now loaded also for locales that are consist of an ISO 639-1 language code and an ISO 3166-1 country code e.g. en-US.

0.3.2 - 2022-01-03

Added

  • Added the section Accessing the wrapper in the JavaScript in the README
  • Added the section Cookies options in the README
  • Added the field Enable cookies auto-clear in GTM template under the section Cookies options.
  • Added the field Cookies auto-clear strategy in GTM template under the section Cookies options.
  • Added the field Cookie names in GTM template under the section Cookies options.
  • Added implementation of cookies auto-clear based on mentioned fields.

Changed

  • Updated a code in the GTM template - temporary object window.CookieConsentWrapper is created before the real wrapper is created by an external script. This allows attaching events through the method CookieConsentWrapper.on() before the script is downloaded by a browser.
  • Moved fields Cookie name and Cookie expiration under the new section Cookies options.
  • Moved the field Settings modal trigger selector under the section Settings modal options.

0.3.1 - 2021-12-31

Fixed

  • Fixed initialization of the original plugin when a page is too small and DOM is already loaded before an event window.addEventListener('load', ...) is attached.

0.3.0 - 2021-12-28

Added

  • Added param table Event triggers in a new section Composite consent in GTM template. Event triggers for composite consent can be defined here. For more information look into the section Event triggers based on composite consent in README.

Changed

  • Options for the wrapper are now accessible under a single global variable window.cc_wrapper_config instead of multiple smaller variables (GTM template must be updated).
  • Modified regex validation rule for GTM field Package version. The regex now allows beta and alpha versions.

0.2.7 - 2021-12-22

Changed

  • Changed descriptions of the security storage in translations.
  • Unified translations for buttons in the consent modal.
  • Removed emojis from translations.

0.2.6 - 2021-12-21

Added

  • Added options consent_modal_secondary_btn_settings and consent_modal_secondary_btn_accept_necessary for GTM field Translations - Key.

0.2.5 - 2021-12-21

Added

  • Added default translations for Slovak (sk) language.

Changed

  • Changed default translations for English (en) and Czech (cs) languages.

0.2.4 - 2021-12-21

Fixed

  • Fixed loading od internal stylesheets.

0.2.3 - 2021-12-21

Added

  • The field Primary button role in GTM template under the section Consent modal options.
  • The field Secondary button role in GTM template under the section Consent modal options.
  • The field Buttons order in GTM template under the section Consent modal options.
  • The translation key consent_modal_secondary_btn_settings
  • The translation key consent_modal_secondary_btn_accept_necessary

Changed

  • Changed the package logo.
  • Updated GTM template - logo, brand etc. - nothing about functionality.
  • Updated README.

Removed

  • The translation key consent_modal_secondary_btn

0.2.2 - 2021-12-17

Added

  • The method CookieConsentWrapper.on() and an event init. The event is fired when the plugin initialization is completed or has been already completed. For example: CookieConsentWrapper.on('init' function (wrapper) { /* do something*/ }).

0.2.1 - 2021-12-17

Fixed

  • Fixed GTM template - the field locale_detection_strategy now contains an item disabled instead of "noSet" value because of problem with saving in a tag configuration.

0.2.0 - 2021-12-17

Added

  • The field hide_from_bots in GTM template.
  • The field locale_detection_strategy in GTM template.
  • The field current_locale in GTM template.
  • The field page_scripts in GTM template.
  • The field script_selector in GTM template.
  • Sections Locale detection and Page scripts in README.
  • Shortcut method CookieConsentWrapper.allowedCategory().
  • Dummy page script in the development demo.

Fixed

  • Text inside a modal trigger is translated with a locale that is resolved by the cookieconsent plugin.

0.1.3 - 2021-12-14

Added

  • The section How to manage revisions in README.
  • The file package-lock.json.
  • Ignore files for npm and git in the directory ~/dist.

Changed

  • Updated cookieconsent package to the version 2.7.1.
  • Updated GTM template - options cookie_expiration, revision and delay must be converted into integers.
  • Modified the Development section in README.
  • Plugin terser-webpack-plugin is used in a production build instead of uglifyjs-webpack-plugin.

Fixed

  • Fixed usage of revisions.

0.1.2 - 2021-12-10

Added

  • The LICENSE.
  • The README.

Changed

  • Updated cookieconsent package to the version 2.7.0.
  • Default translation files are now json files instead of standard js modules.
  • Updated GTM template - removed help text from the field consent_modal_position.

0.1.1 - 2021-12-10

Added

  • The GTM template.

Fixed

  • Removed whitespaces and newlines from internal stylesheets.

0.1.0 - 2021-12-10

Added

  • The first version of the package has been released.