Remove cookie banner script when Cookie Banner is not used

Status: Not Currently Planned

Status history

We are trying to improve our Website’s performance so want to remove unused/unnecessary scripts on our site.

We have identified the Cookie banner script: https://js.hs-banner.com/v2/\[unique-id]/banner.js .

We are using another tool for our Cookie banner so do not require HubSpot’s tool.

According to Google lighthouse this is a resource of:

207.951 KiB

We shouldn’t have to load this resource if we are not using it. So I want to request that it is not loaded if the Cookie tool is not used as it is negatively affecting our Core Web Vitals for no reason.

+1 this would really help us too as we don’t have anything enabled related to the cookie banner/consent and I was just informed from hubspot support that just because I’m using the tracking code the `banner.js` is loaded automatically.

Hi everyone! Thanks for the engagement on this post. My name is Rada and I’m the product manager for HubSpot’s cookie consent tools.

I’m marking this idea as ‘Not currently planned’ because the current infrastructure limits the possibility of decoupling the banner.js script from HubSpot’s tracking code. Beyond loading the cookie banner itself, the banner.js script is also responsible for dropping HubSpot’s cookies so removing this script would cause issues with how HubSpot’s cookies drop at all.

We’re currently working on reducing the size of the banner.js script altogether, which should hopefully have the effect of improving website performance.

+1 My team is in the middle of trying to optimize our website and we’re attempting to lighten the load by removing unecessary JS. Being able to remove this script would be great in the future