Skip to main content

Events

NameDescription
MonsidoCookieOnLoadThe event is triggered when the cookie banner is initialized.
MonsidoCookieOnShowThe event is triggered when the cookie banner is displayed on the website (regardless of whether consent has already been submitted or not).
MonsidoCookieOnHideThe event is triggered when the cookie banner is hidden (either consent has already been submitted or cookie banner is forced to be hidden).
MonsidoCookieOnAcceptThe event is triggered when the visitor accepts the use of cookies the first time after page load.
MonsidoCookieOnUpdateThe event is triggered when the visitor changes the use of cookies.
MonsidoCookieRunEssentialScriptsThe event is triggered when the visitor gives consent to essential cookies.
MonsidoCookieRunBasicScriptsThe event is triggered when the visitor gives consent to basic cookies.
MonsidoCookieRunMarketingScriptsThe event is triggered when the visitor gives consent to marketing cookies.
MonsidoCookieRunAnalyticsScriptsThe event is triggered when the visitor gives consent to statistics cookies.
MonsidoCookieRunPersonalisationScriptsThe event is triggered when the visitor gives consent to preferences cookies.

Usage

window.addEventListener('MonsidoCookieOnLoad', (e) => {
console.log('Cookie Banner Loaded');
});
window.addEventListener('MonsidoCookieOnShow', (e) => {
console.log('Cookie Banner Shown');
});
window.addEventListener('MonsidoCookieOnHide', (e) => {
console.log('Cookie Banner Hidden');
});
window.addEventListener('MonsidoCookieOnAccept', (e) => {
console.log('Cookie Consent Accepted');
console.log('Consent', window.monsidoConsentManager.cookiesConsent);
});
window.addEventListener('MonsidoCookieOnUpdate', (e) => {
console.log('Cookie Consent Changed');
console.log('Consent', window.monsidoConsentManager.cookiesConsent);
});

window.addEventListener('MonsidoCookieRunEssentialScripts', (e) => {
// Execute scripts that requires essential consent here
});
window.addEventListener('MonsidoCookieRunBasicScripts', (e) => {
// Execute scripts that requires basic consent here
});
window.addEventListener('MonsidoCookieRunMarketingScripts', (e) => {
// Execute scripts that requires marketing consent here
});
window.addEventListener('MonsidoCookieRunAnalyticsScripts', (e) => {
// Execute scripts that requires statistics consent here
});
window.addEventListener('MonsidoCookieRunPersonalisationScripts', (e) => {
// Execute scripts that requires preferences consent here
});