Guests and Registered users

Every user starts as a Guest. After identify, they are Registered, and their Guest history comes with them.

GuestRegistered
Whosomeone datacub has not been told aboutsomeone your app identified with datacub.identify(userId)
IDa random ID made by the SDK, unrelated to the person or deviceyour own user ID
Shown asGuesttheir name or email if you pass them as traits, else their user ID
Across deviceseach browser and phone is a separate Guestevery device where they sign in links to the same user
Lastsuntil cookies or app data are cleared (see below)as long as you keep calling identify

A Guest ID is random. It is not built from the device, the IP address or anything about the person, so it identifies a browser, not a human. datacub calls these users Guests, not anonymous: the ID is pseudonymous, and once linked by identify it belongs to a Registered user.

How long a Guest ID lasts

Web: a first-party cookie (datacub_id) on your site's own domain, written when the SDK starts (or after datacub.consent.grant() if the project asks for consent first). It lasts up to 400 days and is renewed when a session starts. Safari deletes cookies set by scripts after 7 days without a visit, so a Safari user who returns later is a new Guest until they sign in. If the browser refuses cookies, the SDK keeps IDs in memory and every page load is a new Guest.

Mobile: kept in the storage you pass to init (AsyncStorage). It survives restarts and updates, not a reinstall. Without storage, every launch is a new Guest.

Sessions

A session ends after 30 minutes without activity, or after 24 hours. It does not split at midnight. On the web all tabs of your site share one session.

What changes at identify

// a Guest: page views and clicks carry the Guest ID
datacub.identify('user_8f3a2c') // now Registered; earlier Guest activity on this browser is linked
datacub.reset() // logout: a new Guest ID and session

After reset(), the old Guest ID is not reused. The next person on that device starts fresh.