Skip to main content

Hide the banner and widget on specific pages

Too much cookies !

Adrian ESCRIVA avatar
Written by Adrian ESCRIVA
Updated over a week ago

Sometimes, certain parts of your website may not require a cookie banner.
If this is your case, here are several use cases for blocking the banner display.

1. Block the banner on certain pages via the banner configuration

To set this up, go to the "Integrate on your site" tab in your configuration interface.

Scroll down until you reach the section for hiding the banner and widget.

In this field, you can enter the URLs where you don’t want Axeptio to appear.


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

For example:

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


2. Blocking the banner from loading on a subdomain


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

  • If you hardcode Axeptio in your code:

In your Axeptio code, add a condition based on the domain name.
For example, for a site called domain.com with a subdomain called sub.domain.com, you can add a condition like this:

if(!window.location.hostname.startsWith('sub')){ 
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 run on that subdomain!

  • If you load Axeptio via GTM:

In your Axeptio tag within GTM, you can add a condition to its trigger so that it does not fire on a specific subdomain.

Let’s take the case of a domain called domain.com with a subdomain sub.domain.com where we don’t want Axeptio to load.

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

This will prevent the banner from loading on our subdomain!

Did this answer your question?