regenerate
Generates a new anonymous visitor ID and returns it.
Identity associations stored by Visitor Switching are left untouched. If an identity is present (see VisitorIdManager), it takes ownership of the new ID and its stored association is updated. If none is present, the new ID is unowned: the next identity written to the data layer adopts it, and a returning identity restores its own previous visitor ID.
Typical uses, both optional:
after removing the identity from the data layer, so that events in the anonymous gap are not attributed to the previous identity. Remove the key before calling this method; calling it while the identity is still present rebinds that identity to the new ID.
immediately before writing a new identity to the data layer, so that the next identity does not inherit that gap.
The previous visitor ID is not deleted from the device if an identity still owns it; it is restored when that identity returns.
If the new visitor ID can't be stored, this fails with a PersistenceException, but the new visitor ID is still used until the app is relaunched: it is emitted to subscribers and added to events. The stored data is left unchanged, so the previous visitor ID is restored on the next launch.
Return
The new visitor ID, or a failure if visitor ID handling is disabled.