Identity
- New customers receive a randomly generated anonymousId, which is persisted to the first-party cookie
- Returning customers use the anonymousId already stored in the first-party cookie
Sharing a Cookie Across Multiple Domains
If you must share cookies across multiple domains, configure the Salesforce Interactions Web SDK with the shared domain name. This can be done through either configuration passed to SalesforceInteractions.init or in a function call to SalesforceInteractions.setCookieDomain.
For example, to share a cookie between these two domains:
- abc.domain.com
- xyz.domain.com
The cookie domain can be configured with:
The cookie domain could also be set using the setCookieDomain function.
Identity Methods
Returns the value of the cookie domain used to generate the first-party cookie. The first party cookie stores the anonymous customer identity.
Sets the value of the cookie domain used to generate the first-party cookie. The first party cookie stores the anonymous customer identity.
Returns the value of the anonymous customer identity persisted in the first-party cookie.
Sets the value of the anonymous customer identity persisted in the first-party cookie.
Removes the first-party cookie and generates a brand new cookie with a newly generated anonymous customer identity.