Interactions

Consent can be collected on various user interactions with the website (scroll, navigation, etc.).

These options are disabled by default as, under GDPR and ePrivacy, collecting consent when the user interacts with a website (apart from an explicit Agree button), is usually not considered a valid consent. Local exceptions might apply so these options can be enabled if your legal department considers them to be valid for your operations.

Scroll

Our banner supports the option of collecting consent when the user scrolls down a page. That means that, when the user scrolls down a certain amount of the page, the banner gets closed and the user consent is registered. The banner will not be shown again on the following pages.

You can enable or disable that option with the notice.closeOnScroll option.

To enable consent on scroll:

<script type="text/javascript">
window.didomiConfig = {
  app: {
    apiKey: '<Your API key>'
  },
  notice: {
    closeOnScroll: true
  }
};
</script>

To disable consent on scroll:

<script type="text/javascript">
window.didomiConfig = {
  app: {
    apiKey: '<Your API key>'
  },
  notice: {
    closeOnScroll: false
  }
};
</script>

Thresholds

By default, consent is collected after the user scrolls more than 30% of the page. This can be configured in two ways:

  • Collect consent after the user scrolls more than X% of a page (percent-based)

  • Collect consent after the user scrolls more than X pixels on a page (absolute)

Percent-based scroll threshold

To collect consent after the user scrolls a certain percentage of the page:

<script type="text/javascript">
window.didomiConfig = {
  app: {
    apiKey: '<Your API key>'
  },
  notice: {
    closeOnScroll: true,
    closeOnScrollThresholdType: 'percent',
    closeOnScrollThreshold: 30,
  }
};
</script>

Absolute scroll threshold

To collect consent after the user scrolls a certain number of pixels on the page:

<script type="text/javascript">
window.didomiConfig = {
  app: {
    apiKey: '<Your API key>'
  },
  notice: {
    closeOnScroll: true,
    closeOnScrollThresholdType: 'absolute',
    closeOnScrollThreshold: 300,
  }
};
</script>

Our banner supports the option of collecting consent when the user navigates to another page of your website. That means that, when the user clicks on a link to another page, the banner get closed and the user consent is registered. The banner will not be shown again on the following pages.

You can enable or disable that option with the notice.closeOnClick option.

To enable consent on navigation:

<script type="text/javascript">
window.didomiConfig = {
  app: {
    apiKey: '<Your API key>'
  },
  notice: {
    closeOnClick: true
  }
};
</script>

To disable consent on navigation:

<script type="text/javascript">
window.didomiConfig = {
  app: {
    apiKey: '<Your API key>'
  },
  notice: {
    closeOnClick: false
  }
};
</script>

Delay

This option allows you to set a delay that will be applied when consent is collected after the user navigates to another page of your website. That delay will allow your vendors to execute on the first page before the user is redirected to the page he was meant to navigate to. It helps not losing data that would only be available on the first page that the user gets on (for analytics and attribution, for instance).

With this option, the chain of events becomes:

  1. User clicks on a link to navigate to another page of your website

  2. Consent is collected

  3. Vendors' tags are fired on the page

  4. Delay of X milliseconds

  5. User navigates to the other page

If the user has already given consent by another mean, no delay will be applied.

To enable this option, set your delay in milliseconds in the notice.closeOnClickNavigationDelay property:

<script type="text/javascript">
window.didomiConfig = {
  app: {
    apiKey: '<Your API key>'
  },
  notice: {
    closeOnClick: true,
    closeOnClickNavigationDelay: 500 // Delay of 500 milliseconds
  }
};
</script>

This option is disabled by default and no delay is applied.

Backdrop click

Our banner supports the option of collecting consent when the user clicks on the backdrop when the popup notice is open. By default, this option is disabled but you can enable it with the notice.closeOnClickBackdrop option.

This feature only applies to the "popup" notice.

<script type="text/javascript">
window.didomiConfig = {
  app: {
    apiKey: '<Your API key>'
  },
  notice: {
    closeOnClickBackdrop: true
  }
};
</script>

Last updated