Skip to main content

Reset your visitors' consent

Written by Alexandre Dias Da Silva

Like Neo, do you want to start from scratch?

You can reset your visitors' consent in order to ask them again for their consent on their next visit. This action can be useful if you have modified your widget and want to present the new version to all your visitors.

To do this, you will need to add a piece of code to your Axeptio script (Lower section):

<script>window.axeptioSettings = { clientId: "xxxxx",  googleConsentMode: {    default: {      analytics_storage: "denied",      ad_storage: "denied",      ad_user_data: "denied",      ad_personalization: "denied",      wait_for_update: 500    }  }};(function(d, s) {  var t = d.getElementsByTagName(s)[0], e = d.createElement(s);  e.async = true; e.src = "//static.axept.io/sdk.js";  t.parentNode.insertBefore(e, t);})(document, "script");/* *********************Add from here onwards, after Axeptio has loaded **********************/ const deleteAxeptioCookie = () => { 
const cookies = document.cookie.split("; ");
for (const cookie of cookies) {
const eqPos = cookie.indexOf("=");
const name = 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){
const consentDate = new Date(choices.$$date);
const desiredDate = new Date('2021-12-17T14:30:30.499Z'); // Modify the date as you wish
if(consentDate < desiredDate){
deleteAxeptioCookie();
window.location.reload();
}
})
})</script>

This script will delete the consent stored in the visitor's browser, if it is older than the "desiredDate" value, which you can modify as you wish.

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

Did this answer your question?