Get a contact by its user token


#1

Hi,

I noticed some oddities when looking for a contact by user token.
A week ago, when I visited my site, I saw hubspotutk = "some_user_token" in the cookies.
I made a contact request by user token and got the contact IDs (canonical-vid, vid and is-contact = true) from Hubspot.
This was correct contact.

Today I went back to the site. In my cookies, I still have the same user-token (hubspotutk).
I again make a contact request and get another contact ID (another canonical-vid and vid and is-contact = false).
And this contact is not yet in HubSpot

This is a problem. I'm trying to identify visitors by their user token (because I have no other way).
Every day the user token of the visitor does not change, but result search for contacts by user token every day gives out new contact IDs.

You can tell how I can reliably identify the visitor?

Thank You


#2

Hi @Sergei_Arienchuk,

Just to make sure that we're on the same page, you're seeing different contact values when pulling contacts using the exact same usertoken value? Can you give me your Hub ID and the usertoken value that you were seeing these issues with?


#3

Hi @Derek_Gervais

Sure:
Hub ID - 3880634
usertoken - f49588d7a78c3e1a02fe77756578f710


#4

Hi @Sergei_Arienchuk,

Thank you for sending along that info. So one thing I'm noticing is that the contact record associated with the usertoken you provided has a number of associated vids. There are roughly 7 different vids, which usually means that the visitor was identified after visiting from different devices and/or clearing their cache, and the resulting identities were then merged. This isn't particularly common in the wild, but it doesn't surprise me given that this contact appears to be used for testing.

It doesn't appear that the identity for any given usertoken changed, but perhaps the usertoken you used appear very similar to the one you initially used? There are a number of similar usertokens associate with this contact, for example:

  • f49588d7a78c3e1a02fe77756578f710
  • f56d80029d20071de973cb30790ada7d

In general, the 'Get contact by usertoken' endpoint is reliable. Keep in mind that vids frequently merge, and anonymous visitors will have unique usertoken values that can point to visitor records initially before being merged to the same identity.


#5

@Derek_Gervais, thanks for this - 'Get contact by usertoken' endpoint is reliable!