I am using the API in an ecommerce platform. Basically, we have the user token and HubSpot is tracking their activity, but they are not yet a known contact in HubSpot. Once they make a purchase on the website, we now know their email address. What I am trying to do is create a new contact with the email address we have, but make sure we do not lose all of the previous tracking data from the past.
The flow so far is this:
Get the user token from their cookie
Call the API with “contacts/v1/contact/utk/{USER_TOKEN}/profile”
HubSpot returns a result with a vid, but with the “is-contact” field set to false.
Somehow tell HubSpot to upgrade the record to a contact and update the email address field, among others.
4 is where I’m stuck. Trying to update any fields with that vid results in an error message: “Can’t set properties when vid is not a contact.”
If I understood right, there is now way to create offline contacts using HS user token (UTK) in a way that all analytics data collected for that UTK will be populated for that contact?
You mentioned the using the form submission for that. Unfortunately this way doesn’t work for us. Is there any other approach to solving this issue, given that we can create offline contact using:
Any records with is-contact false aren’t actually contact records, so they can’t be manually updated. You’ll need to make an association between the contact data and the usertoken. One of the ways to make that association is with a form submission.
POST https://forms.hubspot.com/uploads/form/v2/:portal_id/:form_guid - Send form submission data to HubSpot. Form submissions from external sources can be made to any registered HubSpot form. You can see a list of forms on your portal by going to...
Analytics data is collected from the time the visitor first hits the site, and any data collected for the token will show up for the contact record, including the data from before the contact records creation.