Wix enables site owners to add a cookie banner to their site that informs visitors how their cookies are being used and prompts them to provide consent for non-essential cookie types and scripts (for example, Functional, Advertising and Analytics).
The Cookie Banner Settings API allows you to manage the following cookie banner settings on a site:
enabled
: Whether the cookie banner is displayed.theme
: Choose from light, dark, or custom themes.texts
: Text displayed in the banner. See Banner texts default values for details.revisitSettingsConfig
: Whether to display a Revisit button that enables visitors to go back and change their choices.declineAllConfig
: Whether to display a Decline all button.privacyPolicyPageInfo
: A link to a page on the Wix site or to an external URL where the privacy policy can be reviewed.revisitSettingsConfig
: Whether to display a button that enables visitors to go back and change their choices.The following table lists all cookie banner text keys and their default values. Using the API, you can change any of these texts to values of your choice:
Key | Default value |
---|---|
accept.cookies.button | Accept |
advanced.category.analytics.headline | Enable Analytics Cookies |
advanced.category.analytics.paragraph | These cookies help us to understand how visitors interact with our website, discover errors and provide a better overall analytics. |
advanced.category.essential.headline | Essential Cookies |
advanced.category.essential.paragraph | These cookies enable core functionality such as security, verification of identity and network management. These cookies can’t be disabled. |
advanced.category.functional.headline | Enable Functional Cookies |
advanced.category.functional.paragraph | These cookies collect data to remember choices users make to improve and give a more personalised experience. |
advanced.category.marketing.headline | Enable Marketing Cookies |
advanced.category.marketing.paragraph | These cookies are used to track advertising effectiveness to provide a more relevant service and deliver better ads to suit your interests. |
decline.all.button | Decline All |
display.save.default | Save |
open.settings.button | Settings |
policy.banner.text | We use cookies on our website to see how you interact with it. By accepting, you agree to our use of such cookies. |
policy.external.url | " " |
revisit.settings.text | Cookie settings |
view.privacy.policy | Privacy Policy |
It’s important to note the following points before starting to code:
This article shares some possible use cases your app could support, as well as an example flow that could support each use case. You're certainly not limited to these use cases, but they can be a helpful jumping off point as you plan your app's implementation.
You might choose to manage the site's cookie banner display settings with this API, as defined in the introduction. For example, if your app manages the cookie banner display settings across multiple sites.
To change the settings:
Call the Update Cookie Banner Settings endpoint with the fields to update.
For example:
"settings": {
"enabled": true,
"theme": "dark",
"declineAllConfig": {
"enabled": false
}
}
You might choose to manage the texts displayed in the site's cookie banner with this API. For a complete list of default texts, see Banner text default values. For example, if your app manages the cookie banner display settings across multiple sites.
To update cookie banner texts:
Call the Update Cookie Banner Settings endpoint and pass the texts
field as an object with all relevant key:value pairs.
For example:
"texts": {
"accept.cookies.button": "Accept",
"advanced.category.analytics.headline": "Enable all analytics cookies",
"advanced.category.analytics.paragraph": "These cookies track how visitors interact with our website, help us discover errors and provide a better overall experience.",
"decline.all.button": "Decline everything",
"policy.banner.text": "We use cookies on this website. By accepting, you agree to our use of cookies."
}
Whether the site contributor has acknowledged the consent policy requirements.
Configuration settings for the "decline all" button.
For internal use.
Texts to be displayed on the cookie banner. See Banner texts for details.
Visual theme.
Configuration settings for the "revisit settings" button.
Custom theme configuration.
Whether the banner is activated.
Location of the site's privacy policy.
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Updates the cookie banner settings.
You can only call this method when authenticated as a Wix app or Wix user identity.
Cookie banner settings to update.
Updated cookie banner settings.
Update a site's cookie banner settings using an API key
curl POST 'https://wixapis.com/cookie-consent/v1/cookie-banner-settings/update' \
-H 'Authorization: <AUTH>' \
-H 'wix-site-id: <SITEID>' \
-d '{
"settings": {
"cookiePolicyRequirementApproved": true,
"texts": {
"accept.cookies.button": "Accept",
"open.settings.button": "Settings",
"view.privacy.policy": "Privacy Policy",
"decline.all.button": "Decline All",
"policy.banner.text": "We use cookies on our website to see how you interact with it. By accepting, you agree to our use of such cookies.",
"policy.external.url": " ",
"display.save.default": "Save",
"revisit.settings.text": "Cookie settings",
"advanced.category.essential.headline": "Essential Cookies",
"advanced.category.essential.paragraph": "These cookies enable core functionality such as security, verification of identity and network management. These cookies can't be disabled.",
"advanced.category.marketing.headline": "Enable Marketing Cookies",
"advanced.category.marketing.paragraph": "These cookies are used to track advertising effectiveness to provide a more relevant service and deliver better ads to suit your interests.",
"advanced.category.functional.headline": "Enable Functional Cookies",
"advanced.category.functional.paragraph": "These cookies collect data to remember choices users make to improve and give a more personalised experience. ",
"advanced.category.analytics.headline": "Enable Analytics Cookies",
"advanced.category.analytics.paragraph": "These cookies help us to understand how visitors interact with our website, discover errors and provide a better overall analytics."
},
"theme": "custom",
"audience": "all_visitors",
"declineAllConfig": {
"enabled": false,
},
"revisitSettingsConfig": {
"enabled": false,
"buttonPosition": "bottom_left"
},
"expiryDate": "1970-01-01T00:00:00.000Z",
"enabled": false,
"customThemeConfig": {
"primaryColor": {
"value": "#60A672"
},
"secondaryColor": {
"value": "#C23F3F"
},
"fontFamily": "\"helvetica-w01-light\",\"helvetica-w02-light\",sans-serif",
"fontSize": "15px"
}
}
}'
{
"settings": {
"appEnabled": true,
"audience": "all_visitors",
"cookiePolicyRequirementApproved": true,
"declineAllConfig": {
"enabled": false,
"geo": []
},
"expiryDate": "1970-01-01T00:00:00Z",
"privacyPolicyPage": "terms-and-coniditions",
"privacyPolicyType": "page_on_site",
"texts": {
"accept.cookies.button": "Accept12",
"advanced.category.analytics.headline": "Enable Analytics Cookies",
"advanced.category.analytics.paragraph": "These cookies help us to understand how visitors interact with our website, discover errors and provide a better overall analytics.",
"advanced.category.essential.headline": "Essential Cookies",
"advanced.category.essential.paragraph": "These cookies enable core functionality such as security, verification of identity and network management. These cookies can't be disabled.",
"advanced.category.functional.headline": "Enable Functional Cookies",
"advanced.category.functional.paragraph": "These cookies collect data to remember choices users make to improve and give a more personalised experience. ",
"advanced.category.marketing.headline": "Enable Marketing Cookies",
"advanced.category.marketing.paragraph": "These cookies are used to track advertising effectiveness to provide a more relevant service and deliver better ads to suit your interests.",
"decline.all.button": "Decline All",
"display.save.default": "Save",
"open.settings.button": "Settings",
"policy.banner.text": "We use cookies on our website to see how you interact with it. By accepting, you agree to our use of such cookies.",
"policy.external.url": " ",
"revisit.settings.text": "Cookie settings",
"view.privacy.policy": "Privacy Policy"
},
"theme": "custom",
"revisitSettingsConfig": {
"enabled": false,
"buttonPosition": "bottom_left"
},
"customThemeConfig": {
"primaryColor": {
"name": "color-18",
"value": "#9A9085"
},
"secondaryColor": {
"name": "color-1",
"value": "#FFFFFF"
},
"fontFamily": "\"forum\",serif",
"fontSize": "15px",
"cornerRadius": "square"
},
"enabled": false,
"privacyPolicyPageInfo": null
}
}