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
- DOM & Event Listeners Measure clicks on any DOM element to Google Analytics 4 with Kixell Tag, without code: data-kt-dc, data-kt-en attributes and up to 5 event parameters.
- dataLayer and custom events Push your own events to Google Analytics 4 via the Kixell Tag dataLayer, without touching GTM: kixelltag_custom_event, parameters and triggering after consent (kixelltagOnReady).