1. Interfaces

UserData

Version:
TypeInterface
Import path@sitecore-cloudsdk/search/browser

Data about the site visitor.

Signature

export interface UserData {
  userId: string;
  custom?: { [key: string]: unknown };
  groups?: string[];
}

Properties

NameTypeDescriptionValue
userIdstringRequired.An anonymous visitor identifier that ties a site visitor to a search request across multiple sessions.Format: any string of your choice, with no specific structure required.Set the value to an anonymous and distinct string that you generate. Sitecore Search does not generate this value."fb239f67-a3d4-4ecd-b612-07b975a1875d"
customobjectOptional.Custom data about the site visitor.Custom key-value pairs of your choice.Set key to the name of the custom user context. Set value to the value. The value must be a string.N/A
groupsstring[]Optional.Segments or groups the site visitor is part of.Custom data of your choice.["buyer", "VIP"]["seller"]
If you have suggestions for improving this article, let us know!