UserData

Version:

Type

Interface

Import path

@sitecore-cloudsdk/search/server

Data about the site visitor.

Signature

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

Properties

Name

Type

Description

Value

userId

string

Required.

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"

custom

object

Optional.

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

groups

string[]

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!