Volver al blog
Technical

HubSpot Cookie Consent Integration: Complete GDPR Compliance Guide

Equipo de GetCookiesJanuary 15, 202514 min de lectura
HubSpotCRMIntegrationGDPRMarketing Automation

TLDR: HubSpot tracks everything by default—forms, page views, email clicks. Without proper consent gating, that's a GDPR violation waiting to happen. GetCookies blocks HubSpot tracking until consent and syncs preferences to your CRM.

Read full summary

Complete guide to implementing GDPR-compliant cookie consent on HubSpot CMS. Learn how to block HubSpot tracking until consent, sync consent preferences to contact records, trigger behavioral events on consent changes, and maintain compliance while preserving your marketing automation capabilities.

Summary by Claude AI

The €1.2 Million HubSpot Tracking Problem

Illustrative scenario: a composite example, not a specific reported case.

A B2B SaaS company discovered their HubSpot implementation had been tracking EU visitors without consent for 18 months. Every form submission, page view, and email click was logged to contact records—building detailed behavioral profiles before users ever agreed to analytics.

Their HubSpot portal contained 47,000 contact records with enriched behavioral data. Under GDPR, that data was collected unlawfully. The company faced a choice: delete the behavioral data (destroying their lead scoring and marketing automation) or hope nobody complained.

Someone complained. The investigation is ongoing. The lesson: HubSpot's powerful tracking is a liability without proper consent management.

Why HubSpot Needs Special Consent Handling

HubSpot isn't just analytics—it's a comprehensive tracking system that builds contact profiles from:

  • Page views: Every page a visitor views is logged
  • Form submissions: Creates and enriches contact records
  • Email tracking: Opens, clicks, and engagement patterns
  • Chatbot interactions: Conversation history and preferences
  • CTA clicks: Behavioral signals for lead scoring

All of this constitutes personal data processing under GDPR. And HubSpot's tracking script fires immediately on page load by default.

How GetCookies Integrates with HubSpot

Automatic Tracking Control

GetCookies integrates directly with HubSpot's tracking API:

// Before consent - tracking paused
_hsq.push(['doNotTrack', { track: false }]);

// After analytics consent - tracking enabled
_hsq.push(['doNotTrack', { track: true }]);

This ensures no behavioral data is collected until users explicitly consent.

Consent Events in HubSpot

GetCookies triggers custom behavioral events that you can use in workflows:

Event Description Use Case
pe_cookie_consent_shown Banner displayed Track banner impressions
pe_cookie_consent_given User consented Trigger welcome workflows
pe_cookie_consent_updated Preferences changed Update lead scoring
pe_cookie_consent_withdrawn Consent revoked Pause marketing automation

Installation on HubSpot CMS

Method 1: HubL Module (Recommended)

Create a custom module with your domain ID:

{% if module.domain_id %}
<script>
  window.getCookieConfig = {
    domainId: '{{ module.domain_id }}',
    hubspotIntegration: true,
    blockHubSpotTracking: true,
    respectGpc: true
  };
</script>
<script src="https://cdn.getcookies.co/widget.js" async></script>
{% endif %}

Method 2: Site-wide Header

Add to your HubSpot site settings under Settings > Website > Pages > Site Header HTML:

<script>
  window.getCookieConfig = {
    domainId: 'YOUR_DOMAIN_ID',
    hubspotIntegration: true,
    blockHubSpotTracking: true
  };
</script>
<script src="https://cdn.getcookies.co/widget.js" async></script>

Consent-Aware Marketing Automation

Lead Scoring Adjustments

Create a workflow that adjusts lead scores based on consent:

  1. Trigger: Contact property "consent_analytics" changes
  2. If analytics = true: Add 10 points to lead score
  3. If analytics = false: Remove behavioral scoring component

Segmentation by Consent

Create smart lists based on consent status:

  • Full Consent List: Contacts with analytics + marketing consent
  • Email Only List: Contacts with only necessary consent
  • GPC Detected List: Contacts with Global Privacy Control enabled

Email Suppression

Respect consent in your email campaigns:

  1. Create a suppression list for contacts without marketing consent
  2. Add this list to all marketing email exclusions
  3. Allow transactional emails (order confirmations, etc.) regardless of marketing consent

Global Privacy Control (GPC) Support

GetCookies automatically detects GPC signals and:

  1. Treats GPC as a "Reject All" preference
  2. Notifies HubSpot via the tracking API
  3. Logs a pe_gpc_signal_detected event
  4. Shows an optional notice to users

Multi-Language Support

HubSpot multi-language sites work seamlessly:

window.getCookieConfig = {
  domainId: 'YOUR_DOMAIN_ID',
  hubspotIntegration: true,
  language: '{{ request.locale }}', // Auto-detect from HubSpot
  // OR specify explicitly:
  // language: 'de'
};

GetCookies supports 40+ languages including all HubSpot-supported locales.

Cookie Declaration Page

Add a cookie declaration to your privacy policy:

<div id="olc-cookie-declaration"
     data-domain-id="YOUR_DOMAIN_ID"
     data-language="en">
</div>
<script src="https://cdn.getcookies.co/cookie-declaration/v1/cookie-declaration.min.js" async></script>

This displays an auto-updating list of all cookies detected on your site.

Common HubSpot Consent Mistakes

1. Not Blocking the Tracking Script

HubSpot's tracking code fires on page load. Without GetCookies' blockHubSpotTracking: true, you're tracking before consent.

2. Ignoring Form Pre-fill

HubSpot pre-fills forms based on cookies. If a user hasn't consented, this personalization shouldn't happen.

3. Email Tracking Without Consent

HubSpot tracks email opens via pixel. For marketing emails to EU recipients, ensure marketing consent before sending.

4. Chatbot Data Collection

HubSpot Conversations collects data from chat interactions. Gate chatbot loading behind consent if you're using it for marketing purposes.

Verification Checklist

After implementation, verify:

  • HubSpot tracking doesn't fire before consent banner appears
  • Console shows doNotTrack: false before user interaction
  • Console shows doNotTrack: true after analytics consent
  • Contact records show consent properties populated
  • Workflows trigger on consent events
  • GPC signal is respected when browser has it enabled

Getting Started

  1. Create a GetCookies account at getcookies.co
  2. Add your HubSpot domain in the dashboard
  3. Install the widget using one of the methods above
  4. Configure consent categories to match your HubSpot usage
  5. Test thoroughly before going live

Your HubSpot marketing can remain powerful—it just needs to wait for permission first.

Preguntas frecuentes

Does HubSpot set cookies before consent by default?
Yes, HubSpot's tracking script sets cookies and tracks page views immediately on load by default. Without proper consent gating, this violates GDPR requirements.
How does GetCookie integrate with HubSpot?
GetCookie integrates with HubSpot's tracking API to pause data collection until consent, then syncs consent preferences to contact records via custom behavioral events.
Can I use consent data in HubSpot workflows?
Yes, GetCookie triggers custom events in HubSpot when users consent or withdraw, allowing you to build consent-aware marketing automation workflows.
G

Equipo de GetCookies

Escrito y mantenido por el equipo de GetCookies en Getia AS, en Oslo (Noruega). Este artículo es información general sobre el consentimiento de cookies, no asesoramiento jurídico.

Escanea tu propio sitio gratis

El plan gratuito muestra el banner en un sitio con tres escaneos de cookies al mes. Sin tarjeta, sin llamadas comerciales.