setVisitorIdentityKey
Sets the data layer key that holds the current user's identity, enabling Visitor Switching.
When an identity is written to this key, the visitor id may switch, depending on whether the current visitor id is owned and whether the identity has been seen before on this device:
while no identity owns the current visitor id:
a new identity takes over the current visitor id
a known identity restores the visitor id it was last associated with
once an identity owns the current visitor id:
a new identity is given a new anonymous visitor id
a known identity restores the visitor id it was last associated with
Removing the key from the data layer does not change the visitor id. Only non-blank string values are treated as identities.
Identities are hashed before being stored, so the identity itself is never persisted.
The default is null, which leaves Visitor Switching disabled.
Parameters
The data layer key to read the identity from