Skip to content

🍪 Google Analytics - Cookie Consent Banner In JavaScript

License

Notifications You must be signed in to change notification settings

a133xz/GlowCookies

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a forked project from GlowCookies. I've added a few improvements on top of the original that are explained below.

🍪 Google Analytics Cookie Consent Banner In JavaScript

Simple and full automated cookies banner for any website. Complies with the new European regulations. Activate and deactivate Google Analytics, cookies whenever the user wishes, with just one click.

Foo

Cookie banner

New features

In short, the new features were added to keep using Google Analytics with the anonymize_ip feature and to be properly used in frameworks more efficiently:

  • glowCookies is a namespace
  • Minify version of the CSS and JS library
  • Stored the selected value in cookies (Accept or Decline)
  • Settings saved for 365 + 31 days
  • If a user declines the use of cookies, Google Analytics will be installed with IP Anonymization, which complies with the GDPR requirements
  • Google Analytics, and Spanish and English only (we can add any language whenever)

How to use

Add this code to your html <head> or <body> tag.

<script src="https://cdn.jsdelivr.net/gh/a133xz/GlowCookies@master/dist/glowCookies.js"></script>
<script>
  glowCookies.start("en", {
    style: 1,
    analytics: "G-FH87DE17XF",
    policyLink: "https://link-to-your-policy.com",
  });
</script>

For more information about the configuration, please follow the original documentation.

Thanks

Thank you to the original author for this amazing javascript library.

Packages

No packages published

Languages

  • JavaScript 69.5%
  • CSS 29.5%
  • Shell 1.0%