Skip to main content

How to set the widget for a sub-domain ?

Centralize user consent across an entire main domain.

Manon Manso avatar
Written by Manon Manso
Updated yesterday

To ensure the centralization of user consent across your main domain, you must include the userCookiesDomain property within the axeptioSettings object in your configuration script. This ensures consistent and sustainable consent management, without requiring complex solutions.

<script> 
window.axeptioSettings = {
clientId: "xxxxxxxxxxxxxxxxxxxxxxx",
cookiesVersion: "v1-moncookiesite",
userCookiesDomain: "moncookiesite.eu" };

(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");
</script>

In other words, you should:

  1. Create a single project for your main domain

  2. Customize the widget by listing all cookies used on your main domain and its subdomains

  3. In your project script, add the line:
    userCookiesDomain: "yourdomain.com"

  4. Embed this script on your main domain site and across all of its subdomains

This setup ensures that cookie consent is respected across your entire domain and its subdomains.

As a result, the widget will no longer appear systematically if the visitor has already given their consent on a different subdomain than the one they are currently visiting. 😉

Did this answer your question?