# On logout should I call anonymize, and does it wipe the profile I built up?

Asked by Peter Novak on 2026-10-18. Tags: nextjs, identity, logout.

Our Next app calls `identify` on login and I am now adding the logout side of
the behaviour. Two things I want to get right before I ship it.

First, is `croct.anonymize()` the correct call on logout. Second, and this is
the one that worries me, does calling it destroy the profile data we collected
while the user was identified? I would rather ask than find out we threw away
history.

## 1 answer

### Answer from Ingrid Bakker (2026-10-19)

Yes, `croct.anonymize()` is the correct call on logout, it mirrors the
`croct.identify('<userId>')` you already call on login. So your instinct to
pair them is right.

On the worry: it does not destroy the identified profile. Identity resolution
links the anonymous and identified profiles, so switching back to anonymous on
logout does not lose the data that was collected while the user was
identified. The identified profile keeps its history.
