What changed in CookieConsent from 2 to 3
3 releases numbered after v2.9.2 up to and including v3.1.0, stable releases only. v2.9.2 and v3.1.0 are the newest stable releases of 2 and 3 we track; this page follows them as new ones ship.
- 1 removes or deprecates something
13 changes across 3 releases
- Store language code of the consent in the cookie
- Add granular control over scripts through services
- Add support for external .json files for language and translation configuration
- Add ESM format for easier integration with various frameworks
- Add new customization options for button and modal layouts
- Add multiple ways to handle scripts using script-tags, callbacks, or events
- Redesign configuration parameters to be more intuitive and clearer
- Improve language and translation handling
- Remove compatibility with v2 configuration, API, and custom attributes
Original release notes, newest first
The list above is our reading of these notes; the originals from Orest Bida are here, one fold per release.
v3.1.0cookieconsent v3.1.0
Features
- feat: store language code of the consent in the cookie by @OndraM in https://github.com/orestbida/cookieconsent/pull/761
Bug fixes
- fix: service reject issue & setCookieData() method deletes lastConsentTimestamp field by @peaemaye in https://github.com/orestbida/cookieconsent/pull/701
- fix: eraseCookies domain bug and expand tests by @imnasnainaec in https://github.com/orestbida/cookieconsent/pull/719
Documentation
- docs update setCookieData examples with correct function by @alanbiju79 in https://github.com/orestbida/cookieconsent/pull/686
- docs: add missing bar 'top' position option by @OndraM in https://github.com/orestbida/cookieconsent/pull/758
- docs: Add example for Google Tag Manager's consent mode by @silenzium in https://github.com/orestbida/cookieconsent/pull/751
- docs: update docs to match code and fix a few typos by @imnasnainaec in https://github.com/orestbida/cookieconsent/pull/716
New Contributors
- @alanbiju79 made their first contribution in https://github.com/orestbida/cookieconsent/pull/686
- @peaemaye made their first contribution in https://github.com/orestbida/cookieconsent/pull/701
- @silenzium made their first contribution in https://github.com/orestbida/cookieconsent/pull/751
- @imnasnainaec made their first contribution in https://github.com/orestbida/cookieconsent/pull/716
Full Changelog: https://github.com/orestbida/cookieconsent/compare/v3.0.1...v3.1.0
v3.0.1cookieconsent v3.0.1
Bug fixes
- fix: unhandled exception when category is unknown by @Idrinth in https://github.com/orestbida/cookieconsent/pull/663
- fix: default enabled categories reset on preferences modal close by @orestbida in b91b9c44f1ba63cf6f87bfa65e574c17a54c7732
Documentation
- docs: fix broken GitHub links by @lneugebauer in https://github.com/orestbida/cookieconsent/pull/625
New Contributors
- @lneugebauer made their first contribution in https://github.com/orestbida/cookieconsent/pull/625
- @Idrinth made their first contribution in https://github.com/orestbida/cookieconsent/pull/663
Full Changelog: https://github.com/orestbida/cookieconsent/compare/v3.0.0...v3.0.1
v3.0.0cookieconsent v3.0.0
First stable v3 release! 🎉
Demo
You can check out v3 on the playground.
Main features
- more granular control over scripts, thanks to services
- better language/translation handling (allow the use of external
.jsonfiles) - more intuitive and clearer configuration parameters
- easier integration with various frameworks thanks to the ESM format (check out some demos on Stackblitz)
- many new customization options (button/modal layouts)
- multiple ways to handle your scripts, using either script-tags, callbacks or events
- and much more ...
Upgrade guide from v2 to v3? ❌
There are way too many changes compared to v2; the configuration, api, custom attributes ... everything is different, although the end result is essentially the same. I personally find it faster to just start from scratch rather than trying to adapt the previous configuration.
Should you upgrade?
YES. Although v2 will still receive some maintenance updates, it will eventually be sunset.
Last but not least
A huge thanks to everyone who contributed!