Table of Contents
- Installation
- Quick Start
- Consent Log Menu
- Sections Menu
- Categories Menu
- Cookies Menu
- Tools Menu
- Maintenance Menu
- Options Menu
- Caching Plugins
- Geolocation
- Button Actions
- 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 and export the consent state of each consent log record.
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. |
Section | The section where the category will be displayed. |
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. |
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. |
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:
- In a category displayed in the cookie settings modal window
Tools Menu
Export
With the Export section, you can generate an XML file that includes all the plugin data (consent log, categories, sections, and cookies).
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.
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 |
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 add the revisit consent functionalities to custom HTML elements?
You can activate the revisit consent functionalities by adding the daextlwcnf-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="daextlwcnf-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="daextlwcnf-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.