Duration of consents conservation

You want to change the duration of consents conservation

1. Introduction

The solution is set to save consents for a 11 months duration. You can save all your consents and find your consents register simply by checking the box "Save consent proof in axeptio's audit trail"

We'll save consents in a cookie located in the explorer local Storage.

At the end of the 11 months the consent will automatically be asked again by making the cookie expire, which will display the widget again.

2. The widget is always displayed on your website

Then the choices will be kept on your site for 11 months, after what they will be automatically reinitialized.

In that case, once the user gave his consent, then the widget will disappear for 11 months. If you want the widget to appear again after 6 months, here is how :

When integrating the code, add this code at the same place as the SDK :

var nbOfDaysToWaitBeforeAskingAgain = 30 * 6;window._axcb = window._axcb || [];
window._axcb.push(function(sdk) {
  try {
    var json = sdk.userPreferencesManager.readChoicesFromCookies(
      "axeptio_cookies"
    );
    if (json && json.$$date) {
      var acceptedAt = new Date(json.$$date);
      var now = new Date();
      if (
        (now.getTime() - acceptedAt.getTime()) / (1000 * 60 * 60) >
        nbOfDaysToWaitBeforeAskingAgain
      ) {
        window.openAxeptioCookies();
      }
    }
  } catch (err) {
    console.error('Axeptio could not read previous choices nor parse consent date', err);
  }
});

Last updated