Cookie banner configuration options
{
cookieBanner: {
class: 'cookie-banner',
showWithPreferencesForm: false,
actions: [
{
name: 'accept',
buttonClass: 'cookie-banner-accept-button',
confirmationClass: 'cookie-banner-accept-message',
consent: true
},
{
name: 'reject',
buttonClass: 'cookie-banner-reject-button',
confirmationClass: 'cookie-banner-reject-message',
consent: false
},
{
name: 'hide',
buttonClass: 'cookie-banner-hide-button',
}
]
}
}
Options
cookieBanner
Within the cookie-manager config `cookieBanner’ subsection, the following options can be used:
class
string
, defaults to cookie-banner
Specifies the class which has been included on the cookie banner element, used for adding event listeners to the cookie banner.
showWithPreferencesForm
boolean
, defaults to false
Specifies if the cookie banner should be displayed when the preference form is also found within the DOM.
actions
action[]
, defaults to
[
{
name: 'accept',
buttonClass: 'cookie-banner-accept-button',
confirmationClass: 'cookie-banner-accept-message',
consent: true
},
{
name: 'reject',
buttonClass: 'cookie-banner-reject-button',
confirmationClass: 'cookie-banner-reject-message',
consent: false
},
{
name: 'hide',
buttonClass: 'cookie-banner-hide-button',
}
]
The actions (buttons and their confirmation messages) of the cookie banner, see action
section below.
action
The actions
subsection is used for defining the buttons and their subsequent messages that appear within the cookie banner
name
string
Required - Specifies name of the action, used within cookie banner emitted events.
buttonClass
string
Required - Specifies the class included on the button related to this action.
confirmationClass
string
Specifies the class included on the message related to this action. Leaving this blank assumes that no messages should follow this action, so the cookie banner will be hidden on the action`s button being clicked.
consent
string[] / boolean
When field is of type string[]
, specifies the categories (by name) to be consented to when the action’s button is clicked.
When field is of type boolean
, specifies all categories should be consented (true
) or rejected (false
) when the action’s button is clicked.