cookie-setting

2.8.3 • Public • Published

GDPR Cookie Setting

Inspired by passatgt

This is a javascript solution to show a gdpr compliant cookie notice on your website.

string string

Demo

Check this site for a quick demo: Link

How it works?

Include the scripts.js and style.css files on your site from the dist folder. Init the script with the following config file:

<head>
    ...
    <link
      rel="stylesheet"
      type="text/css"
      href="https://unpkg.com/cookie-setting@latest/dist/style.css"
    />
</head>
<body>
  ...
  <script
      src="https://unpkg.com/cookie-setting@latest/dist/script.js"
      type="text/javascript"
  ></script>

  <script>
    gdprCookieNotice({
      locale: 'en', // language ("en", "de")
      timeout: 500, // Time until the cookie bar appears
      expiration: 30, // expiration date for accepting cookie, it'll show popup again when it's expire
      domain: '.yoursite.com', // specify your web domain prefix with dot 
      colorPrimary: '#ff0000', // change primary color (used in button and radio)
      colorSecondary: '#000000', // change secondary color (used in link)
      policyLink: "https://www.20scoops.com" // cookie policy link,
      analytics: "UA-MOCK"
    });
  </script>
</body>

Readme

Keywords

none

Package Sidebar

Install

npm i cookie-setting

Weekly Downloads

1

Version

2.8.3

License

none

Unpacked Size

2.22 MB

Total Files

41

Last publish

Collaborators

  • elec