Knowledge Base › Lightweight Cookie Notice › Cookie Notice

Understanding Button Actions

Every button of the cookie notice and of the cookie settings window has an action. The action decides what is saved when the visitor clicks the button. Choosing the right actions is the most important part of the configuration.

This article explains each action, shows the difference between Accept Cookies and Accept All Cookies, and lists the most common mistakes.

Where the actions are set

All the options are in Cookie Notice → Options → Content.

ElementOptions
Cookie notice buttonsCookie Notice section: Button 1 Action, Button 2 Action, Button 3 Action, Dismiss Button Action
Cookie settings buttonsCookie Settings section: Button 1 Action, Button 2 Action

Available actions

ActionAvailable inWhat it does
DisabledBothThe button is not displayed.
Open Cookie SettingsCookie noticeOpens the cookie settings window. Nothing is saved.
Close Cookie SettingsCookie settingsCloses the cookie settings window. The acceptance is not saved and the cookie notice stays on screen.
Close Cookie NoticeCookie noticeRemoves the notice from the current page. Nothing is saved, so the notice is displayed again on the next page.
Redirect to URLBothSends the visitor to the URL set in the related URL option. Nothing is saved.
Accept CookiesBothSaves the categories in their current state, then closes the notice and the settings window.
Accept All CookiesBothEnables all the categories, saves, then closes the notice and the settings window.
Reject All CookiesBothDisables all the categories, saves, then closes the notice and the settings window.

Only Accept Cookies, Accept All Cookies, and Reject All Cookies save the visitor’s choice. After one of these actions:

  • The notice is not displayed again until the choice expires or the visitor revisits the consent.
  • A record is added to the Consent Log (if Store User Consent is on).
  • The page is reloaded (if Reload Page is on).
  • The revisit consent button is displayed (if enabled).

Accept Cookies and Accept All Cookies

These two actions are often confused.

Accept Cookies saves the categories as they are at the moment of the click:

  • If the visitor changed the toggles in the cookie settings window, the visitor’s selection is saved.
  • If the visitor did not touch the toggles, each category is saved with its Initial State (the default you set in the Categories menu).

Accept All Cookies ignores the current state of the toggles and enables every category.

Example

A site has three categories:

CategoryActive ToggleInitial State
NecessaryOffOn
AnalyticsOnOff
MarketingOnOff

A visitor opens the site and clicks a button of the notice without opening the settings:

Action of the clicked buttonNecessaryAnalyticsMarketing
Accept CookiesEnabledDisabledDisabled
Accept All CookiesEnabledEnabledEnabled
Reject All CookiesEnabledDisabledDisabled

In this example Accept Cookies gives the same result as Reject All Cookies, because Analytics and Marketing are disabled by default. For an “Accept” button that enables everything, use Accept All Cookies.

Accept Cookies is the right action for the “Save preferences” button of the cookie settings window, where the visitor has just chosen the toggles.

Categories without toggle

Accept All Cookies and Reject All Cookies change only the categories that have Active Toggle on. A category with Active Toggle off always keeps its Initial State.

This is how you create a category that is always enabled, such as “Necessary”: turn Active Toggle off and leave Initial State on. In the example above, the Necessary category stays enabled also when the visitor clicks a button with the Reject All Cookies action.

Recommended configurations

Notice with settings, reject, and accept

ElementTextAction
Cookie notice, Button 1SettingsOpen Cookie Settings
Cookie notice, Button 2RejectReject All Cookies
Cookie notice, Button 3AcceptAccept All Cookies
Cookie settings, Button 1Save preferencesAccept Cookies
Cookie settings, Button 2Accept allAccept All Cookies

Simple informative notice

ElementTextAction
Cookie notice, Button 1Read moreOpen Cookie Settings
Cookie notice, Button 2OKAccept Cookies
Cookie settings, Button 1CloseClose Cookie Settings
Cookie settings, Button 2OKAccept Cookies

Common mistakes

The notice is displayed again on every page

No button of the notice saves the choice. This happens when the button your visitors click has the Close Cookie Notice action, which hides the notice only for the current page view.

Solution: assign Accept Cookies, Accept All Cookies, or Reject All Cookies to that button. Then clear your browser cache and cookies and test again.

The Accept button does not enable the scripts

The accept button uses Accept Cookies and the categories have Initial State off. The visitor accepts, but the categories stay disabled.

Solution: set the action of the accept button to Accept All Cookies.

There is no reject button

The default configuration has only the Settings and Accept buttons.

Solution: assign the Reject All Cookies action to one of the buttons, for example Button 3, and set its text to “Reject”.

The Settings button is not needed

Solution: set the action of that button to Disabled. The button is removed from the notice.

The reject button does not stop a script

Reject All Cookies disables the categories. It stops only the scripts that you added to the categories. A script added by your theme or by another plugin is not affected. See Running Scripts Based on Visitor Consent.

Related articles