Marketing cookie · HubSpot

hubspotutk Cookie: What It Is, Who Sets It, and Consent Rules

Last verified 2026-10-16 · Updated 2026-10-16

On this page
  1. What the hubspotutk cookie does
  2. Who sets the hubspotutk cookie
  3. Does the hubspotutk cookie need consent?
  4. How to block the hubspotutk cookie
  5. How long the hubspotutk cookie lasts
  6. Cookies that work with hubspotutk
  7. Scripts and requests of HubSpot
  8. hubspotutk cookie FAQs

What the hubspotutk Cookie Does on Your Site

The hubspotutk cookie is a first-party marketing cookie that the HubSpot tracking code sets to keep track of the identity of a visitor. The hubspotutk cookie "keeps track of a visitor's identity" with an opaque ID for the visitor, according to the HubSpot list of cookies set in the browser of a visitor. The hubspotutk cookie "is passed to HubSpot on form submission", where HubSpot uses the ID to find or merge the contact.

The form submission turns an anonymous visitor into a named contact. HubSpot attaches every page view the hubspotutk ID recorded before the form to the timeline of the new contact. Your sales team then sees the pages a lead read before signing up.

The value of the hubspotutk cookie looks like 3fa85f6457174562b3fc2c963f66afa6. The table explains each part.

Part of the valueMeaning
3fa85f6457174562b3fc2c963f66afa6The visitor ID, a 32-character hexadecimal value that HubSpot repeats inside the __hstc cookie.
hubspotutk cookie facts
Cookie namehubspotutk
VendorHubSpot
CompanyHubSpot, Inc.
CategoryMarketing
PartyFirst-party
DomainYour own root domain, for example .example.com
Set byJavaScript, through the HubSpot analytics script from js.hs-analytics.net, which the loader on js.hs-scripts.com adds
Retention180 days (6 months)
Value example3fa85f6457174562b3fc2c963f66afa6
HttpOnlyNo
SecureNo
SameSiteNot set by the HubSpot tracking code, so browsers apply Lax
Cookie Consent categorytargeting
Privacy Consent vendor categoryMarketing (marketing)

Who Sets the hubspotutk Cookie

The HubSpot tracking code sets the hubspotutk cookie. The loader js.hs-scripts.com/<hub-id>.js adds the analytics script from js.hs-analytics.net, which writes the cookie, and HubSpot CMS adds the tracking code to every hosted page by itself. A scan by the TermsFeed website auditor on 9 October 2026 found the hubspotutk cookie written by js.hs-analytics.net with the same visitor ID as the __hstc cookie.

HubSpot forms embedded on a site outside HubSpot read the hubspotutk cookie at submission, so a form without the tracking code creates contacts with no page view history.

Read how HubSpot, Inc. handles the data in the HubSpot privacy policy, and sign the HubSpot Data Processing Agreement before you collect data from visitors in the EU or the UK. Both documents appear in the sources at the end of this page.

How to Block the hubspotutk Cookie Until Visitors Accept

Block the hubspotutk cookie by holding back the HubSpot tracking code until the visitor accepts marketing cookies. TermsFeed Free Cookie Consent and TermsFeed Privacy Consent place HubSpot in the marketing category. Check whether an exemption applies to your own use of HubSpot in the consent rules for the hubspotutk cookie.

HubSpot writes no hubspotutk cookie while the tracking code waits as a tagged script, so a visitor who declines leaves no page view history in HubSpot. A HubSpot form on the page still works without the tracking code, and HubSpot creates the contact without the page views.

Block the hubspotutk Cookie With TermsFeed Free Cookie Consent

TermsFeed Free Cookie Consent runs a tagged script only after the visitor accepts its category. Change type="text/javascript" to type="text/plain" and add data-cookie-consent="targeting", the Cookie Consent category for marketing cookies. The tagged the HubSpot tracking code looks like this.

<!-- Start of HubSpot Embed Code -->
<script type="text/plain" data-cookie-consent="targeting" id="hs-script-loader" async defer src="//js.hs-scripts.com/YOUR_HUB_ID.js"></script>
<!-- End of HubSpot Embed Code -->

Cookie Consent runs the tagged code after the visitor clicks "I agree" or accepts the targeting category in the Preferences Center. The illustration shows the consent banner and the script it releases.

The TermsFeed Free Cookie Consent banner: (1) the visitor clicks "I agree", (2) Cookie Consent runs the script tagged targeting. Illustration of the consent banner.

Cookie Consent is free and needs no account. Build your free consent banner with TermsFeed Free Cookie Consent.

Block the hubspotutk Cookie With TermsFeed Privacy Consent

Add HubSpot from its template in TermsFeed Privacy Consent, and the HubSpot tracking code loads only after the visitor accepts the Marketing vendor category. The template loads the HubSpot chat widget and pop-ups with the tracking code, so a visitor who declines sees neither.

Turn off the HubSpot cookie consent banner in your HubSpot account, so visitors see a single consent banner. Delete every other copy of the HubSpot tracking code from your templates, plugins, and tag manager, because a copy left in the page loads HubSpot before the consent banner appears.

The HubSpot template asks for the Hub ID and fills every other field of the vendor. Pick the "HubSpot" card under Marketing, enter the Hub ID, and click "Add HubSpot". In HubSpot, the Hub ID is the number next to the account name in the account menu. The illustration shows the template form in the TermsFeed app.

The HubSpot template in TermsFeed Privacy Consent: (1) pick the card, (2) enter the Hub ID, (3) click "Add HubSpot". Illustration of the TermsFeed app.

Privacy Consent detects the location of each visitor and records every answer in a consent log. Set up HubSpot from its template with TermsFeed Privacy Consent.

How to Verify That the hubspotutk Cookie Waits for Consent

Verify the setup in a private window. Open Chrome DevTools, select the Application tab, and open Cookies. Click "I decline" on the consent banner and reload the page. The hubspotutk cookie must not appear in the list until you accept marketing cookies.

How Long the hubspotutk Cookie Lasts

The hubspotutk cookie lasts 180 days (6 months). Safari caps the cookies that JavaScript sets at 7 days of Safari use without an interaction with your site, according to the WebKit team behind Safari.

The hubspotutk cookie "expires in six months", according to HubSpot, and the auditor scan measured an expiry of 180 days (6 months).

Scripts and Requests of HubSpot That Come With the hubspotutk Cookie

The catalog lists 5 scripts, pixels, and data endpoints of HubSpot, which a cookie scanner or the Network tab of Chrome DevTools shows next to the hubspotutk cookie. Block the main script, and the requests in the table stop with the main script.

TypeResourceHostWhat it does
ScriptHubSpot tracking code loader (js.hs-scripts.com)js.hs-scripts.com
js-na1.hs-scripts.com
The loader named after your Hub ID adds the HubSpot analytics, chat, and pop-up scripts to the page.
ScriptHubSpot analytics script (js.hs-analytics.net)js.hs-analytics.netThe analytics script writes the hubspotutk, __hstc, __hssc, and __hssrc cookies and records page views.
PixelHubSpot page view pixel (__ptq.gif)track.hubspot.comThe page view pixel sends each page view to HubSpot with the visitor ID from the hubspotutk cookie.
ScriptHubSpot forms script (js.hsforms.net)js.hsforms.netThe forms script renders an embedded HubSpot form and reads the hubspotutk cookie at submission.
PixelHubSpot forms counter pixel (counters.gif)forms-na1.hsforms.com
perf-na1.hsforms.com
The counter pixel reports form loads and performance to HubSpot, and the auditor scans found the pixel before consent on a scanned site.

hubspotutk Cookie FAQs

Is hubspotutk a necessary cookie?

No, the hubspotutk cookie is not a strictly necessary cookie. Firstly, your site and your HubSpot forms work for a visitor who refuses the hubspotutk cookie. Secondly, HubSpot uses the cookie to track the identity of a visitor for marketing, a purpose the ePrivacy Directive exemption does not cover. Thirdly, HubSpot itself classes its analytics cookies as non-essential cookies that its cookie banner controls.

What happens to hubspotutk when a visitor submits a form?

HubSpot sends the hubspotutk value with the form submission and links the ID to the contact record. HubSpot then shows the page views recorded under that ID on the timeline of the contact and uses the ID to avoid duplicate contacts.

What is the difference between hubspotutk and __hstc?

The hubspotutk cookie holds the visitor ID alone, and the __hstc cookie holds the visitor ID with session data. The session data of the __hstc cookie covers the timestamps of the first, the previous, and the current session, and the session count. HubSpot calls __hstc "the main cookie for tracking visitors", and both cookies last 6 months.

How long does the hubspotutk cookie last?

The hubspotutk cookie lasts 6 months (180 days). HubSpot documents the 6 months, and a scan by the TermsFeed website auditor measured 180 days. Safari deletes the cookie earlier, after 7 days of Safari use without an interaction with your site.

Sources for the hubspotutk Cookie

The facts on this page come from the documentation HubSpot publishes, checked on 2026-10-16. The catalog lists every source so you check each fact yourself.