Skip to main content
All CollectionsCookie banner 🍪Cookies
Reset your visitors' consent

Reset your visitors' consent

M
Written by Manon Manso
Updated over a week ago

Like Neo, you want to start again from zero ?

You can reset the consent of your visitors in order to request their consent on their next visit. This can be useful if you have modified your widget and want to present the new version to all your visitors.

To do so, you will have to add a piece of code in your Axeptio script:

constdeleteAxeptioCookie = () => { 
constcookies = document.cookie.split("; ");
for (constcookieofcookies) {
consteqPos = cookie.indexOf("=");
constname = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;
if(name === "axeptio_cookies"){
document.cookie = name + "=; Path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT";
}
}
}
window._axcb = window._axcb || [];
window._axcb.push(function(sdk){
sdk.on('cookies:complete',function(choices){
constconsentDate = newDate(choices.$$date);
constdesiredDate = newDate('2021-12-17T14:30:30.499Z'); //Change the date to your new desired date
if(consentDate < desiredDate){
deleteAxeptioCookie();
window.location.reload();
}
})
})

This script will have the effect of deleting the consent stored in the visitor's browser, if it is older than the value "desiredDate", which you can change as you wish.

🌈 The deletion will occur only in the visitor's browser, the evidence of their old consent will still be kept in your consent record, and a new evidence will be created for their new consent

Did this answer your question?