HubSpot

HubSpot

All-in-one CRM and marketing platform used by inbound marketing teams. HubSpot scripts load the live chat widget, track page views and form submissions, and attribute visits to marketing campaigns. Sets cookies to identify visitors across sessions and build contact profiles in HubSpot's CRM.

Overview

HubSpot is an all-in-one CRM, marketing automation, sales, and customer service platform widely used by inbound marketing teams. Its tracking code is one of the most commonly deployed marketing scripts on the web. HubSpot scripts serve multiple functions simultaneously: visitor tracking and identification, marketing attribution, live chat, forms, and CRM contact enrichment.

What This Script Does

HubSpot's tracking code (hs-script-loader) loads multiple subsystems:

Tracking and Analytics

  • Tracks every page view with full URL, referrer, and timestamp
  • Records form submissions (both HubSpot forms and native HTML forms when configured)
  • Captures UTM parameters and marketing attribution data (source, medium, campaign)
  • Monitors CTA clicks and content interactions
  • Fires custom behavioral events when configured via the HubSpot API

Cookies Set

  • __hssc — session cookie tracking current session page view count (30-minute expiry)
  • __hssrc — session cookie detecting new sessions vs. tab reopens
  • __hstc — persistent cookie (13 months) containing visitor ID, first visit timestamp, last visit timestamp, current session timestamp, and session count. This is the primary tracking cookie.
  • hubspotutk — persistent cookie (13 months) storing the visitor's unique identity token. This value is sent to HubSpot when a form is submitted, linking anonymous browsing history to a known contact in the CRM.
  • __hs_opt_out — stores cookie consent banner response
  • __hs_do_not_track — respects Do Not Track settings when enabled
  • __hs_initial_opt_in — tracks initial consent state
  • messagesUtk — persistent cookie for chat widget visitor identification

Live Chat (HubSpot Conversations)

  • Loads the chat widget when configured
  • Sets messagesUtk to identify returning chat visitors
  • Tracks which pages the visitor viewed before starting a conversation
  • Sends browsing context to agents in real time

Forms

  • Renders HubSpot-hosted forms or enhances native forms with tracking
  • Pre-fills form fields for returning visitors when identity is known
  • On submission, links all prior anonymous browsing history to the contact record in HubSpot CRM

Network Requests

  • Sends tracking data to track.hubspot.com and forms.hubspot.com
  • Loads chat widget resources from app.hubspot.com
  • Downloads form definitions and configuration from HubSpot CDN
  • May load additional scripts for A/B testing, ads tracking, or integrations depending on HubSpot portal configuration

Consent & Compliance

  • Consent categories: Marketing (visitor tracking, attribution, CRM identification), Analytics (page views, behavioral events), Functional (live chat, forms)
  • GDPR/ePrivacy: HubSpot sets multiple persistent cookies with long expiration periods (up to 13 months) that track visitors across sessions and link anonymous behavior to identified contacts. Requires explicit opt-in consent under both ePrivacy Directive and GDPR. HubSpot provides a built-in cookie consent banner, but if a third-party CMP is used, the tracking code must be gated behind consent.
  • CCPA: Visitor tracking data, behavioral profiles, and contact enrichment constitute personal information. Requires prominent disclosure. The hubspotutk cookie specifically enables cross-session identification, which falls under PI definitions.
  • Data Processing: HubSpot acts as a data processor. A DPA is available in HubSpot account settings and should be executed.
  • Consent granularity: HubSpot's tracking code loads as a single script that enables all features simultaneously. For granular consent (e.g., allow chat but block tracking), the HubSpot consent API or conditional loading at the CMP level is required.

Because HubSpot serves marketing, analytics, and functional purposes simultaneously, there are several approaches to consent management: (1) Block everything until marketing consent — the simplest approach, treating the entire script as marketing since tracking is its primary function. (2) Use HubSpot's consent API — load the script but call _hsq.push(["doNotTrack"]) until consent is granted. (3) Conditional feature loading — if only chat is needed, the HubSpot Conversations API can be deployed independently without the full tracking code.

Should You Block This Without Consent?

Yes. HubSpot's tracking code sets persistent identification cookies, tracks page views across sessions, and builds behavioral profiles linked to CRM contacts. Even when used primarily for its chat or forms features, the default tracking code includes full visitor monitoring. It should not load until the user has granted at least marketing consent. If chat functionality is needed without tracking, the Conversations widget can be deployed separately using HubSpot's standalone chat embed.

Is HubSpot GDPR compliant?

HubSpot typically loads analytics, marketing and functional trackers, which are not strictly necessary for your site to work. Under the GDPR and the ePrivacy Directive, non-essential cookies and trackers must stay blocked until a visitor gives clear opt-in consent. So HubSpot can be fully GDPR compliant, but only if your site holds its scripts until consent is granted and lets visitors decline just as easily. Compliance depends on how your site loads HubSpot, not on HubSpot itself.

Visit website

Products (9)

HubSpot Forms
HubSpot Forms
HubSpot Forms is HubSpot's embedded lead capture form tool for collecting contact information on websites. Form scripts submit visitor data directly to HubSpot CRM, creating or updating contact records. Sets cookies to identify form submitters on return visits and pre-populate known contact fields for improved conversion rates.
HubSpot Analytics
HubSpot Analytics
HubSpot Analytics is HubSpot's built-in web analytics module tracking visitor behavior across HubSpot-managed websites and landing pages. Scripts record page views, sessions, traffic sources, and conversion events. Sets __hstc and hssc cookies to identify returning visitors and attribute user journeys across sessions for marketing reporting.
HubSpot CMS Hub
HubSpot CMS Hub
HubSpot CMS Hub is HubSpot's website content management platform for building and hosting marketing sites. Sites built on CMS Hub automatically include HubSpot's tracking infrastructure, setting cookies for visitor identification, analytics event collection, and marketing attribution across all pages served by the platform.
HubSpot Conversations
HubSpot Conversations
HubSpot Conversations is HubSpot's live chat and chatbot platform embedded on websites. The chat widget script loads asynchronously on page load, sets cookies to identify returning visitors, and captures conversation data linked to HubSpot CRM contact records for sales and support team follow-up and automated nurturing workflows.
HubSpot Email
HubSpot Email
HubSpot Email is HubSpot's email marketing module for sending and tracking campaigns. Tracking pixels embedded in outbound emails report open events and click-throughs back to HubSpot. Recipients who click through to landing pages have subsequent website sessions tracked by HubSpot's web analytics and attribution cookies.
HubSpot Marketing Hub
HubSpot Marketing Hub
HubSpot Marketing Hub is HubSpot's inbound marketing automation platform. Scripts track website visitor behavior for lead identification and nurturing, set cookies to attribute traffic sources, and enable email, social, and ad campaign automation. Visitor behavioral data feeds into HubSpot CRM contact profiles and lifecycle stage scoring.
HubSpot Operations Hub
HubSpot Operations Hub
HubSpot Operations Hub is HubSpot's data sync and process automation product for connecting CRM data with third-party systems. Primarily a server-side integration layer with minimal browser-side footprint. May contribute to the HubSpot tracking infrastructure on sites using HubSpot CMS or Marketing Hub integrations.
HubSpot Sales Hub
HubSpot Sales Hub
HubSpot Sales Hub is HubSpot's CRM and sales intelligence platform. The HubSpot tracking script identifies website visitors, monitors which pages prospects view, and surfaces activity data to sales teams. Sets cookies to recognize returning visitors and tie their browsing sessions to CRM contact records for pipeline management.
HubSpot Service Hub
HubSpot Service Hub
HubSpot Service Hub is HubSpot's customer service platform covering ticketing, knowledge base, and customer feedback tools. Tracking scripts associate support interactions and knowledge base page visits with HubSpot CRM contact records. Session cookies persist visitor identity across service touchpoints for context-aware support experiences.

Consent Categories

Also Known As

HubSpot trackingHubSpot cookieHubSpot chat widgetHubSpot CRMHubSpot analyticsinbound marketing

Industries

Programming and Developer SoftwareComputers Electronics and Technology

Tracked Domains (12)

HubSpot's trackers are occasionally seen, seen on about 2% of the sites ConsentStack has scanned. Scan your own site to see which of these are firing before consent.

hs-analytics.netAnalytics

hs-analytics.net is an analytics domain operated by HubSpot, used to measure visits, sessions, and on-site behavior. Seen on about 2% of scanned sites.

hs-scripts.comMarketing

hs-scripts.com is a marketing domain operated by HubSpot, used to serve ads, build audiences, and measure ad conversions. Seen on about 2% of scanned sites.

hubspot.comMarketing

hubspot.com is a marketing domain operated by HubSpot, used to serve ads, build audiences, and measure ad conversions. Seen on about 2% of scanned sites.

hsforms.comAnalytics

hsforms.com is an analytics domain operated by HubSpot, used to measure visits, sessions, and on-site behavior. Seen on about 2% of scanned sites.

hsadspixel.netMarketing

hsadspixel.net is a marketing domain operated by HubSpot, used to serve ads, build audiences, and measure ad conversions. Seen on about 1% of scanned sites.

hubapi.comMarketing

hubapi.com is a marketing domain operated by HubSpot, used to serve ads, build audiences, and measure ad conversions. Seen on about 1% of scanned sites.

usemessages.comFunctional

usemessages.com is a functional domain operated by HubSpot, used to run site features like chat, video, embeds, and preferences. Seen on under 1% of scanned sites.

hsleadflows.netAnalytics

hsleadflows.net is an analytics domain operated by HubSpot, used to measure visits, sessions, and on-site behavior. Seen on a small share of scanned sites.

hubspotusercontent.comMarketing

hubspotusercontent.com is a marketing domain operated by HubSpot, used to serve ads, build audiences, and measure ad conversions.

hubspotlinks.comAnalytics

hubspotlinks.com is an analytics domain operated by HubSpot, used to measure visits, sessions, and on-site behavior.

hubspot.netMarketing

hubspot.net is a marketing domain operated by HubSpot, used to serve ads, build audiences, and measure ad conversions.

hscollectedforms.netMarketing

hscollectedforms.net is a marketing domain operated by HubSpot, used to serve ads, build audiences, and measure ad conversions.

Cookies HubSpot Sets (11)

__hstc

HubSpot main analytics tracking cookie storing visitor and session counts plus first/last visit timestamps. 13-month expiration.

__hssc

HubSpot session pageview-counter cookie. 30-minute expiration.

hubspotutk

HubSpot user token identifying the visitor; passed to HubSpot CRM and chat to associate activity. 13-month expiration.

__hssrc

HubSpot session-restart marker; signals whether the visitor restarted their browser. Session-only.

__hsfp

HubSpot fingerprint hash used to deduplicate the visitor across cookies. Session-only.

messagesUtk

HubSpot Conversations visitor identifier linking a chat conversation to the same visitor across sessions. 13-month expiration.

__hs_opt_outEssential

HubSpot opt-out marker preventing the user from being asked again to accept cookies. 13-month expiration.

hs-messages-is-open

HubSpot signals whether the in-page chat widget is open. Session-only; written when HubSpot live chat loads.

__hs_do_not_trackEssential

HubSpot Do Not Track marker disabling tracking entirely for this visitor. 13-month expiration.

__hs_cookie_cat_prefEssential

HubSpot per-category consent preferences (analytics / advertising / functionality). 13-month expiration.

__hs_initial_opt_inEssential

HubSpot first-visit opt-in marker preventing the cookie banner from re-appearing for the same visitor.

Frequently Asked Questions

Related Vendors

AdThrive
AdThrive
Premium display advertising network serving mid-tier content publishers. AdThrive (now Raptive) manages a full-service ad operations program that loads multiple demand source scripts and header bidding adapters to maximize publisher CPMs.
DoubleVerify
DoubleVerify
Ad measurement and verification platform that evaluates ad viewability, fraud, and brand suitability. The DV script runs alongside ad tags and reports impression-level data on whether ads were viewable, whether the page is brand-safe, and whether the traffic appears human.
Roq.ad
Roq.ad
Roq.ad is an ad tech transparency and supply path optimization company. Scripts collect device identifiers and behavioral signals to build cross-device user profiles, enabling programmatic advertising targeting and audience matching across devices, browsers, and publisher environments.
Telaria
Telaria
Telaria is a programmatic video advertising platform, now part of Magnite after merging with SpotX. Scripts participate in real-time video ad auctions for connected TV and online video publisher inventory, serving video ad creatives and tracking viewability and completion metrics.
Adkernel
Adkernel
White-label ad serving and header bidding technology provider used by publishers and ad networks to build programmatic advertising infrastructure. Adkernel scripts manage ad slot auctions and deliver targeted display ads.
Snap Pixel
Snap Pixel
Snap Pixel is Snapchat's conversion tracking and audience tool for advertisers on the platform. Scripts fire events on advertiser websites when visitors complete actions after seeing or clicking Snapchat ads. The pixel feeds conversion data back to Snap Ads Manager for optimization and supports Snap Audience Match for retargeting.

Manage consent for HubSpot

ConsentStack automatically detects and manages HubSpot trackers so your site stays compliant with global privacy regulations.