Contacts' Original Source not populating after Forms API POST




We're sending some of our contacts (those that convert in-app) to Hubspot via the Forms API. About half of our contacts created this way are listed as coming from "Offline Sources." This is incredibly unlikely, as in-app page that triggers the API request has Hubspot tracking code on it itself, so at the minimum we would expect that page to be listed in the users' drill downs.

I have tried testing directly using cURL with no positive results. Testing steps include:

  1. Clear all browsing history, cookies, etc from browser.
  2. Tether internet connection to phone to avoid IP filtering
  3. Browse to a handful of pages containing our company's Hubspot tracking code
  4. Copy the hubspotutk cookie value from dev tools
  5. Replace the cookie value in the sample request body from the docs with my new cookie value
  6. Submit the following cURL command:
curl -d "firstname=TestContact&lastname=FormSub&" -H "Content-Type: application/x-www-form-urlencoded" -X POST{HUBSPOT_ID}/{FORM_ID}

  1. Check the contact property, and see this: 34%20AM

The fact that the request works about half the time on production is odd. As is the fact that when it doesn't work on production, it is shown as "Offline Sources," but manually with cURL I'm seeing "No URL."

Any help is greatly appreciated.



Hi @sam_topstep, I can't think of a reason off the top of my head that would indicate why in production this code would only work half of the time unless the contact was specifically meant to not be tracked. Navigating around my own site and submitting the same request you made to my own portal with my own hutk yielded a positive result on which page my contact submitted the form on and a successful association with a hubspot tracking cookie.

Here's my request in Postman:


HEADERS: Content-type: application/x-www-form-urlencoded

Here's my contact:

Make sure that your request is formatted properly with the body properly urlencoded as a malformed hs_context parameter is normally where I see most issues with the Forms API.