HubSpot Integration
Install ConsentStack on HubSpot CMS, replace HubSpot's cookie banner with your own, and keep your portal's domains in sync automatically.
ConsentStack integrates with HubSpot in two layers. The ConsentStack app for HubSpot connects your portal to a site in your dashboard: it imports your website domains and keeps them in sync automatically. The SDK itself handles the consent behavior on your pages: it turns off HubSpot's built-in cookie banner, shows yours instead, and reports every consent decision to HubSpot's own consent API so HubSpot analytics, chat, and forms follow each visitor's choice.
This page covers the full setup. For the general install reference, see SDK Installation.
Connect your HubSpot portal
From your dashboard, open the site you want to connect, go to Settings, and click Connect on the HubSpot row under Integrations. HubSpot asks you to choose an account and approve the connection, then sends you back to ConsentStack.
The app requests one permission: read access to your portal's website domains (cms.domains.read). It cannot write to your HubSpot content, contacts, or settings.
On connect, ConsentStack imports the domains your portal serves pages on (site, landing page, and blog domains; mail and redirect domains are skipped) into the site's Domains list. After that, domains re-sync automatically once a day, and a Sync now button on the Integrations row runs the same sync on demand.
If you installed the app from the HubSpot marketplace instead, the order flips: after you approve the connection in HubSpot, ConsentStack asks you to sign in (or create an account) and pick which site the portal belongs to. Everything else works the same.
Install the consent script
HubSpot loads ConsentStack the same way as any site: three tags at the top of every page. In HubSpot the right place is Site Header HTML:
- On the site's Settings page, use Copy script on the Integrations row. The HubSpot settings button next to it takes you straight to your portal's page settings.
- In HubSpot, go to Settings > Website > Pages, paste the snippet into Site Header HTML, and save.
The snippet looks like this, with your own site key filled in:
<link rel="preconnect" href="https://cdn.consentstack.io" />
<script src="https://cdn.consentstack.io/consent.js?k=<YOUR_SITE_KEY>"></script>
<script src="https://cdn.consentstack.io/consent-core.js?k=<YOUR_SITE_KEY>"></script>ConsentStack detects the install automatically on the first page load and the Integrations row flips to Active. Nothing else to verify.
The paste is a one-time manual step by design. HubSpot does not offer marketplace apps an API for writing Site Header HTML, so no third-party app can inject the tag for you. The app gets you as close as possible: the exact snippet on your clipboard and a deep link to the field it goes in.
What happens on a HubSpot page
With the script installed, the SDK detects HubSpot and activates its HubSpot adapter. Two things happen:
- HubSpot's banner is turned off. The SDK sets
window.disableHubSpotCookieBannerbefore HubSpot's tracking code boots (your script runs from the page head, HubSpot's tracker loads later), so HubSpot's native cookie banner never renders alongside yours. Visitors see one banner: yours. - Every consent decision is reported to HubSpot. The SDK pushes
setHubSpotConsentonto HubSpot's_hspqueue on every consent change, using HubSpot's Cookie Banner API. HubSpot's own tracking (the__hstcandhubspotutkanalytics cookies, conversations chat, form tracking) then follows what the visitor chose in your banner.
Categories map to HubSpot's three consent fields:
| ConsentStack category | HubSpot consent field |
|---|---|
| Analytics | analytics |
| Marketing | advertisement |
| Functional | functionality |
What about scripts HubSpot does not control?
They are handled by script blocking, not by this integration. Tags you add to your HubSpot pages directly (the Meta Pixel, LinkedIn Insight, heatmap tools) do not read HubSpot's consent record, so ConsentStack blocks them in the browser until the visitor consents. The HubSpot adapter never bypasses that blocking; it adds the HubSpot side on top.
Platforms with native consent APIs of their own (Google, Meta, TikTok, Bing, and others) also get dedicated consent signaling, described in Platform Integrations.
Does the banner need the app?
No. The consent behavior on this page, banner takeover included, comes from the script and works on any HubSpot site where the snippet is installed. The app adds the portal connection on top: automatic domain import, the daily sync, and the guided install. Connecting it is recommended, not required.
Disconnecting
Click Disconnect on the Integrations row to uninstall the app from your portal. ConsentStack calls HubSpot's uninstall API, HubSpot revokes the connection and notifies your portal's admins, and domain sync stops. Your imported domains stay on the site, and the consent script on your pages keeps working exactly as before. You can reconnect at any time.
Uninstalling ConsentStack from your HubSpot account's Connected Apps page has the same effect; the dashboard notices within a day and shows the connection as disconnected.
What's next
- SDK Installation. The full install reference.
- Script Blocking. How third-party tags are held until the visitor consents.
- Platform Integrations. Native consent signaling for Google, Meta, TikTok, and more.
Shopify Integration
Install ConsentStack on any Shopify theme and report consent to Shopify's Customer Privacy API automatically, so Shopify Analytics and web pixels follow each visitor's choice.
MCP Server
Connect Claude, Cursor, or any MCP client to ConsentStack's hosted MCP server and manage cookie consent end to end. Create a site, publish the banner, get the install snippet, run a compliance scan, and categorize trackers, all from your agent.