reset() Call
AdvancedA reset() call clears the current identity and super properties so that, when one user logs out, the next user on the same device starts fresh with no data leaking across.
A reset() call answers a real identity problem: one device may have several users, and if it is not cleared on logout, the second user's events attach to the first user's id and two people become one in analysis. reset() is usually called on logout and does two things: it releases the user's known id so the system builds a new anonymous one, and it clears registered super properties so the previous user's context does not leak to the next. The common trap is calling reset() in the wrong place: calling it on login instead of logout breaks the link between the anonymous visit before login and the known user after, splitting the user's journey in two. So reset() is only for the end of an identity, not its beginning.