Skip to content

Commit

Permalink
Docs(upgrade): Add guide for adding link to open cookie settings #CCM-57
Browse files Browse the repository at this point in the history
  • Loading branch information
OndraM committed Feb 10, 2022
1 parent 20779f4 commit 98e77b5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ window.addEventListener('DOMContentLoaded', function () {

This will load the plugin from CDN and initialize the plugin with default settings.

As a next step, add a link to open cookie settings after the consent was previously given. This link should be placed
somewhere in the page footer, usually near "Terms of use" and "Privacy policy" links.

```html
<a href="" data-cc="c-settings">Open cookie settings</a>
```

[👀 See demo page with example][examples].

## Loading the plugin
Expand Down
11 changes: 11 additions & 0 deletions UPGRADE-2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,17 @@ Keep in mind there is no universal solution and there will be different things t
You must analyze used cookies/local storage and features which depend on consent for each category and test all
possible scenarios. With version 2.0 this especially means the `onChange` event.

## Add a link to open cookie consent settings

There MUST be a link for the user to open and update cookie settings after the consent was previously given.

It should be placed preferably in the page footer, somewhere near your current "Terms of use" / "Privacy policy" links.
To add it, use a link with `data-cc="c-settings"` attribute:

```html
<a href="" data-cc="c-settings">Nastavení Cookies</a>
```

## Use `DOMContentLoaded` event instead of `load`

It is highly recommended changing the event where plugin initialization is placed to `DOMContentLoaded`:
Expand Down

0 comments on commit 98e77b5

Please sign in to comment.