Skip to content

Commit 02eede4

Browse files
committed
add new methods relating to Advanced Personalization support
1 parent bcb33f1 commit 02eede4

File tree

6 files changed

+222
-1410
lines changed

6 files changed

+222
-1410
lines changed

README.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,35 @@ client.setPersonalizationEvents(events);
362362
### Advanced Personalization
363363

364364
#### Set personalization token
365+
Set personalization token (for personalized search results). <br/>
366+
Use this method when personalization token is generated by your website.
367+
```js
368+
// Add a personalization token to the search/click event (if personalization in use)
369+
client.setPersonalizationToken('personalization_token');
370+
```
371+
372+
#### Get personalization token from AddSearch cookie
373+
Get the personalization token which is stored in AddSearch cookie (if available).
365374
```js
366375
// Add a personalization token to the stat events
367-
client.enablePersonalization(options);
376+
client.getPersonalizationTokenInCookie();
377+
```
378+
379+
#### Enable personalization tracking
380+
Enable personalization tracking, personalization token will be included in every stat events. <br/>
381+
If personalization token is not set, a UUID is generated and will be sent to AddSearch's cookie.
382+
Specify how many days personalization token stay in cookie. By default, it's 180 days.
383+
```js
384+
// Defaults - isEnabled: false, expirationDays: 180
385+
client.enablePersonalizationTracking(isEnabled, expirationDays);
386+
```
387+
388+
#### Enable AddSearch cookie
389+
Set it to false when users disallow usage of cookie. <br/>
390+
This method is used when you have a cookie consent popup, and a function handler in case users disallow usage of personalization cookie.
391+
```js
392+
// Default: true
393+
client.enableAddSearchCookie(isAllowedToSendCookie);
368394
```
369395

370396

0 commit comments

Comments
 (0)