Marketing tools

HubSpot cookie banner: setup guide, limits and when to use a CMP

Article contents

Many marketing teams discover the HubSpot cookie banner the day they install the tracking code. It is already in the settings, it costs nothing, and it looks like the end of the problem. It solves part of it. This guide explains how the banner works, how to set it up in the current editor, which cookies it controls and where it stops. The logic is the same on most site builders, as our guide to cookie consent on Webflow shows for another platform. If you want the wider compliance picture (DPA, forms, retention), read our HubSpot cookies and GDPR guide first.

HubSpot calls it a consent banner. You configure it in Settings → Privacy & Consent → Cookies, and HubSpot's knowledge base lists it for "All products and plans". It applies to every page hosted on HubSpot (website pages, landing pages, blog) and to external pages where the HubSpot tracking code is installed. So a WordPress site that only loads the tracking code can also show it.

What the banner controls:

  • the HubSpot analytics cookies: __hstc, hubspotutk, __hssc and __hssrc;
  • functionality cookies such as messagesUtk for the chat;
  • the Google Analytics and Google Tag Manager scripts added through HubSpot's own integrations;
  • advertising pixels (Meta, LinkedIn, Google) installed through the HubSpot ads tool, which fire only after consent when opt-in is required.

What it does not control: any script you placed manually in your pages or in a header field. HubSpot states it plainly in its cookie documentation: it cannot control cookies set by third-party scripts on your website. A Meta pixel pasted into the site header, a Hotjar snippet or a Google tag added by hand keep running whatever the visitor chooses.

The three HubSpot banner types

HubSpot offers three banner types. The choice decides whether the banner is valid under the GDPR.

  • Notification: it informs visitors that the site uses cookies, with no way to accept or refuse. Cookies load anyway.
  • Opt-in: HubSpot cookies do not load until the visitor accepts. The visitor can accept or decline.
  • Opt-out: cookies load straight away and the visitor can decline afterwards.

On top of opt-in and opt-out, the by category option adds a link to a list of categories (analytics, advertisement, functionality) that the visitor can switch on or off one by one.

For visitors in the EU and the UK, only opt-in is compatible with Article 5(3) of the ePrivacy Directive and the GDPR consent rules: non-essential cookies need consent before they are set. A notification banner informs, it does not collect consent. Our article on opt-in vs opt-out consent explains why the difference matters. Opt-out remains common in the United States, where laws such as the CCPA work on a right to refuse; see our CCPA cookie banner requirements.

HubSpot moved to a new consent banner editor. Accounts created after November 2022 use it by default, and HubSpot began migrating legacy accounts automatically on May 11, 2026. The steps below follow the new editor.

Step 1: verify your domain

You need the Website settings permission. The domain must be known to HubSpot: either connected to HubSpot, or an external domain where the tracking code is installed. For an external site, click Add external domain: HubSpot checks that the tracking code is present at that URL.

Step 2: create the banner

Under Domains Connected to HubSpot, open your domain and click Create consent banner. Give it an internal name, then define where it applies: a URL path, and a list of countries based on the visitor's IP address. With no country selected, the banner targets every visitor.

Step 3: choose opt-in by category

Select the Opt-in type and tick Allow opt-in by category. This lets visitors accept analytics but refuse advertising, which matches the requirement that consent be specific to each purpose.

Step 4: write the texts

Fill in the notification text, the accept and decline button labels, and the cookie settings label. Keep the decline button as visible as the accept button: the CNIL and the European Data Protection Board both consider that refusing must be as easy as accepting. Name the purposes in plain words rather than "to improve your experience".

Step 5: respect privacy signals

Switch on Respond to Global privacy signaling if you have US visitors. The banner then honours the Global Privacy Control signal sent by some browsers.

Step 6: add the cookie settings button

Under your domain, expand Cookie Settings Button, copy the code and paste it into your footer or privacy page. Article 7(3) of the GDPR requires withdrawing consent to be as easy as giving it. Without this button, a visitor who closed the banner has no way back.

Step 7: check the advanced settings

The Advanced cookie banner settings section has two toggles, Deactivate cookies? and Allow all cookies?. With either one on, the banner does not display on the selected pages. Leave both off unless you know why you need them.

Which cookies HubSpot sets and how long they last

HubSpot publishes the list of cookies it sets. The ones the banner controls:

  • __hstc: main tracking cookie, six months;
  • hubspotutk: visitor identifier used to link form submissions to a contact, six months;
  • __hssc: session tracking, 30 minutes;
  • __hssrc: detects a new session, end of session;
  • messagesUtk: chat identifier, six months.

HubSpot also sets cookies it classifies as necessary, which load whatever the choice: __hs_cookie_cat_pref records the accepted categories (six months), __hs_opt_out records a refusal (six months), and Cloudflare cookies such as __cf_bm protect the service. Necessary cookies are exempt from consent only if they really are needed for the service the visitor asked for, so list them in your cookie policy anyway.

The list on your own site is longer than HubSpot's: video embeds, chat tools, A/B testing and ad pixels add their own. Before deciding whether the native banner is enough, it helps to know what it would cost to replace it. Compare the cost of your current CMP with our free CMP cost comparison.

The limits of the HubSpot banner for GDPR compliance

The HubSpot banner is a good fit when HubSpot is the only tracking on the site. It shows its limits as soon as other tools come in.

Scripts added by hand are not blocked. This is the main gap. Any tag pasted into the site header HTML or into a template runs before consent. To block them with the HubSpot banner, a developer has to wrap each script in a listener (addPrivacyConsentListener) and load it only when the right category is accepted. HubSpot gives examples for the Google tag and Hotjar. Each new tool means more code.

Google Consent Mode is not covered in the banner documentation. HubSpot's knowledge base pages on the consent banner and its developer documentation do not describe sending Google Consent Mode v2 signals. If you run Google Ads in Europe, you need those signals, and you will have to wire them yourself or use a tool that sends them. Our Google Consent Mode v2 guide explains what is expected.

Necessary cookies still load. That is normal, but it means a refusal does not mean "no HubSpot cookie at all".

Declined visitors disappear from contact timelines. When a visitor declines, their page views are not attached to a contact record. This is the intended effect of the refusal, and it changes your attribution reports.

Using a third-party CMP with HubSpot

When the site loads more than HubSpot, a consent management platform (CMP) can manage every tool in one place. HubSpot's developer documentation gives the pieces to connect the two:

  • window.disableHubSpotCookieBanner = true, set in the head before the HubSpot banner loads, turns the native banner off. HubSpot warns that this also turns off its consent management, so the CMP takes over.
  • _hsp.push(['setHubSpotConsent', ...]) passes the visitor's choice for the analytics, advertisement and functionality categories to HubSpot. HubSpot does not save this state in its consent cookies, so the CMP must send it again on each page load.
  • _hsp.push(['revokeCookieConsent']) removes HubSpot's tracking cookies when a visitor withdraws consent.
  • _hsq.push(['doNotTrack']) stops all HubSpot collection, including anonymised traffic. It is stronger than a refusal of analytics, so use it with care.

Two more settings deserve attention on HubSpot-hosted sites. In Settings → Content → Pages, the Google Analytics 4 and Google Tag Manager integration checkboxes inject those scripts under the control of the HubSpot banner only: untick them and load the tools through the CMP instead. And if your site runs on WordPress with the HubSpot plugin, install the CMP on WordPress itself, as described in our WordPress cookie consent guide.

FlowConsent is one example of this setup: its HubSpot installation adds the disableHubSpotCookieBanner flag in the same snippet as the banner, so visitors never see two banners.

HubSpot banner or CMP: how to decide

Keep the native HubSpot banner if:

  • HubSpot is the only analytics and marketing tool on the site;
  • your Google Analytics and Tag Manager go through HubSpot's integrations;
  • you do not run Google Ads campaigns aimed at Europe.

Move to a CMP if:

  • you paste other scripts into your pages (Meta pixel, Hotjar, LinkedIn Insight Tag, chat tools);
  • you need Google Consent Mode v2 for Google Ads;
  • you need a cookie scan of the whole site and exportable proof of each choice;
  • you manage several sites, some of them not on HubSpot.

In both cases, test with a private window: refuse everything, then check in the browser's developer tools that no __hstc or hubspotutk cookie and no third-party request appears. The GDPR overview page summarises the rules that apply.

FlowConsent replaces the HubSpot banner with a single banner for every tool on the site. On a HubSpot-hosted site, you paste one snippet at the top of the Site header HTML field: it sets the Google Consent Mode v2 defaults, loads the banner and turns off HubSpot's native banner. Scripts are blocked before consent, the automatic cookie scan lists what the site sets (HubSpot cookies included), and each choice is stored as exportable proof. Data is hosted in Europe. Installation takes about ten minutes and FlowConsent is free up to 25,000 sessions per month, then Pro costs €14.99 per month up to 100,000 sessions. The HubSpot installation guide gives each step.

Questions

Common questions on this topic.

Can't find your question? Write to us, we answer fast.

Is the HubSpot cookie banner free?

Yes. HubSpot's knowledge base lists the consent banner for all products and plans, so you can set it up without a paid subscription. Some styling options in the banner editor are tied to paid Marketing Hub or Content Hub tiers. The banner itself works on HubSpot-hosted pages and on external sites where the HubSpot tracking code is installed.

Does the HubSpot cookie banner block Google Analytics?

Only when Google Analytics is added through HubSpot's own integration. HubSpot states that it cannot control cookies set by scripts placed manually on your pages. If you pasted the Google tag or a Tag Manager container into the site header yourself, it runs before consent unless a developer wraps it in HubSpot's consent listener or a CMP blocks it.

Which HubSpot banner type is GDPR compliant?

Opt-in, ideally with the by-category option. With opt-in, HubSpot cookies are not set until the visitor accepts, which is what Article 5(3) of the ePrivacy Directive requires for non-essential cookies. A notification banner only informs and collects no consent. Opt-out loads cookies first, which suits some US laws but not visitors in the EU or the UK.

How do I turn off HubSpot's cookie banner when using another CMP?

Set window.disableHubSpotCookieBanner to true in the page head, before the HubSpot banner loads. HubSpot warns that this also disables its consent management, so your CMP must then pass the visitor's choice to HubSpot with the setHubSpotConsent function on every page load, because HubSpot does not store that state in its own consent cookies.

Which cookies does HubSpot set before consent?

HubSpot sets cookies it classifies as necessary whatever the visitor chooses, such as __hs_cookie_cat_pref, which records accepted categories for six months, __hs_opt_out and Cloudflare cookies like __cf_bm. With an opt-in banner, the analytics cookies __hstc, hubspotutk, __hssc and __hssrc wait for consent. List all of them in your cookie policy.

Make your site compliant today.

Free up to 25,000 sessions a month. No credit card, no commitment.