Light-weight Cookie Discover JS is a vanilla JavaScript script that gives a simple strategy to show a cookie discover in your web site.
This JavaScript cookie discover integrates a excessive variety of model customization choices, help for a number of cookie classes, geolocation, and different precious options.
Word that this product can be out there as a WordPress plugin. For extra info, see Lightweight Cookie Notice.
Optimized for efficiency
We created this script with quick and environment friendly JavaScript code, and no further JavaScript libraries or CSS information have to 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 suggest 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 may configure a limiteless variety of cookie classes. Within the cookie settings, an activation toggle will probably be introduced to the person for every class.
We have now additionally included JavaScript and PHP strategies to learn the cookie consent standing of the classes. So you may run particular scripts based mostly on the consent supplied by the customers. Extra particulars on the usage of these strategies can be found within the Status part of the plugin handbook.
Geolocation
You may show the cookie discover solely to the customers positioned in a customized checklist of nations. The geolocation is carried out with the GeoLite2 database or with HostIp.info.
A number of positions
The cookie discover might 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 further options are additionally out there:
- An optionally available masks that blocks the interactions with the web site.
- An optionally available shake impact that brings consideration to the cookie discover.
- An optionally available 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 model of your web site. You may set totally different font households for the headings, the physique, and the buttons.
- Capability to regulate 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 flexibility to incorporate customized HTML within the cookie discover and the cookie settings modal window.
- The flexibility to have HTML tables with details about the cookies within the cookie settings modal window.
Rapidly implement the JavaScript Cookie Discover
The fundamental 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 checklist of choice is out there within the plugin demo and within the plugin handbook.
Credit
This product makes use of the next sources:
- GeoIP2 PHP API licensed beneath the Apache License 2.0
- MaxMind DB Reader PHP API licensed beneath the Apache License 2.0
- Common Code for MaxMind Web Service Clients licensed beneath the Apache License 2.0
- Composer licensed beneath the MIT License
Disclaimer
This product can embrace GeoLite2 knowledge created by MaxMind, out there from https://www.maxmind.com.