Add clearcookieconsent link/button option.
This commit is contained in:
parent
31f67a58b0
commit
cf0c43760c
1 changed files with 23 additions and 2 deletions
13
README.md
13
README.md
|
|
@ -508,9 +508,18 @@ Javascript is used for spam protection and to display error/success messages.
|
|||
|
||||
Allow users to opt-in to tracking. Matomo and Google analytic are supported out of the box.
|
||||
|
||||
See `assets/js/tracking.js` for example how to implement it.
|
||||
See `assets/js/tracking.js` for example how to implement it for other cookies.
|
||||
|
||||
The name of the cookie set is "cookieconsent" and it can have the values "accept" or "decline" depending on what button the visitor clicks.
|
||||
The users choice is stored in localStorage item "cookieconsent".
|
||||
|
||||
It it recommended to add a link or button to allow users to change their choice. Adding the class "clearcookieconsent" is all that is needed.
|
||||
|
||||
```html
|
||||
<button class="clearcookieconsent">Cookie settings</button>
|
||||
<a src="" class="clearcookieconsent">Cookie settings</a>
|
||||
```
|
||||
|
||||
When a user clickes the button/link the localStorage item "cookieconsent" is cleared and the cookieconsent dialog is shown again.
|
||||
|
||||

|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue