Skip to content
FunnelGuard

Fix guide by FunnelsGuard

HubSpot form not linked to visitor: fix a missing hutk

TRK-268Medium impactCould addBy FunnelGuardPublished Updated
On this page

What this issue is

HubSpot's tracking code sets a cookie called hubspotutk in the visitor's browser. It holds a random ID for that browser. When a form is submitted, HubSpot reads this value (called hutk, short for HubSpot user token) and attaches the new or updated contact to that visitor's history: pages viewed, first source, UTMs and ad click data.

Where the link between visitor and contact breaks
  1. Ad clickVisitor lands with UTMs
  2. Tracking codehubspotutk cookie set
  3. Form submithutk not sent
  4. Contact createdNo page history
  5. Source reportShows Offline or Direct

The visit is tracked, but the form submission carries no hutk, so the contact cannot be joined to it.

Why it costs you leads or sales

Leads credited to paid campaigns in HubSpotExample numbers
Leads credited to paid campaigns in HubSpot (example)Real paid leads: 100 leads; Credited in HubSpot (hutk sent): 98 leads; Credited in HubSpot (hutk missing): 55 leads038771009855Real paid leadsCredited in HubSpot (…Credited in HubSpot (…leads

Example: 100 paid leads in a month. With hutk missing on one form, many are reported as Offline or Direct.

How to check if your site has it

Check for hutk in the browser
  1. Confirm the cookie is set

    Open the page in a fresh browser window, accept cookies if a banner shows, then open DevTools > Application (Chrome) or Storage (Firefox) > Cookies. Look for hubspotutk on your domain.

  2. Watch the form request

    Open DevTools > Network, tick Preserve log, then submit the form with a test email. Find the request to api.hsforms.com or forms.hubspot.com, or to your own endpoint if the form is custom.

  3. Look for hutk in the payload

    For the Forms API, the payload should contain context with hutk set to the cookie value. For older endpoints it is a hutk field. If it is absent or empty, you have the issue.

  4. Check the contact in HubSpot

    Open the test contact and view its activity timeline. A linked contact shows page views before the form fill. An unlinked one shows only the form submission.

Common causes of a missing hutk
CauseWhat you see
Tracking code not on the pageNo hubspotutk cookie at all
Consent banner blocks HubSpot cookiesCookie appears only after accepting
Custom form posts to Forms API without contextCookie exists, payload has no hutk
Form in an iframe or other domainCookie set on the main site, not read by the form
Tracking code loads after the form scriptCookie missing on first page view

How to fix it

Fix by platform
  1. Install the tracking code

    Use the official HubSpot plugin and connect your account, or paste the tracking script into your theme footer. Check that caching plugins do not strip it.

  2. Use HubSpot forms where you can

    HubSpot's embedded forms and the plugin's form blocks read the cookie for you. If you use Gravity Forms, Contact Form 7 or similar, use an integration that passes hutk, or send it yourself as shown in Custom code.

Send hutk with a custom form (HubSpot Forms API v3)javascript
function getHutk() {
  var m = document.cookie.match(/(?:^|; )hubspotutk=([^;]*)/);
  return m ? decodeURIComponent(m[1]) : undefined;
}

function submitToHubSpot(portalId, formGuid, email) {
  return fetch('https://api.hsforms.com/submissions/v3/integration/submit/' + portalId + '/' + formGuid, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      fields: [{ name: 'email', value: email }],
      context: {
        hutk: getHutk(),
        pageUri: window.location.href,
        pageName: document.title
      }
    })
  });
}
General fix order
  1. Load tracking first

    Make sure the HubSpot script is on every page that has a form and loads before the form is submitted.

  2. Handle consent

    If your banner blocks HubSpot until consent, accept that visitors who decline will have no hutk. That is expected. Make sure it is set once they accept.

  3. Pass hutk from the form

    Embedded HubSpot forms do this automatically. Custom forms need the code above.

  4. Keep the domain consistent

    For iframes or forms on another domain, pass the cookie value in the URL or a message to the form and send it in the submission.

How to confirm it's fixed

Confirm the fix
  • Open the page in a clean browser, accept cookies, and see hubspotutk in Cookies.
  • Submit a test lead and confirm context.hutk is filled in the network request.
  • Open the new contact in HubSpot and see page views before the form fill in the timeline.
  • Check that original source and UTMs match the test visit (use a URL with UTMs).
  • Repeat on mobile and with your consent banner in its default state.
Contact record before and after

hutk missing

  • Timeline shows only the form submission
  • Original source: Offline or Direct
  • No page views or UTMs

hutk sent

  • Timeline shows earlier page views
  • Original source matches the campaign
  • UTMs and page history available

How to prevent it happening again

Prevention habits
  • Add a hutk check to your launch list for every new form or landing page.
  • Re-test after changing themes, caching, consent banners or tag setups.
  • Prefer HubSpot's embedded forms when you do not need a custom design.
  • Document which forms are custom and how they send hutk.
  • Review a few new contacts each week for missing page history.

How FunnelGuard handles this

Questions people ask

What is hutk in HubSpot?

hutk is the value of the hubspotutk cookie, which HubSpot sets in a visitor's browser. When it is sent with a form submission, HubSpot links the contact to that visitor's page views and source.

Why is my HubSpot form submission not linked to the visitor?

The most common causes are a missing tracking code, a consent banner blocking the cookie, or a custom form that posts to HubSpot without context.hutk. Check the network request when you submit a test lead and look for hutk.

How do I add hutk to a custom form?

Read the hubspotutk cookie in JavaScript and include it as context.hutk in the body of your Forms API request. If the lead is sent from your server, pass the cookie value in a hidden field first.

Why does my HubSpot contact show Offline as the original source?

Contacts created without a linked visitor often have no web history, so HubSpot may label them Offline. A missing hutk is one common reason, but not the only one, so check the cookie and payload first.

Do embedded HubSpot forms send hutk automatically?

Yes, if the HubSpot tracking code is on the page and the cookie is set, embedded HubSpot forms include it for you. The problem mainly affects custom forms and forms from other tools.

Does a cookie consent banner stop hutk from being sent?

It can. If your banner blocks HubSpot's cookie until consent is given, visitors who decline will have no hubspotutk, so their submissions will not be linked. That is expected behaviour, but check that the cookie appears after acceptance.

Can FunnelGuard tell me if hutk is missing?

Not yet. This check is not part of FunnelGuard today. You can test manually by submitting a lead and looking at the contact timeline in HubSpot.

Does FunnelGuard catch this?

Could add

Not checked yet: could be added to FunnelGuard.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.