API

Your site displays popups for various reasons:

  • Legal obligations requiring majority,
  • Newsletter sign-ups,
  • Promotional codes or marketing engagements,
  • Etc.

To avoid overlapping popups and obtain prior consent from your users, you can integrate your popups with our API. This allows you to know when the user has made their consent choice.

Here is an example code to determine if the consent banner is visible or not:

window.kixelltagOnReady = window.kixelltagOnReady || [];
window.kixelltagOnReady.push(function (KixellTag) {
    KixellTag.on('popupVisible', function(isVisible) {
        console.log("PopupState: ", (isVisible ? 'visible' : 'not visible'));
        if (!isVisible) {
            // Trigger your events here
        }
    });
});

This code listens for the popupVisible event and executes appropriate actions based on the visibility of the consent banner.

API