addPersonalize

Version:

Type

Function

Import path

@sitecore-cloudsdk/personalize/browser

Used as a method by the CloudSDK function to initialize the personalize package.

Signature

export function addPersonalize(
  settings?: BrowserSettings
): CloudSDKBrowserInitializer

Parameters

Name

Type

Description

settings

BrowserSettings

Optional.

Initialization settings for the package.

BrowserSettings properties

Name

Type

Description

Value

enablePersonalizeCookie

boolean

Optional.

Whether to set the sc_cid_personalize cookie from the browser side.

If using only the browser module of the personalize package, set to true.

If using both the browser and the server modules of the personalize package, set enablePersonalizeCookie to true either on the browser or the server, and set to false on the other.

If enableBrowserCookie is false, enablePersonalizeCookie will not be set.

Default: false.

true

webPersonalization

boolean | { async: boolean; defer: boolean; language?: string }

Optional.

Whether to enable web personalization.

If true, a web personalization script will load in your app with async but without defer.

To customize the loading of the script, set the value to an object, and in the object, use the async, defer, and language attributes.

Default: false.

true

Return value

Initializes the personalize package and returns an instance of CloudSDKBrowserInitializer.

Examples

See code examples in CloudSDK.

If you have suggestions for improving this article, let us know!