# CookieYes Events on Cookie Banner Interactions

When the user interacts with a banner, an event will be emitted. Your website can listen to this event and perform the necessary action by implementing event listener. The snippet below creates an event listener and checks the value in the JSON eventData

---

**Categories:** , 
**Published:** June 25, 2026
**URL:** https://www.cookieyes.com/documentation/events-on-cookie-banner-interactions/

---

> **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.
>

```
[object Object],[object Object],[object Object]
```

```js
document.addEventListener("cookieyes_consent_update", function (eventData) 
{
    // Check the value in the JSON eventData and perform desired action
});
```

```
[object Object]
```

```js
detail: { "accepted":[ "Category1", "Category2" ],"rejected":[ "Category3","Category4" ] }
```

## Example of CookieYes Event Listener

This example demonstrates the implementation of an event listener on the website to perform the desired action and check if the analytics category is accepted by adding the following snippet to the HTML.

```js
<script>
  document.addEventListener("cookieyes_consent_update", function (eventData)
 {
   const data = eventData.detail;
   if (data.accepted.includes("analytics")) {
      // perform desired action.
    }
  });
  </script>
```

```
[object Object]
```

> If you change or edit the category name, you still have to use the default category name (necessary, functional, analytics, performance and advertisement).
> *For example*, if you rename the “Analytics” category to “Analytique,” you would still need to use if `(data.accepted.includes("analytics"))` instead of if `(data.accepted.includes("analytique"))`.
>

```
[object Object]
```

```js
detail: {
    "accepted": ["necessary","analytics","advertisement"],
    "rejected": ["functional","performance","other"]
}
```

```
[object Object],[object Object],[object Object]
```

```js
detail: {
     "accepted": ["necessary","advertisement"], 
     "rejected":["analytics","functional","performance","other"]
}
```

If you have any issues or queries regarding CookieYes, feel free to contact our support team.


---

## Structured Data

```json
{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@type": "Article",
      "headline": "CookieYes Events on Cookie Banner Interactions",
      "mainEntityOfPage": {
        "@type": "WebPage",
        "@id": "https://www.cookieyes.com/documentation/events-on-cookie-banner-interactions/"
      },
      "url": "https://www.cookieyes.com/documentation/events-on-cookie-banner-interactions/",
      "publisher": {
        "@type": "Organization",
        "name": "CookieYes",
        "url": "https://www.cookieyes.com",
        "logo": {
          "@type": "ImageObject",
          "url": "https://assets.cookieyes.com/cookieyes.png",
          "width": 250,
          "height": 60
        }
      },
      "description": "When the user interacts with a banner, an event will be emitted. Your website can listen to this event and perform the necessary action by implementing event listener. The snippet below creates an event listener and checks the value in the JSON eventData",
      "datePublished": "2022-08-26T09:55:07+00:00",
      "dateModified": "2025-06-02T06:19:27+00:00",
      "author": {
        "@type": "Person",
        "name": "CookieYes Doc Team"
      },
      "image": [
        "https://assets.cookieyes.com/Cookieyes_logo_65b0e62114.png"
      ]
    },
    {
      "@type": "BreadcrumbList",
      "@id": "https://www.cookieyes.com/documentation/events-on-cookie-banner-interactions/#breadcrumb",
      "itemListElement": [
        {
          "@type": "ListItem",
          "position": 1,
          "name": "Home",
          "item": "https://www.cookieyes.com/"
        },
        {
          "@type": "ListItem",
          "position": 2,
          "name": "Documentation",
          "item": "https://www.cookieyes.com/documentation/"
        },
        {
          "@type": "ListItem",
          "position": 3,
          "name": "Features Documentation",
          "item": "https://www.cookieyes.com/category/documentation/features/"
        },
        {
          "@type": "ListItem",
          "position": 4,
          "name": "Events",
          "item": "https://www.cookieyes.com/category/documentation/features/event-listener/"
        },
        {
          "@type": "ListItem",
          "position": 5,
          "name": "CookieYes Events on Cookie Banner Interactions"
        }
      ]
    },
    {
      "@type": "WebSite",
      "@id": "https://www.cookieyes.com/#website",
      "url": "https://www.cookieyes.com/",
      "name": "CookieYes",
      "description": "CookieYes is a Google-certified consent management platform that helps businesses comply with GDPR, CCPA, and other global privacy laws.",
      "inLanguage": "en-US",
      "publisher": {
        "@id": "https://www.cookieyes.com/#organization"
      },
      "potentialAction": {
        "@type": "SearchAction",
        "target": {
          "@type": "EntryPoint",
          "urlTemplate": "https://www.cookieyes.com/?s={search_term_string}"
        },
        "query-input": {
          "@type": "PropertyValueSpecification",
          "valueRequired": true,
          "valueName": "search_term_string"
        }
      }
    },
    {
      "@type": "Organization",
      "@id": "https://www.cookieyes.com/#organization",
      "name": "CookieYes",
      "url": "https://www.cookieyes.com/",
      "logo": {
        "@type": "ImageObject",
        "@id": "https://www.cookieyes.com/#/schema/logo/image/",
        "inLanguage": "en-US",
        "url": "https://assets.cookieyes.com/cookieyes.png",
        "contentUrl": "https://assets.cookieyes.com/cookieyes.png",
        "width": 19701,
        "height": 3176,
        "caption": "CookieYes"
      },
      "image": {
        "@id": "https://www.cookieyes.com/#/schema/logo/image/"
      }
    }
  ]
}
```
