Associate Hubspot Cookie with Contact

We currently use the Hubspot tracking code to keep track of user activity on our marketing site, and we also use the Hubspot API to create a Contact when a user signs up on our web app.

Is there a way to connect the two sets of data? I see that you can fetch/pass the `hutk` cookie in the Forms API, but I don’t see similar functionality in the Contacts API. Is it supported or referenced anywhere in the documentation?
Any recommendations / suggestions would be greatly appreciated!

Hi @Presto,

Contacts API does not have functionality for the ‘htuk’ cookie. I believe the intent behind this API originally was to work with offline contact sources and the cookies did not apply in that scenario.

However, you could try looking into the Tracking code API and see if that would work with your use case.

Hi @evaldas , we’re looking to associate users with their `hutk` token in our backend, so I don’t think the Tracking Code API will be of much use (since it seems to be frontend only). Thanks for the suggestion though!

Hi @Presto,

To connect visitor tracking data with contact records, it’s better to use the Forms API instead of the Contacts API, as the Forms API has built-in support for the hutk cookie token. HubSpot will automatically link all browsing activity to the corresponding contact.

Hi @GiantFocal , thanks for the suggestion – we were able to get things working with the Forms API