incorrect contact coming back when getting contact by hubspotutk cookie

Occasional Contributor

Our application uses the ecommerce bridge API, and we're finding that contacts upserted through it are not properly retrievable using the standard API call to get a contact by the value in the hubspotutk cookie. 


Here are the steps to recreate:


1. Contact record gets upserted through a PUT call to:


2. API call is made to


3. Visiting profile url returned by #2 ( leads to a Hubspot page with the following error message: All who wander are not lost.


4. Making a call to 

/contacts/v1/contact/vid/:vid/profile using the vid returned in #2 yields a json payload that has is-contact: false in it, and none of the expected properties (email, etc.) are present.


5. Meanwhile, the contact that was originally upserted in step 1 can be found in the Hubspot admin panel, but it has a different contact id.


Any thoughts? What am I missing?







3 Replies 3
Regular Advisor | Gold Partner

Hello @RobJ 


I assume that in step#2, you are using the hubspotutk cookie value stored in browser of the user and then getting the user details.

For making it sure, you can compare the object id returned via ecomm sync and the VID coming back from HubSpot. This both should be same.



Digital Marketing & Inbound Expert In Growth Hacking Technology
Occasional Contributor

Yes, in step 2 we are passing the hubspotutk cookie value stored in the browser of the user.


As for comparing the object id, I'm a little lost. Unless I am mistaken, the call to 

PUT /extensions/ecomm/v2/sync/messages doesn't return a value that is comparable to vid. It returns the externalObjectId, but in our case this is simply the user's email.


FWIW, the vid/contact id in my steps 4 and 5 are different.




Occasional Contributor
Here is another restatement of the problem we are having:
We need to be able to create a deal in Hubspot and assign it to an existing user when the only identifying information we have at the time items are added to the shopping cart is the hubspotutk cookie. Otherwise, we have to do one of two things:
(1) update our ecommerce workflow to require an email before an item is added to the cart.
(2) not have any deals in HS until the consumer has progressed further in the checkout process and has entered their email address, which for us is the payment page itself.
Our hope was to grab the value of the utk cookie, get a reference to the current user, and then use the email address of the user as the externalobjectid  for the contact when we create the deal.
Is the problem that I'm trying to use customer email as the externalobjectid? What would the harm be in using our unique cart ID (a guid) as the externalobjectid for the contact record upsert? It would uniquely identify the user during the life of the current order. In the future, a subsequent cart interaction for the same customer would have a different cart ID. Would this present a problem?
Thanks in advance for any help!