Sessions and user identity
Sessions provide the foundation for consistent personalization. By initializing a session, user interactions and recommendations can be linked to a stable identifier — enabling long-term analytics, segmentation, and CRM activation.Initializing a session
UseinitSession to establish a user identity at the start of each interaction.
userId and sessionId should be reused throughout the session and across subsequent API calls.
Why sessions matter
Sessions connect the dots between exploration, preference capture, and recommendations:- Recommendations improve over time — passing
userIdto recommendation queries lets the API learn from prior interactions - Preferences persist across sessions — the same
userIdlinks behavior across visits, devices, and channels - CRM activation — session data can be exported for email campaigns, lifecycle journeys, and segmentation
Anonymous vs identified users
You can initialize sessions with or without a known user identity:- Identified users: Pass your platform’s user ID (UUID, email hash, or CRM identifier) to link sessions to a known profile
- Anonymous users: Generate a temporary identifier for the session. If the user later registers, you can re-initialize with their permanent ID to merge behavior
Using session data in queries
Once a session is initialized, pass theuserId to queries that support personalization:

