HubSpotPlatform APIHubSpot Consent APIHubSpot Consent API
Connect CookieHub with the HubSpot Consent API, so supported HubSpot analytics and advertising services adjust their tracking to each visitor’s consent — and stay in step when that choice changes.
Built-in CookieHub support · HTML and GTM compatible
HubSpothubspot consent apianalyticsgrantedadvertisementdeniedfunctionalitygranted- Type
- Platform consent API
- Works with
- HubSpot tracking code
- Parameters
- analytics · advertisement · functionality
- Setup
- HTML or Google Tag Manager
- CookieHub support
- Built in, from version 2.8.13
Why the HubSpot Consent API matters.
Websites rely on HubSpot for analytics, marketing automation and advertising. Without consent signalling, these services can start tracking visitors before consent is given — a compliance risk under the GDPR, the CCPA and other privacy laws. The HubSpot Consent API gives HubSpot a standard way to receive consent signals, so supported HubSpot analytics and advertising services can adjust their behaviour to them.
CookieHub acts as the consent authority. It collects the visitor’s choice, replaces HubSpot’s own cookie banner and supplies HubSpot with accurate, real-time consent data — so HubSpot tracking stays privacy-aware, technically reliable and aligned with what each visitor chose.
CookieHub manages the visitor’s choice. The HubSpot Consent API carries it to HubSpot tracking.
- 01CookieHub loadsbefore the hubspot code
- 02HubSpot tracking code loadswaits for consent
- 03Visitor makes a choicebanner
- 04CookieHub sends consent to HubSpotconsent update
- 05HubSpot tracks only what was grantedtracking behaviour
From visitor choice to HubSpot tracking.
Pick a visitor state to see the consent CookieHub sends to HubSpot.
The visitor has arrived and the banner is showing. No optional category has been accepted.
HubSpotdefaultanalyticsdeniedadvertisementdeniedfunctionalitygrantedThe visitor accepted the Analytics category and declined Marketing.
HubSpotupdatedanalyticsgrantedadvertisementdeniedfunctionalitygrantedThe visitor accepted both the Analytics and the Marketing category.
HubSpotupdatedanalyticsgrantedadvertisementgrantedfunctionalitygrantedThe visitor rejected optional cookies, or withdrew a previous choice.
HubSpotupdatedanalyticsdeniedadvertisementdeniedfunctionalitygrantedIllustrative behaviour for an opt-in configuration. functionality stays allowed in every state, because necessary cookies are always allowed for HubSpot’s core functionality.
The consent HubSpot listens for.
Three consent parameters, each mapped from a CookieHub category. HubSpot receives each one as allowed or not — shown here as granted or denied.
| Parameter | What it controls | CookieHub category | Before choice |
|---|---|---|---|
| analytics | Cookies that gather analytics data about visitors, such as HubSpot analytics. | Analytics | denied |
| advertisement | Cookies that help serve personalised ads. | Marketing | denied |
| functionality | Cookies needed for core site features, such as authentication. | Necessary · always allowed | granted |
Consent-aware HubSpot tracking, without custom code.
CookieHub collects the choice, maps it to HubSpot’s consent fields and keeps both in sync — no manual JavaScript configuration or API calls.
See how consent management worksSimple integration
settings → integrationsEnable the HubSpot Consent API in the CookieHub dashboard. No custom JavaScript or API work is required.
Automatic parameter mapping
category → fieldMarketing maps to advertisement and Analytics to analytics. Necessary cookies are always allowed.
Flexible deployment
html · gtmWorks with both HTML implementations and Google Tag Manager setups.
Real-time updates
consent updateWhen a visitor updates their consent preferences, CookieHub immediately updates the consent sent to HubSpot.
Consent records
stored decisionWhen consent logging is enabled and available on your plan, CookieHub keeps a record of each visitor’s consent decision.
HubSpot consentexampleanalyticsgrantedadvertisementdeniedfunctionalitygrantedAccurate consent-driven tracking
analytics · advertisementSupported HubSpot analytics and advertising services adjust their behaviour to the consent granted, supporting compliance and data integrity.
Set up the HubSpot Consent API.
Supported from CookieHub version 2.8.13. Three phases, from loading CookieHub to consent signals that apply automatically.
- 01
Install
Load CookieHub before the HubSpot tracking code, so consent reaches HubSpot before any tracking is allowed to start.
- 01HTML: add the CookieHub script to the <head> of your website.
- 02Google Tag Manager: add the CookieHub CMP template with the Consent Initialization – All Pages trigger.
- 02
Enable
Turn the integration on in the CookieHub dashboard.
- 03Enable HubSpot Consent API under Settings → Integrations.
- 04Check that CookieHub loads before the HubSpot tracking code, or HubSpot’s own banner may appear alongside CookieHub’s.
- 03
Apply
Consent signals are applied automatically when visitors accept or reject cookies.
- 05CookieHub sends analytics and advertisement consent from the Analytics and Marketing choices.
Connect HubSpot consent through GTM.
Use Google Tag Manager to initialise CookieHub early, so HubSpot receives consent signals before any HubSpot tracking begins.
- Add the CookieHub CMP template from the GTM Community Template Gallery.
- Enter your CookieHub domain code.
- Set the trigger to Consent Initialization – All Pages.
- Save and publish, then enable the HubSpot Consent API in the CookieHub dashboard.
- HubSpot analyticsanalytics
- HubSpot advertisingadvertisement
- HubSpot core featuresfunctionality
Works with HubSpot and your CookieHub installation.
CookieHub passes HubSpot consent through the installation method you already use.
HubSpot tracking codeconsent api
HubSpot analyticsanalyticsCookieHub scriptintegrations setting
Google Tag Managercmp template
Built for the HubSpot Consent API.
CookieHub supports the HubSpot Consent API from version 2.8.13. Once the integration is enabled, CookieHub replaces HubSpot’s own cookie banner and keeps HubSpot’s analytics and advertisement consent in sync with each visitor’s choice.
HubSpot Consent API documentation.
Last reviewedOctober 2026- HubSpot Consent API in CookieHubCookieHub’s setup guide for HTML and Google Tag Manager installations, with the parameter mapping.docs.cookiehub.com
- Domain settings: IntegrationsWhere the HubSpot Consent API integration is enabled for a domain.docs.cookiehub.com
- Consent banner APIHubSpot’s reference for passing consent from a third-party banner to HubSpot.developers.hubspot.com
- Add privacy consent listenerHow HubSpot scripts read the analytics, advertisement and functionality consent.developers.hubspot.com
HubSpot Consent API questions.
The HubSpot Consent API lets CookieHub pass consent signals to HubSpot, so supported HubSpot analytics and advertising services can adjust how they track visitors based on consent. HubSpot reads three consent parameters: analytics, advertisement and functionality.
No. CookieHub automatically sends the required consent signals to HubSpot once the integration is enabled in the dashboard, under Settings → Integrations.
Yes. CookieHub supports both direct HTML integration and Google Tag Manager using the official CookieHub CMP template, with the trigger set to Consent Initialization – All Pages.
Supported HubSpot analytics and advertising-related tracking respects the analytics and advertisement consent parameters managed by CookieHub: the Analytics category maps to analytics and Marketing to advertisement. Essential functionality remains allowed, and the Preferences category is not used by HubSpot. The API covers HubSpot’s supported services; it does not automatically block other tracking services or custom integrations.
You should enable it if you use HubSpot for analytics, marketing, or to load additional tracking services and need consent-aware session tracking. CookieHub supports it from version 2.8.13.
Yes. Whenever a user updates their consent preferences, CookieHub immediately updates the consent parameters sent to HubSpot.
Yes. CookieHub collects consent in place of HubSpot’s own banner. Load the CookieHub script before the HubSpot tracking code; otherwise HubSpot’s banner may appear alongside CookieHub’s.
Disclaimer
This page describes how CookieHub passes consent choices to HubSpot. It is technical guidance, not legal advice — which consent model applies to your visitors depends on the regulations relevant to your site, such as the GDPR or the CCPA.
Keep HubSpot tracking in step with consent.
Connect CookieHub to HubSpot, enable the HubSpot Consent API and let consent signals apply automatically.
- 14-day trial
- No card required
