Hubspot not changing contact source


#1

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.


#2

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.


#3

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


#4

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.

STEPS TO REPRODUCE:

  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 - www.swellinvesting.com
  6. I click “Signup” at the top right and am taken to www.swellinvesting.com/signup
  7. I signup using a valid personal email and password (email has not yet been captured in Hubspot - arianna+safari-cleared-cookies@swellinvesting.com )
  8. I navigate to my email, and click the URL to activate my email.

WHAT I EXPECT TO HAPPEN:
I expect there to be a new Contact in Hubspot with the email address arianna+safari-cleared-cookies@swellinvesting.com.
I expect the Original Source for that contact to be “Referral” - since I came from a FastCo article.

WHAT ACTUALLY HAPPENED:
A new contact was created in Hubspot with the email address arianna+safari-cleared-cookies@swellinvesting.com.
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.

-Arianna


#5

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

In taking a look at the test contact arianna+safari-cleared-cookies@swellinvesting.com 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: https://developers.hubspot.com/docs/methods/forms/submit_form

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.


#6

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:

Non-encoded

Encoded

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


#7

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 arianna+safari-cleared-cookies@swellinvesting.com. 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.


#8

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”