No Results
Search Tips:
- Please consider misspellings
- Try different search keywords
Initialization
Data Collection
Identity
Consent
Integrations
Debugging
Connect MuleSoft with Data Cloud
The Salesforce Interactions SDK supports identification of new and returning customer using the first-party cookie _sfid${domainHash}. Also, the _domainHash is produced by running the website’s domain through a hashing function.
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:
The cookie domain can be configured with:
SalesforceInteractions.init({
cookieDomain: 'domain.com'
})
The cookie domain could also be set using the setCookieDomain function.
getCookieDomain(): string
Returns the value of the cookie domain used to generate the first-party cookie. The first party cookie stores the anonymous customer identity.
SalesforceInteractions.getCookieDomain()
// => "domain.com"
setCookieDomain(newDomain:string): void
Sets the value of the cookie domain used to generate the first-party cookie. The first party cookie stores the anonymous customer identity.
SalesforceInteractions.setCookieDomain('domain.com')
Setting the cookie via the setCookieDomain function doesn’t take effect if the Salesforce Web Interactions SDK is already initialized. Ideally, this function call happens before initialization but it’s also possible to call SalesforceInteractions.reinit() to force the cookie changes to take effect.
Note
getAnonymousId():string
Returns the value of the anonymous customer identity persisted in the first-party cookie.
SalesforceInteractions.getAnonymousId()
// => "efc9953d6515dc7f"
setAnonymousId(newAnonymousId:string): void
Sets the value of the anonymous customer identity persisted in the first-party cookie.
SalesforceInteractions.setAnonymousId(`id_${Date.now()}`)
resetAnonymousId():void
Removes the first-party cookie and generates a brand new cookie with a newly generated anonymous customer identity.
SalesforceInteractions.resetAnonymousId()