ProductPromotion
Logo

React.JS

made by https://0x3d.site

GitHub - porscheofficial/cookie-consent-banner: The lightweight and flexible Cookie Consent Banner
The lightweight and flexible Cookie Consent Banner - porscheofficial/cookie-consent-banner
Visit Site

GitHub - porscheofficial/cookie-consent-banner: The lightweight and flexible Cookie Consent Banner

GitHub - porscheofficial/cookie-consent-banner: The lightweight and flexible Cookie Consent Banner

cookie-consent-banner

Cookie Consent Banner

npm version GitHub license npm

๐Ÿ‘‰ See the component in action on the websites of the following projects: Simutrack and Porsche Digital Customer Relations Hub. ๐Ÿ‘ˆ

Sometimes it's not possible to avoid cookies for which we need consent of the visitors of our web applications. For that, some kind of component might help which provides a sleek, but customizable UI with an easy to use API.

That's where the Cookie Consent Banner comes in.

In order to focus on the things that really matter, the Cookie Consent Banner supports us to fulfill that requirement. It visualizes the available categories, like technically required and analysis, stores the decision of the user and provides an event-based API for you to handle appropriately. And of course, the consent data is stored locally in the vistor's browser.

:arrows_counterclockwise: Consent Flow

The consent banner has two tasks: Providing a UI Component to allow visitors of your web application to choose which cookies they want to accept, and the ability to react on the choosen settings via an API.

There are two typical scenarios: Either the external scripts, which set cookies are managed through a tag manager of your choice using the consent data, or the scripts are loaded or configured directly on code level.

Using a Tag Manager

The flow could look like this: Every script that sets cookies which require a consent from the visitor is blocked by default. Instead, the Consent Banner is shown. Once the visitor updates its preferences an event is triggered (cookie_consent_preferences_updated). Additionally the consent data is stored within a cookie in a format that can be parsed either programmatically or with a tag manager (e.g.: name: cookies_accepted_categories, value: technically_required,analytics,marketing). A tag manager could read the value of that 1st-Party Cookie before any other script (tag) is loaded (e.g.: Fire trigger only if Accepted Cookie Categories contains marketing).

Using the API directly

Have a look on the Real World example using the React Component: packages/cookie-consent-banner-react.

:spiral_notepad: Documentation

The Cookie Consent Banner supports multiple frontend frameworks, because it is built as an agnostic web component. For easier integration we also provide a wrapper component for React environments. It's necessary to set at least the required properties for the component in order to work properly (see the provided examples).

Web Component โ€“ Vanilla JS

Follow the documentation of the Web Component: /packages/cookie-consent-banner

React Component

Follow the documentation of the React Component: /packages/cookie-consent-banner-react


Disclaimer

Please note that you must individually assess the legal requirements regarding the implementation of the Cookie Consent Banner, in particular which choices to offer in which granularity and which information to provide in which detail and at which point of the user journey. The examples mentioned are not intended to provide any advice regarding legal requirements. All responsibility for the implementation of the Cookie Consent Banner and its compliance with legal requirements lies with the user.

Contributing

See CONTRIBUTING.

License

See LICENSE.

More Resources
to explore the angular.

mail [email protected] to add your project or resources here ๐Ÿ”ฅ.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here ๐Ÿ”.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory