Skip to main content

Sessions and user identity

A session ties the API calls you make for one end user to an identifier of your choosing. WikiParfum records initSession, and the userId you pass to recommendation queries, as analytics events, so usage can be attributed to the same user across calls.
Passing a userId does not change the results. Recommendations depend on the perfumes, filters and options in each request and on your integration’s settings — never on who the user is. To tailor results to a user, send the perfumes that represent their taste — see Personalizing results.

Initializing a session

Call initSession when an interaction starts. Both arguments are required.
The mutation records a session-start event and returns the values you sent. It does not create a server-side session: there is no session ID or token to keep, and later calls are not linked to it automatically. Pass the same userId on every call that accepts one.

Choosing a user identifier

  • Identified users: use a stable identifier from your platform, such as a user UUID or a CRM ID. Prefer an opaque value over personal data such as an email address: the identifier is stored with the analytics events.
  • Anonymous users: generate a random identifier for the visit. The API does not link or merge identifiers, so if the user signs in later, events before and after carry different IDs.

Passing the user identifier to queries

recommendedPerfumes and recommendIngredients accept an optional userId argument. It is recorded with the request’s analytics event and has no effect on the response.

Personalizing results

The API does not store user profiles or interaction history. Personalization comes from what you send: keep the perfumes each user has bought, liked or viewed in your own system, and pass them as the input of a recommendation query — WikiParfum IDs in search.perfumes or EANs in search.perfumeEans, comma-separated. See Recommendations for the full recommendation guide, and CRM & Personalization for how to combine your customer data with WikiParfum across channels.