Identify user using id rather than email


#1

I would like to be able to use the javascript api to identify a user without having to insecurely start spreading their email around. I’ve already stored the user id from my system in hubspot, but when I try sending:

$(function () {
    var _hsq = window._hsq = window._hsq || [];
    _hsq.push([
        "identify", {
            user_id: system_user.id
        }
    ]);
});

it doesn’t actually associate the record despite both sides having that same information. Is there any way to associate the users using identify without using email (I don’t want user emails floating around the dom for security reasons.)

I do have the existing contacts vid and I only want to associate existing contacts, so if there’s a way to do it using the vid that works too.


#2

Bumping this up to the top


#3

Do you have an internal property in hubspot called user_id? Also where is system_user.id pulling from? Another option you could use is the utk. you can grab this from the cookie on their browser.