Skip to main content

Hide the banner and widget on certain pages

When there are too many cookies, it causes problems!

Written by Alexandre Dias Da Silva

It may happen that certain parts of your site do not need a cookie banner. If this is your case, here are several use cases to block the banner display.

1. Block the banner on certain pages via banner configuration

To configure this option, go to the "Integrate on your site" tab from your configuration interface.

Scroll down the page until you find the section dedicated to hiding the banner and widget.

In this area, you can indicate the URLs where you do not want to display Axeptio.

💡 Tip: you only need to enter the URL path, not the full domain.

For example:

To block the display on mescookies.fr/environnement and mescookies.fr/aide, simply enter:

"/environnement,

/aide"


2. Block banner loading on a subdomain

If you want to block your banner on an entire subdomain, you will need to block Axeptio loading for that entire subdomain.

  • If you load Axeptio directly in your code:


At the level of your Axeptio code, add a condition on the domain name.
For example, for a site called domaine.com with a subdomain called sous.domaine.com, you can add a condition like this:

if(!window.location.hostname.startsWith('sous')){
window.axeptioSettings = {
clientId: "604b3fe68f5ec07be74b0f17",
cookiesVersion: "fr-eu",
googleConsentMode: {
default: {
analytics_storage: "denied",
ad_storage: "denied",
ad_user_data: "denied",
ad_personalization: "denied",
wait_for_update: 500
}
}
};

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

}

This way, the Axeptio script will not be executed on this subdomain!

  • If you load Axeptio via GTM:

At the level of your Axeptio tag in GTM, you can add a condition on its trigger so that it does not trigger on a particular subdomain.


Let's take the case of a domain called domaine.com with a subdomain sous.domaine.com, on which we do not want Axeptio to be loaded.

We can then trigger our Axeptio tag on "Consent Initialization", with a condition on the page domain:

This way the banner will not be loaded on our subdomain!

Did this answer your question?