Can I change a user's identity using FS.identify?

Why is identity permanent?

FullStory doesn't let you change the identity of a user once they have been assigned a unique user ID using FS.identify. If you attempt to change the user id of an identified user, the action will generate a highlight warning you of the issue. (For example: "The user previously identified as "Alice" cannot be changed to be identified as "Bob".)

It's not that we don't approve of self-determination; the problem is that there are a lot of different things such a change might mean, and no way to separate them.

  1. Are you renaming an old name to a new one, and you want all the old sessions to also be associated with a new name?
  2. Are you declaring a new synonym for the old user id, but want to use both of them?
  3. Are the different identifiers meant to be for different users, so you want old sessions for the old uid and a new session for the new one?  Remember that we might have our old identity from older pages or sessions; do you mean all of this session belongs to the new user, going back several pages we already recorded as belonging to the old user?  Or is it a new session starting from the start of this page, which again we've already started to record as belonging to the old user?  Or should the page split, and it was a session by the old user up to a point, but has recently been taken over by the new user?

We can't tell, and some of those would be hard to do (although we are looking at exactly what would be involved).  Because of that, identity is permanent.  If you try to change it once assigned, the new identity and any variable assignments set in that call to FS.identify will be ignored.

Is there any way to avoid incorrectly identifying users?

Identity is stored as part of the "user cookie," so if you discover that an identity has changed (for example, if two of your users share a computer and browser profile), you might use FS.clearUserCookie on your login page, to start a new session and to get rid of any old identity.  

Specifically, we recommend calling FS.clearUserCookie(true) in this sort of situation. The true parameter will allow anonymous users to keep their existing, un-identified cookie.

What about User Variables?

User Variables set using FS.setUserVars are not static and can be changed as the user's information changes. 

For example, you might update a user variable like lifetimeValue_real each time a user spends on your site, or update displayName and email if the user changes their contact information.  However, as described above, you can't change their core identity.

Was this article helpful?

/

Can’t find what you’re looking for?

The FullStory team awaits your every question.

Contact Us