
Light-weight Cookie Discover JS is a vanilla JavaScript script that gives a simple approach to show a cookie discover in your web site.
This JavaScript cookie discover integrates a excessive variety of type customization choices, help for a number of cookie classes, geolocation, and different priceless options.
Observe that this product can be obtainable as a WordPress plugin. For extra data, see Lightweight Cookie Notice.
Optimized for efficiency
We created this script with quick and environment friendly JavaScript code, and no extra JavaScript libraries or CSS information must be loaded. There is just one 8kb script (gzipped) that generates the cookie notices on the DOM, provides the occasion listeners, and applies the kinds.
For the explanations above, we advocate this product for high-performance web sites or high-traffic web sites.
Gather the cookie consent for a number of classes
With the script choices, you’ll be able to configure a limiteless variety of cookie classes. Within the cookie settings, an activation toggle shall be introduced to the person for every class.
We now have additionally included JavaScript and PHP strategies to learn the cookie consent standing of the classes. So you’ll be able to run particular scripts primarily based on the consent offered by the customers. Extra particulars on using these strategies can be found within the Status part of the plugin guide.
Geolocation
You possibly can show the cookie discover solely to the customers positioned in a customized record of nations. The geolocation is carried out with the GeoLite2 database or with HostIp.info.
A number of positions
The cookie discover may be positioned on the backside of the display screen, on the high of the display screen, or on the heart of the display screen as a modal window.
Further options
The next extra options are additionally obtainable:
- An non-compulsory masks that blocks the interactions with the web site.
- An non-compulsory shake impact that brings consideration to the cookie discover.
- An non-compulsory refresh of the web page for the customers that settle for the cookie discover.
- Customized colours for the backgrounds of the weather, for the borders, for the typefaces, for the masks, and extra.
- Capability to make use of your customized font household to create consistency with the type of your web site. You possibly can set completely different font households for the headings, the physique, and the buttons.
- Capability to manage the border width and the border radius of containers and buttons.
- Capability to set the opacity of the masks, backgrounds, and borders.
- Capability to set the shadows of the containers.
- The power to incorporate customized HTML within the cookie discover and the cookie settings modal window.
- The power to have HTML tables with details about the cookies within the cookie settings modal window.
Rapidly implement the JavaScript Cookie Discover
The essential implementation of this script requires just one line of code:
lwcnCookieNotice.initialize();
Cookie discover choices
This script comes with a complete of 100 choices. The whole record of possibility is on the market within the plugin demo and within the plugin guide.
Credit
This product makes use of the next assets:
- GeoIP2 PHP API licensed below the Apache License 2.0
- MaxMind DB Reader PHP API licensed below the Apache License 2.0
- Common Code for MaxMind Web Service Clients licensed below the Apache License 2.0
- Composer licensed below the MIT License
Disclaimer
This product can embrace GeoLite2 knowledge created by MaxMind, obtainable from https://www.maxmind.com.