# When I call anonymize on logout, what actually happens to the profile?

Asked by Nadia on 2026-08-31. Tags: privacy, identity, anonymize.

I call `croct.identify` on login and `croct.anonymize` on the logout. I want to
understand exactly what anonymize does under the hood.

Specifically: does it detach the session from the identified user going forward, or
does it touch stored data too? Trying to reason about it precisely before I ship.

## 2 answers

### Accepted answer from Marta Kowalczyk (2026-09-01)

It is a going-forward switch, not a data operation. `croct.anonymize()` returns
the current session to anonymous, so events after that point are no longer
attributed to the identified user. It does not scrub or rewrite anything already
stored.

The way to think about it: `identify` and `anonymize` are how you switch the
active identity of the session. That is also why the `userId` and `token` init
options are mutually exclusive with this flow, you pick one mechanism for setting
identity, you do not mix both.

If you re-identify later, that can relink through identity resolution's matching
rules, it does not merge the anonymous history back in wholesale. The
[React identify and anonymize auth flow thread](/answers/react-identify-anonymize-auth-flow)
has the placement details if you want to double-check where the calls sit.

### Answer from hans_k (2026-09-02)

Adding the part that surprised me at first: anonymous and identified profiles
never associate with each other for sync purposes. So anonymize is not moving
data between two profiles, it is just changing which identity the session is
currently operating as. Kept me from expecting a merge that never happens.

#### Reply from Nadia (2026-09-03)

That matches what I see in the profile explorer. Anonymous events stop
landing on the identified user the moment I call anonymize, and nothing
retroactively moves. Exactly the behaviour I wanted.
