APIs & Integrations

AirSkirts
Member

Creating a contact using the Hubspot visitor ID / cookie

Hi,

 

I have access to the Hubspot visitor ID, which I believe is the UTK, from a third party dynamic phone number insertion service. The user calls a dynamic phone number on the website and the third party service notifies me (via API) that a new call is incoming, and also provides the Hubspot 'visitor id' which I believe is the utk cookie value. I now need to find or create this contact from the server-side.

 

I would like to create a contact using the Contact API. I'd also like to associate this new contact with the cookie so that we can see what the visitor has been up to on the website prior to the contact being created.

 

I do not have any access to the user's web browser session at this time - I only know their utk because the third party API is providing it to me. Creating the contact is no problem - however I'm unsure of how to associate the user's hubspot browser session with the contact. Would the 'Identify a visitor' functionality (https://legacydocs.hubspot.com/docs/methods/tracking_code_api/identify_visitor) work if called from a server? Could I send the utk as a cookie header, and if so, what is Hubspot expecting to see? Is this even possible?

 

Thanks for your insights!

0 Upvotes
1 Reply 1
AirSkirts
Member

Creating a contact using the Hubspot visitor ID / cookie

Ok, for anyone who comes across this, my solution was to submit a form via the API on behalf of the user, and include the hutk in the form fields. This does the job of tying the user session to the contact record, but unfortunately doesn't show retroactive activity. That said it's a working solution and seems to be the only way to accomplish what I was looking for.

0 Upvotes