CookieYes Events on Cookie Banner Load
Last updated on June 2, 2025
On this page
Overview
Note:
Incompatible for CookieYes WordPress plugin without Web App Connection.
The event listeners mentioned in this documentation are incompatible with the CookieYes WordPress plugin when not connected to the web app. However, they seamlessly function with both the web app and the WordPress plugin when it is connected to the web app.
Event Listener
Basic Usage
document.addEventListener("cookieyes_banner_load", function (eventData) {
// Check the value in the JSON eventData and perform the desired action.
})Event Data Structure
detail: {
"activeLaw": "String", // e.g., "gdpr", "ccpa", etc.
"categories": {
"necessary": "Boolean",
"functional": "Boolean",
"analytics": "Boolean",
"performance": "Boolean",
"advertisement": "Boolean"
},
"isUserActionCompleted": "Boolean", // true or false
"consentID": "String", // Unique identifier for the consent
"languageCode": "en" // e.g., "en" for English
}| Property | Type | Description |
|---|---|---|
| activeLaw | string | The legal framework under which the consent is active. |
| categories | object | User consent status for different categories. |
| isUserActionCompleted | boolean | Indicates whether the user interacted with the banner. |
| consentID | string | Unique identifier for the user's consent. |
| languageCode | string | ISO-639-1 code of the displayed banner language. |
Example Usage
<script>
document.addEventListener("cookieyes_banner_load", function (eventData) {
const data = eventData.detail;
if (data.activeLaw === "gdpr") {
// perform the desired action.
}
});
</script>detail: {
"activeLaw": "gdpr",
"categories": {
"necessary": true,
"functional": false,
"analytics": false,
"performance": false,
"advertisement": false
},
"isUserActionCompleted": true,
"consentID": "bFl2eFJBN05VS21WNWk5enpRNTNEZ3hxR0dDc3VmcFM",
"languageCode": "en"
}