Working with the HubSpot contact object client-side

contacts

#1

With Drip’s tracking code, any time identify is called it returns details about the contact (if one exists) which you can then use on the page or with other scripts.

I’d love to do the same with HubSpot. Is there a way to get access to contact properties from client-side JavaScript by calling functions available in the HubSpot tracking code?


#2

Hi @rsobers

The HubSpot tracking code only deals with writing data to HubSpot, it can’t be used to get data for visitors or contacts.

It is possible to get contact data from the hubspotutk cookie (created by the tracking code), but the request to the API needs to happen server side, so you’ll need to make the JavaScript request to your server, then have your server make the request (after adding the authentication to the request) to HubSpot.