Table of Contents
- Installation
- Quick Start
- Consent Log Menu
- Sections Menu
- Categories Menu
- Cookies Menu
- Tools Menu
- Maintenance Menu
- Options Menu
- Cookies Block
- Delete Cookies Block
- Revisit Consent Block
- Caching Plugins
- Geolocation
- Button Actions
- Shortcodes
- Credits
- FAQ
Installation
Please use the installation guide for installation and update instructions. The information available in this document applies to all our WordPress plugins.
Quick Start
This section will guide you in creating the two most common types of cookie notices.
Cookie Notice with a cookie policy
A cookie notice with a cookie policy allows your visitors to read the cookie policy before accepting it.
With this procedure, you will be able to create a cookie notice with one button to read the cookie policy and one button to accept the use of the cookies:
- Install the plugin using the procedure described on the installation guide page.
- Customize the text displayed in the cookie notice with the Options -> Content -> Cookie Notice -> Message Text option.
- Customize the text of the first button with the Options → Content -> Cookie Notice -> Button 1 Text option.
- Customize the text of the second button with the Options -> Content -> Cookie Notice -> Button 2 Text option.
- Customize the content of the modal window with the Options -> Content -> Cookie Settings -> Description Header and Options -> Content -> Cookie Settings -> Description Footer options.
Cookie notice with cookie settings
A cookie notice with cookie settings allows your customer to enable or disable specific categories of cookies.
With this procedure, you will be able to create a cookie notice with one button to open the cookie settings and one button to accept the use of the cookies:
- Install the plugin using the procedure described on the installation guide page.
- Customize the text displayed in the cookie notice with the Options -> Content -> Cookie Notice -> Message Text option.
- Customize the text of the first button with the Options -> Content -> Cookie Notice -> Button 1 Text option.
- Customize the text of the second button with the Options -> Content -> Cookie Notice -> Button 2 Text option.
- Customize the text displayed in the modal window associated with the click performed on the first button with the Options -> Content -> Cookie Settings -> Description Header and Options -> Content -> Cookie Settings -> Description Footer options.
- Visit the Sections menu and create a section named “Main Section” with a custom description.
- Visit the Categories menu and create a category named “First Category”. Set a custom description. Associate the category with the “Main Section” section. Enter the scripts in the Script Head and Script Body fields. These scripts are added to the page when the cookie notice is accepted.
- Visit the Categories menu and create a category named “Second Category”. Set a custom description. Associate the category with the “Main Section” section. Enter the scripts in the Script Head and Script Body fields. These scripts are added to the page when the cookie notice is accepted.
Consent Log Menu
The Consent Log menu allows you to explore the consent log data collected by the plugin, export the consent log data in CSV format, export the proof of consent of each consent log record, and export the consolidated state of each consent log record.
Consent Log data in CSV format
Click the Export button at the top of the menu to download all the consent log data as a CSV file.
Proof of Consent
The plugin can generate proof of consent for each consent log record. This document demonstrates that you have obtained valid authorization from the user before processing their data through cookies.
The information available in the proof of consent:
- Consent ID: The unique identifier assigned to each user’s consent record.
- Anonymized IP address: The user’s anonymized IP address at the time of consent. Note: IPv4 IP addresses are anonymized by removing the last 16 bits. IPv6 IP addresses are anonymized by removing the last 96 bits.
- Country Code: The ISO 3166-1 alpha-2 country code of the user. This information is only collected if the plugin geolocation feature is enabled.
- Consent date: The specific date on which a user provided their consent for the use of cookies.
- User agent: The User-Agent request header of the user.
- URL: The specific URL for which the user has given consent to the use of cookies.
- Encrypted key: A key generated by applying the SHA-512 hashing algorithm to the collected consent state in JSON format. Note that the same key is also stored in the user’s browser as the value of the
daextlwcn-encrypted-key
cookie.
To download the proof of consent, click the Download button under the Proof of Consent column.
Consent state
The consent state includes all the information available in the cookie notice at the time of consent, along with the cookie preferences selected by the user.
You can download the consent state in JSON format by clicking the Download button under the State column.
Sections Menu
The Sections menu should be used to create sections. The sections are displayed in the cookie settings modal windows and used to group categories.
Each section has the following fields:
Field | Description |
---|---|
Name | The name of the section. This value is displayed in the cookie settings modal window. |
Description | The description of the section. This value is displayed in the cookie settings modal window. |
Priority | The priority value determines the order used to display the sections. |
Categories Menu
The Categories menu should be used to create categories. The categories are displayed in the cookie settings modal window and used to give visitors the ability to enable or disable specific cookie categories.
Each category has the following fields:
Field | Description |
---|---|
Name | The name of the category. This value is displayed in the cookie settings modal window. |
Description | The description of the category. This value is displayed in the cookie settings modal window. |
Active Toggle | This option determines if the toggle should be enabled. An active toggle allows the visitor to enable or disable the cookie category. |
Initial State | This option determines the initial state of the category. |
Section | The section where the category will be displayed. |
Script Head | The plugin adds this script to the head section of the page when the cookie notice is accepted. Please note that the script tag should always wrap your code. |
Accept Cookies Script | The JavaScript code that the plugin should execute when the user clicks a button associated with an “Accept Cookies” action, and this category is enabled. |
Script Body | The plugin adds this script just before the closing body tag when the cookie notice is accepted. Please note that the script tag should always wrap your code. |
Consent Mode Parameters | The Google consent mode parameters that will be enabled when the user consents to this category. |
Priority | The priority value determines the order used to display the categories. |
Cookies Menu
The Cookies menu should be used to store information about the individual cookies used on the website.
You can display the cookies added to this menu in the following contexts:
- Inside post, page, or custom post types by using the Cookies Block
- In a category displayed in the cookie settings modal window
It’s worth noting that the cookies defined in this menu are also used by the Delete Cookies Block.
Tools Menu
Import
The Import section allows you to import the plugin data (categories, sections, cookies, and category acceptance statistics) previously exported with the Export menu.
Follow this procedure to import the plugin data:
- Click the Choose File button
- Select the XML file that includes the data
- Click the Upload file and import button
Export
With the Export section, you can generate an XML file that includes all the plugin data (categories, sections, cookies, and category acceptance statistics).
Follow this procedure to export your data:
- Click the Export button
- The browser will download the XML file in the default download folder of your operative system
Maintenance Menu
The Maintenance menu allows you to perform operations on the plugin data.
The following tasks are available:
Task | Description |
---|---|
Reset Plugin | This task restores the initial value of the plugin options and deletes all the plugin data. |
Reset Consent Log | This task deletes all the consent log records. |
Delete Transient | This task deletes the transient associated with the cookie notice. |
To execute a task, proceed as follows:
- Visit the Cookie Notice -> Maintenance menu
- With the Task field, select the task that you want to perform
- Click the Execute Task button
Options Menu
The Options menu includes a high number of options that you can use to customize aspects like:
- The style and content of the cookie notice
- The style and content of the cookie settings modal window
- The geolocation feature
- The capabilities required to access the plugin menu
- Technical functionalities of the plugin
For more information about a single option, hover the mouse over the question mark on the right side of the option. The plugin will display a tooltip with additional information.
Cookies Block
The Cookies block allows you to include a table with the cookies defined in the Cookies Menu inside posts, pages, and custom post types.
General Information
To include the Cookies block in a post, page, or custom post type, proceed as follows:
- Edit a post, page, or custom post type.
- Enable the Visual Editor.
- Click on the Add Block button.
- Select the Cookies block.
- Customize the behavior of the block with the options available in the Settings Sidebar.
- Click the Publish/Update button to apply your changes.
Block options
The Cookies block includes the following options in the Settings Sidebar:
- Category
Delete Cookies Block
The Delete Cookies block allows you to display a button that deletes:
- The cookies set by this plugin
- The cookies defined in the Cookies menu
Revisit Consent Block
The Revisit Consent block allows you to display a button that allows the user to change their cookie preferences.
General Information
To include the Delete Cookies block in a post, page, or custom post type, proceed as follows:
- Edit a post, page, or custom post type.
- Enable the Visual Editor.
- Click on the Add Block button.
- Select the Delete Cookies block.
- Click the Publish/Update button to apply your changes.
Caching Plugins
Lightweight Cookie Notice supports the most common caching plugins.
WP Super Cache
The plugin is already optimized to work with WP Super Cache. No actions are required.
W3 Total Cache
To use Lightweight Cookie Notice with the W3 Total Cache plugin, proceed as follows:
- In the Cookie Notice -> Advanced -> Behavior section of the Lightweight Cookie Notice plugin enable the Page Fragment Caching Exception (W3TC) option and save your changes.
- Visit the Performance -> General Settings menu of W3 Total Cache.
- In the Page Cache section, set the Page Cache Method option to “Disk: Basic”.
- Save your changes.
- Visit the Performance -> Page Cache menu of W3 Total Cache.
- In the Advanced section, enable the Late initialization option.
- Save your changes.
- Clear the W3 Total Cache plugin cache.
LiteSpeed Cache
To use Lightweight Cookie Notice with the LiteSpeed Cache plugin, proceed as follows:
- Visit the LiteSpeed Cache -> Cache menu
- Add “daextlwcn” in the Login Cookie option
- Save your changes
- Clear the cache
SG Optimizer
To use Lightweight Cookie Notice with the SG Optimizer plugin, you have to exclude the following cookies on the server level:
- daextlwcn-accepted
- daextlwcn-category-status
- daextlwcn-encrypted-key
WP Fastest Cache
To use Lightweight Cookie Notice with the WP Fastest Cache plugin, proceed as follows:
- Visit the WP Fastest Cache menu.
- Select the Exclude tab.
- Click on the Add New Rule button.
- In the Exclude Page Wizard modal window select “Contain” and enter “daextlwcn” in the text field.
- Save your changes.
- Clear the cache.
Geolocation
Using the geolocation feature, you can optionally display the cookie notice to visitors from specific countries. The visitor’s position is retrieved with the HostIP.info service or the MaxMind GeoLite2 database.
Please note that:
- The results provided by these two geolocation services are not 100% accurate.
- You have to follow the terms of these services.
Geolocation with HostIP.info
To enable the geolocation with HostIP.info please proceed as follows:
- Enable the Options -> Geolocation -> General -> Geolocation option.
- Set the Options -> Geolocation -> General -> Service to “HostIP.info”.
- Select the countries where the plugin should display the cookie notice with the Options -> Geolocation -> General -> Locale option.
- Save your changes.
Geolocation with MaxMind GeoLite2
Lightweight Cookie Notice supports the GeoLite2 IP geolocation database provided by MaxMind.
To enable the geolocation with MaxMind GeoLite2, please proceed as follows:
- Set the Options -> Geolocation → General -> Geolocation option to “Enabled”.
- Set the Options -> Geolocation → General -> Service to “MaxMind GeoLite2”.
- Select the countries where the plugin should display the cookie notice with the Options -> Geolocation -> General -> Locale option.
- Enter the path where you have stored the GeoLite2 Country database in the Options -> Geolocation -> Maxmind Geolite2 -> Country Database File Path option.
- If you intend to use the Options -> Geolocation -> Maxmind Geolite2 → Subdivision option, enter the path where you have stored the GeoLite2 City database in the Options -> Geolocation -> Maxmind Geolite2 -> Country Database File Path option.
Button Actions
From the plugin settings, you can associate actions to the buttons available in the cookie notice and in the cookie settings modal window.
Below is a list of the actions with the related behavior and availability:
Action | Behavior | Availability |
---|---|---|
Open Cookie Settings | The cookie settings modal window is opened. | Cookie Notice |
Close Cookie Settings | The cookie settings modal window is closed. | Cookie Settings |
Close Cookie Notice | The cookie notice is closed. | Cookie Notice |
Redirect to URL | Performing a click on the button redirects the user to the defined URL. | Cookie Notice and Cookie Settings |
Accept Cookies | The cookie that stores the status of the categories is created. Note that the status of the cookie categories is based on the status defined in the back-end from the Cookie Notice -> Categories menu. If the user makes any change using the provided toggles available in the cookie settings modal window, these newly defined settings are used. After that, the cookie notice and the cookie settings modal window are closed. | Cookie Notice and Cookie Settings |
Accept All Cookies | The cookie that stores the status of the categories is created with all the cookie categories enabled. Then, the cookie notice and the cookie settings modal window are closed. | Cookie Notice and Cookie Settings |
Reject All Cookies | The cookie that stores the status of the categories is created with all the cookie categories disabled. Then, the cookie notice and the cookie settings modal window are closed. | Cookie Notice and Cookie Settings |
Shortcodes
As a secondary method to include the layout elements generated by the plugin in the posts, you can use the following WordPress shortcodes:
Layout Element | Shortcode Tag | Parameters |
A table to list the defined cookies | [ cookies ] | category-id |
A button to delete the plugin cookies and the defined cookies | [ delete-cookies ] | N/A |
A button that allows the user to change their cookie preference | [ revisit-consent ] | N/A |
Example 1
Display the cookies that are not associated with a category.
[ cookies ]
Example 2
Display the cookies associated with the category with an ID equal to “2”.
[ cookies category-id="2" ]
Example 3
Display a button that deletes the cookies set by this plugin:
[ delete-cookies ]
Example 4
Display a button that allows the user to change their cookie preferences:
[ revisit-consent ]
Credits
This plugin makes use of the following resources:
- Select2 licensed under the MIT License
- Composer licensed under the MIT License
- JShrink license under the BSD 3 Clause License
- GeoIP2 PHP API licensed under the Apache License 2.0
- MaxMind DB Reader PHP API licensed under the Apache License 2.0
- Common Code for MaxMind Web Service Clients licensed under the Apache License 2.0
Disclaimer
This product can include GeoLite2 data created by MaxMind, available from https://www.maxmind.com.
FAQ
Can I include HTML tags in the textarea fields available in the back-end?
Yes, the following HTML tags are supported:
- p
- a
- strong
- br
- ol
- ul
- li
How do I share the plugin cookies on subdomains?
Using the Options -> Advanced -> Cookie Attributes -> Domain option you can define the host to which the cookie will be sent.
Setting the domain will make the cookie available to it, as well as to all its subdomains.
If omitted, this attribute defaults to the host of the current document URL, not including subdomains.
Example 1
To set the plugin cookies only on the main domain, set the Options -> Advanced -> Cookie Attributes -> Domain option to an empty value.
Example 2
To set the plugin cookies on the main domain and the subdomains, set the Options -> Advanced -> Cookie Attributes -> Domain option to your site domain (E.g., example.com).
How to enable Google Consent Mode?
The plugin supports Google Basic Consent Mode. To enable this feature via the plugin options, proceed as follows:
- Enable the Options -> Advanced -> Google Consent Mode -> GTM Basic Consent Mode option.
- Enter the Google Tag Manager container ID in the Options -> Advanced -> Google Consent Mode -> GTM Container ID option.
- Save your changes.
When this feature is enabled, you can select the consent mode parameters that will be enabled when the user consents to the categories using the Consent Mode Parameters option available in the Advanced section of the categories created using the Categories menu.
How do I add the revisit consent functionalities to custom HTML elements?
You can activate the revisit consent functionalities by adding the daextlwcn-revisit-consent-trigger
class to any element on the page.
Example 1
Create a button
HTML element that activates the revisit consent functionalities:
<button class="daextlwcn-revisit-consent-trigger">Revisit Consent</button>
Example 2
Create a span
HTML element that activates the revisit consent functionalities:
<p>Change your cookie preferences by clicking <span class="daextlwcn-revisit-consent-trigger">here</span>.</p>
Which versions of PHP are supported?
PHP 7.2.0 and later versions are supported.
Which versions of WordPress are supported?
WordPress 5.0 and later versions are supported.