Skip to main content

Share consent between main domain and subdomains

Share consent across your primary domain and its subdomains.

Written by Alexandre Dias Da Silva

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 users switch subdomains.

Once the user makes their choice on mysite.fr, it is automatically recognized on app.mysite.fr, blog.mysite.fr, etc. No need to ask for their consent again: the experience is smoother, and engagement rates improve.

👉 In this article, we will use a main domain mysite.fr as an example, 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 subdomains.

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

Set 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 a 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 where you can enter your main domain, usually titled User cookies domain.

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

If you integrated Axeptio manually

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 with your main domain (without http, https, or www) to share consent across 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?