You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if ( !denied_time && cmplz_get_banner_status() === 'dismissed' ) {
It seems that complianz has changed the cookie flow and "dismissed" status is given on both approve and deny choices, therefore this code will trigger on either case, regardless has user accepted or denied the consent.
We created a way where we read the cookie state itself, and only run this code when either permission cookies itself are set or denied. If needed I can try to create a pull request here.
Example code here:
function cmplzMarketingCookieStatus() {
let cookie_name = "cmplz_rt_marketing=";
let cArr = document.cookie.split(';');
let marketing_status=false;
for (let i = 0; i < cArr.length; i++) {
let c = cArr[i].trim();
if (c.indexOf(cookie_name) == 0)
marketing_status = c.substring(cookie_name.length, c.length);
}
return marketing_status;
}
function checkMarketingCookieExists() {
const cookieName = "cmplz_rt_marketing";
const cookies = document.cookie.split(';');
for (let i = 0; i < cookies.length; i++) {
let cookie = cookies[i].trim();
if (cookie.startsWith(cookieName + "=")) {
return true
}
}
return false;
}
document.addEventListener("cmplz_cookie_warning_loaded", function() {
console.log("run function");
if (!checkMarketingCookieExists() && cmplz_get_banner_status() === 'dismissed') {
console.log("no marketing cookie, trigger code");
let denied_time = get_denied_time();
console.log(denied_time);
if ( !denied_time && cmplz_get_banner_status() === 'dismissed') {
set_denied_cookie();
} else {
let date = new Date();
let current_time = date.getTime();
let expire_on = parseInt(denied_time);
if ( current_time > expire_on ){
console.log("expired");
cmplz_set_banner_status('show');
set_denied_cookie();
} else {
console.log("not expired");
}
}
}
});
The text was updated successfully, but these errors were encountered:
complianz-integrations/show_denied_banner_after_period.php
Line 34 in 9bceb7d
It seems that complianz has changed the cookie flow and "dismissed" status is given on both approve and deny choices, therefore this code will trigger on either case, regardless has user accepted or denied the consent.
We created a way where we read the cookie state itself, and only run this code when either permission cookies itself are set or denied. If needed I can try to create a pull request here.
Example code here:
The text was updated successfully, but these errors were encountered: