Retrieve Contact ID on external site?

contacts

#1

Is it possible to get a contact’s ID on an external site through the tracking API or a cookie? Basically I’d like to be able to use data collected on Hubspot to create customized presentations on my site based on what the contact has shown an interest in.

For example, “User A” fills out a form on Hubspot showing an interest in “Product Z”. When they visit my (external) website after a few days, I’d like to be able to feature something on my page for “User A” regarding “Product Z” – I just don’t know how to get the contact vid from my external site.


#2

Hi @obsidianreq,

You can pull contact info by usertoken (the hubspotutk tracking cookie) with the following endpoint. Keep in mind that the HubSpot API doesn’t support CORS AJAX requests, so you’ll need to handle the request server-side. Additionally, it’s not recommended to make a call to this endpoint on every page load, since you could very easily reach your daily API call limit. You should cache relevant contact info wherever possible: