Hubspot not changing contact source


We have contacts issued using the Contacts API, and we want to sync their referral source using the Forms API and sending over the hutk cookie. However, we have noticed that when we send this cookie with an email attached to an existing contact, it does not update the tracking history or the source of said contact. We are sending the payload as such to the form API via ajax:
{ 'hs_context': { 'hutk': COOKIE, }, 'email': EXISTING_CONTACT_EMAIL }

Any thoughts on what the issue could be? How does HS track the referrer and a users history? I can also confirm we are loading in the hubspot javascript on the site and correctly getting the cookie.


Hi Jack,

I’m a bit confused about the conversion flow that you’ve described, but it’s important to note that Original Source Type is not expected to update for existing contacts in HubSpot. “Original” very much means the original, or first, source tracked by HubSpot when the contact is created in your contacts database. If your contact was imported or created through the Contacts API, for example, the original source is an “Offline,” or non-web source. This would not change in the future, except for in the scenario described in our documentation here.

To track contacts created from a web source, specifically filling out a form, we are able to track the original referral source due to the cookie being set through the HubSpot tracking code, and then being passed through the hs_context / hutk value with the form submission. Further, to track an email as the original source of a contact’s interaction with your domain, the links in the email would need to include a UTM tracking parameter. This document explains the rules we follow to categorize the source of the visit.

Would you be able to provide a bit more detail about how you were hoping to track referral information in HubSpot, and what the expected flow is for the contact’s interaction with your website? I may be able to provide an alternative option with some more detail, but as Original Source Type is not expected to update for existing contacts, what you’ve described so far is working as expected. Thanks.


Hi Kait -

Sorry about your confusion. Let me try and be more clear -

First of all, we have noticed that contacts created with the API, can and do have the original source for existing contacts that have been created through the API changing from ‘Offline’ to ‘Direct.’ This has happened when we have sent users who were added via the API back to the site, and had their cookie sent over via the form API.

Second, and more pressing, I can confirm that we are sending new users to the site, creating them first via the form API, and only afterwards are we adding attributes. We have clicked to the site from news articles linking to our homepage (and our request headers are correctly tracking the ‘referral’ header (attached), which Hubspot claims it sends over with the cookie automatically. THIS SEEMS TO BE WHERE WE ARE NOT ALIGNED - PLEASE CONFIRM THIS IS THE INTENDED CASE)
When we check the lead in our Hubspot contacts dashboard, however, the only source we’ve noticed is 'DIRECT TRAFFIC, ’ which we know from looking at the referer header is not the case. The source should be somehow tied to the article, social post, ad, etc. Please advise.

Referer header example from the article


Hi Kait! I’m a Product Manager from Swell, working with Jack. I thought in addition to Jack’s technical explanation above, I’d provide you with clear steps that we are taking from a User perspective.


  1. I open a new browser and clear all cookies
  2. I open up Google and search “Fast Company Swell Lets You Invest A Little Cash In Solving Big Problems”
  3. I click on the Google search result for the FastCo article about Swell
  4. On the first paragraph of the article, there’s a link that says “Swell” - I click it
  5. I am taken to the Swell Investing homepage -
  6. I click “Signup” at the top right and am taken to
  7. I signup using a valid personal email and password (email has not yet been captured in Hubspot - )
  8. I navigate to my email, and click the URL to activate my email.

I expect there to be a new Contact in Hubspot with the email address
I expect the Original Source for that contact to be “Referral” - since I came from a FastCo article.

A new contact was created in Hubspot with the email address
The Original Source for that contact was set to “Direct Traffic”.

I hope this provides additional context to Jack’s technical description above. We are looking forward to hearing your thoughts.



Hi Arianna, thanks for that detail, that was extremely helpful.

In taking a look at the test contact in your portal, I can see that the HubSpot context is not being passed correctly. This can be seen by looking at your test contact in your portal and clicking the “Show 2 updated properties” link that appears under the form submission made on May 23. It is not expected to see “hs_context_hutk_” passed as a form field value.

The hs_context parameter includes the hutk value, encoded in JSON, along with the other values listed in our documentation here on the right-hand side of the page:

At this point, I suggest revisiting how the hs_context parameter is being passed in the submission. Once that is being done correctly, HubSpot should be able to appropriately bucked the source that the visit was referred from.


Hi Kait -

Thanks for reaching out - this definitely helps. One thing we are doing is sending the payload as a proper JSON object. I’ve actually tried sending both as an encoded JSON object and a non-encoded one, with not luck. Here is an example:



It doesn’t seem like either is doing the trick - any thoughts on what I could be missing here?


Hey Jack, thanks for that. The second request looks right, but we don’t have record of that submission tied to the contact with email address I expect that the submission that we are currently showing for that contact was the one made with the first request, which is why we’re seeing the hutk value being passed as a field, which isn’t expected.

Can we try the second format again, with a unique email address? Thanks.


Hi All -
Have you been able to figure this out yet?

I am having the same problem … I am using unbounce for email capture (which is supposed to be integrated to hubspot forms), but all users who complete the form as “Direct Source”