Lightweight Cookie Notice JS is a vanilla JavaScript script that provides an easy way to display a cookie notice on your website.
This JavaScript cookie notice integrates a high number of style customization options, support for multiple cookie categories, geolocation, and other valuable features.
Note that this product is also available as a WordPress plugin. For more information, see Lightweight Cookie Notice.
We created this script with fast and efficient JavaScript code, and no additional JavaScript libraries or CSS files need to be loaded. There is only one 8kb script (gzipped) that generates the cookie notices on the DOM, adds the event listeners, and applies the styles.
For the reasons above, we recommend this product for high-performance websites or high-traffic websites.
With the script options, you can configure an unlimited number of cookie categories. In the cookie settings, an activation toggle will be presented to the user for each category.
We have also included JavaScript and PHP methods to read the cookie consent status of the categories. So you can run specific scripts based on the consent provided by the users. More details on the use of these methods are available in the Status section of the plugin manual.
You can display the cookie notice only to the users located in a custom list of countries. The geolocation is performed with the GeoLite2 database or with HostIp.info.
The cookie notice can be positioned at the bottom of the screen, at the top of the screen, or at the center of the screen as a modal window.
The following additional features are also available:
The basic implementation of this script requires only one line of code:
lwcnCookieNotice.initialize();
This script comes with a total of 100 options. The complete list of option is available in the plugin demo and in the plugin manual.
This product makes use of the following resources:
This product can include GeoLite2 data created by MaxMind, available from https://www.maxmind.com.