Best way to associate traffic source to contact added through the API


#1

We currently have a process to add any user who registers on our site as a contact in HubSpot using the Contacts API. No problem with that it works. But when we look up the new contacts added in Hubspot they show in the history as “Created from offline sources” and the field “Original source” shows the same.
Ideally, we’d love for those contacts to have the source prior to registration so that when looking at the Sources report, we can see the number of those contacts coming from various sources (https://cl.ly/1U2Z0s1h1t0B).
Is there a way we can associate the contact being created via the API to the visitor already being tracked by HubSpot through the JS tag?


#2

Hi @convetit,

There is absolutely a way to associate a contact to the information we are tracking, that would be the Forms API http://developers.hubspot.com/docs/methods/forms/submit_form. The key is the hs_context JSON block, which contains the user’s cookie that the HubSpot JS tag is dropping/keeping tracking of.

Let me know if you have any issues with that.

-Zack