The non-interaction with the banner after x seconds can be set up as a refusal.
You can set this up as you wish thanks to a script that you can integrate to your website.
To do so, follow the steps below!
🕕 Choose the length of the absence of interaction with the consent notice
Decide how long you want to set the inactivity for, to count the latter as a cookie denial.
In the script we're suggesting you, the inactivity is set to 5 seconds.
⚙️ The banner will be displayed when the user access a website. Then, if the user has no interaction with the consent notice for 5 seconds (in this case), the user choice will be considered as a denial.
✍️ Insert the script to set up the option
You have to insert the script below anywhere in your HTML. This script is a standard code that you can adapt depending on your situation.
The script works on all browsers.
<script type="text/javascript">
// Choose a duration for your user inaction (in ms)
var timeout_value = 5000;
// Check if the notice is displayed
window.didomiEventListeners = window.didomiEventListeners || [];
window.didomiEventListeners.push({
event: 'notice.shown',
listener: function () {
// Check if the notice was displayed because we need to collect a consent
if(Didomi.shouldConsentBeCollected()){
setTimeout(function(){
// Set your user consent status to false
Didomi.setUserDisagreeToAll();
// We also suggest that you display a message to tell your users you consider their inaction as a refusal of the notice
// Add your code here to inform your users
}, timeout_value);
}
}
});
</script>
You are totally free to change the inactivity length set to 5 seconds here (cf. code below)!
var timeout_value = 5000