All Projects → shaack → bootstrap-cookie-consent-settings

shaack / bootstrap-cookie-consent-settings

Licence: MIT license
A modal dialog (cookie banner) and framework to handle the German and EU law about cookies in a website. Needs Bootstrap.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to bootstrap-cookie-consent-settings

cookie-consent-js
A simple dialog and framework to handle the German and EU law about cookies in a website (December 2021)
Stars: ✭ 55 (+120%)
Mutual labels:  dialog, cookie-consent, gdpr, dsgvo, gdpr-cookie, cookie-settings
cookieconsent
🍪 Simple cross-browser cookie-consent plugin written in vanilla js
Stars: ✭ 2,158 (+8532%)
Mutual labels:  cookie-consent, gdpr, cookie-settings
react-cookie-law
React Cookie Law is a cookie-info banner compliance with the GDPR and the EU cookie law. It allows the user to give consent in a granular way.
Stars: ✭ 103 (+312%)
Mutual labels:  cookie-consent, gdpr, gdpr-cookie
cookie-consent
Cookie consent with accessible dialog, agnostic tag triggers and conditional content, script and embed hooks.
Stars: ✭ 55 (+120%)
Mutual labels:  cookie-consent, gdpr
DSGVO-Liste
Informationen und Ressourcen zur Datenschutz-Grundverordnung
Stars: ✭ 51 (+104%)
Mutual labels:  gdpr, dsgvo
database-anonymizer
CLI tool an PHP library to anonymize data in various databases
Stars: ✭ 23 (-8%)
Mutual labels:  gdpr, dsgvo
pganonymize
A commandline tool for anonymizing PostgreSQL databases
Stars: ✭ 20 (-20%)
Mutual labels:  gdpr, dsgvo
Cookieconsent
A free solution to the EU, GDPR, and California Cookie Laws
Stars: ✭ 3,017 (+11968%)
Mutual labels:  cookie-consent, gdpr
hugo-component-matomo
Matomo user tracking and optout scripts for Hugo
Stars: ✭ 38 (+52%)
Mutual labels:  gdpr, dsgvo
magento2-module-cookie-consent
Magento 2 wrapper for Cookie Consent by Insites
Stars: ✭ 14 (-44%)
Mutual labels:  cookie-consent, gdpr
risorse-gdpr
Raccolta di risorse sul GDPR
Stars: ✭ 20 (-20%)
Mutual labels:  gdpr, gdpr-cookie
gdpr-cookie-monster
A minimal EU-GDPR compliant cookie consent banner for websites and shops (5.6K gzipped).
Stars: ✭ 27 (+8%)
Mutual labels:  cookie-consent, gdpr
wp-gdpr-cookie-notice
Simple performant cookie consent notice that supports AMP, Web Stories, granular cookie control and live preview customization.
Stars: ✭ 17 (-32%)
Mutual labels:  cookie-consent, gdpr
silverstripe-cookie-consent
GDPR compliant cookie popup and consent checker
Stars: ✭ 16 (-36%)
Mutual labels:  gdpr, gdpr-cookie
PolishCookieConsent
Polish Cookie Consent is an extension, which automatically accepts privacy policy/GDPR on websites.
Stars: ✭ 17 (-32%)
Mutual labels:  cookie-consent, gdpr
DataProfiler
What's in your data? Extract schema, statistics and entities from datasets
Stars: ✭ 843 (+3272%)
Mutual labels:  gdpr
panter-dialog
Panter Dialog is an stylish android library that helps users add cool features like adding header and header logos
Stars: ✭ 116 (+364%)
Mutual labels:  dialog
BaseDevelop
an android project for now fashion open source framework
Stars: ✭ 24 (-4%)
Mutual labels:  dialog
svelte-accessible-dialog
An accessible dialog component for Svelte apps
Stars: ✭ 24 (-4%)
Mutual labels:  dialog
android-dialog
此框架提供七种对话框的显示,并支持对话框的扩展,目的是为了提供对话框的统一管理,并提供对话框显示的公共接口。
Stars: ✭ 44 (+76%)
Mutual labels:  dialog

bootstrap-cookie-consent-settings

A modal dialog (cookie banner) and framework to handle the EU law (as written by EuGH, 1.10.2019 – C-673/17) about cookies in a website. Needs Bootstrap 5.

Usage

Construct

Initialize the cookie consent framework with the constructor

var cookieSettings = new BootstrapCookieConsent(props)

You should configure the framework with the props object, at least the properties privacyPolicyUrl, legalNoticeUrl and contentURL. The default configuration is

this.props = {
    privacyPolicyUrl: undefined, // the URL of your privacy policy page (required)
    legalNoticeUrl: undefined, // the URL of you legal notice page (required)
    contentURL: "/cookie-consent-content", // this folder must contain the language-files in the needed languages (`[lang].js`)
    buttonAgreeClass: "btn btn-primary", // the "Agree to all" buttons class
    buttonDontAgreeClass: "btn btn-link text-decoration-none", // the "I do not agree" buttons class
    buttonSaveClass: "btn btn-secondary", // the "Save selection" buttons class
    autoShowModal: true, // disable autoShowModal on the privacy policy and legal notice pages, to make these pages readable
    postSelectionCallback: undefined, // callback function, called after the user has saved the settings
    lang: navigator.language, // the language, in which the modal is shown
    defaultLang: "en", // default language, if `lang` is not available as translation in `cookie-consent-content`
    categories: ["necessary", "statistics", "marketing", "personalization"], // the categories for selection, must be contained in the language files
    cookieName: "cookie-consent-settings",  // the name of the cookie in which the configuration is stored as JSON
    cookieStorageDays: 365, // the duration the cookie configuration is stored on the client
    modalId: "bootstrapCookieConsentSettingsModal" // the id of the modal dialog element
}

Show dialog

On a new visit the dialog is shown automatically. For reconfiguration show the Dialog again with

cookieSettings.showDialog()

Read the settings in JavaScript

Read all cookie settings with

cookieSettings.getSettings()

It should return some JSON like

{
  "necessary": true,
  "statistics": true,
  "marketing": true,
  "personalization": true
}

or undefined, before the user has chosen his cookie options.

Read a specific cookie setting with

cookieSettings.getSettings('statistics')

for the statistics cookie settings. Also returns undefined, before the user has chosen his cookie options.

Read the settings with a PHP script on the server

You can read the settings with all server languages, you just have to read the cookie and decode the JSON.

This is an PHP example how to read, if 'statistics' was allowed.

$consentCookieJson = @$_COOKIE['cookie-consent-settings'];
if ($consentCookieJson) {
    $consentCookie = json_decode($consentCookieJson);
    if($consentCookie && $consentCookie->statistics) {
        // do statistics things here
    }
}

Internationalization

You find the language files in ./cookie-consent-content. You can add here language files or modify the existing. If you add language files please consider a pull request to also add them in this repository. Thanks.

Disclaimer

You can use this banner for your website free of charge under the MIT-License.

The banner and framework was designed in cooperation with data protection officers and lawyers. However, we can not guarantee whether the banner is correct for your website and assume no liability for its use.

bootstrap-cookie-consent-settings is a project of shaack.com.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].