Skip to main content

Share consent between main domain and subdomains

Share consent across your main domain and its subdomains.

Written by Manon Manso

To ensure a smooth experience for your users across all your sites, you can configure consent sharing between your main domain and its subdomains. This allows you to avoid displaying the consent banner each time a subdomain changes.

Once the user expresses their choice on mysite.fr, it is automatically recognized on app.mysite.fr, blog.mysite.fr, etc. No need to ask for their consent each time: the experience is smoother, and the interaction rate improves.

👉 In this article, we will use as an example a main domain mysite.fr, with two subdomains: app.mysite.fr and blog.mysite.fr.

Prerequisites

  1. Create a single Axeptio project. You will need to load this same project on all your sites.

  2. In your banner, add all the services used on your main domain and your subdomains.

  3. Integrate Axeptio on all the sites concerned, making sure to load the same project.

Setting the userCookiesDomain parameter

If you integrated Axeptio via Google Tag Manager

  1. Make sure you have properly installed our Axeptio CMP tag template by following our guide.

  2. Open your Axeptio CMP tag (its name may be different if you renamed it).

  3. In the panel that appears, click inside the Tag configuration block to edit it.

  4. At the bottom of the block, expand the Cookie settings section.

  5. In the User cookies domain field, enter your main domain without prefix (no http://, https://, or www). In our example, enter mysite.fr

  6. Click the Save button in the top right.

  7. Back in Tags, click the Submit button in the top right to make your changes effective.

If you integrated Axeptio via your CMS

  1. Go to the plugin/module configuration interface in your CMS. Locate the field that allows you to enter your main domain, usually titled User cookies domain.

  2. Enter your main domain without prefix (no http://, https://, or www). In our example, enter mysite.fr

If you integrated Axeptio hardcoded

In the Axeptio initialization script, add the userCookiesDomain property to the axeptioSettings object:

<script>
window.axeptioSettings = {
clientId: "xxxxxxxxxxxxxxxxxxxxxxx",
cookiesVersion: "ma-config-fr",
userCookiesDomain: "mysite.fr" // Replace here the value with your main domain (without http, https, or www) to share consent between all your subdomains
};

(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>
Did this answer your question?