How to set up one Cookie-Consent-Banner for main- and subdomains

We have a Hubspot website where the main menu runs via the main domain, but the pages of business areas with their own subdomains are linked in the menu. We have activated the cookie consent banner for the main domain and would like it to appear on the subdomain pages as well. However, in Hubspot, under Settings/Account Management/Privacy & Content/Cookies, I only have the option to activate a separate banner for each subdomain. This would mean that a new consent banner would appear for each subdomain when browsing the site. I have not found a way to insert a wildcard character in the banner for the URL subdomain or to activate the banner globally. Is there a way to do this that I have overlooked?

I’ve run into this before, and unfortunately, HubSpot treats each subdomain as its own site for cookies, so there isn’t a built-in way to push one banner across all of them with a single toggle. That’s why you’re only seeing the option to activate per subdomain.

What some teams do: Use the HubSpot banner on the main domain, then add the generated consent code manually into the subdomains’ headers (via settings or the template). That way, the same banner script fires everywhere, and users don’t get a new prompt.

Alternatively, if you’re comfortable with dev tweaks, you can use a single external consent manager (Cookiebot, OneTrust, etc.) and embed it on HubSpot + subdomains for unified control.

If you’d like to stay fully native in HubSpot, you’ll need to configure a banner for each subdomain, but you can clone your main domain’s settings so the look and wording stay consistent.

It’s not the most elegant setup, but reusing the same script or going with an external consent manager usually solves the multiple pop-ups problem.

I figured there wasn’t a built-in solution. I’ll try to solve it by adding the generated consent code to the subdomain pages. That seems to be the easiest approach to me, rather than setting up a completely new external consent management system.
Thank you very much for the solutions!

I found another solution: Instead of copying and pasting the scripts manually, there is a more elegant function: You can clone the consent banners and then assign them to a subdomain. This means that the same consent banner is displayed on both the main domain and the subdomains, and once you click on the banner, regardless of which domain you are on, it will only be displayed once.