Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Identified Visitor data

The S4S Cloud Send2CRM service allows configuring custom values for Personalizationpersonalization. These are returned with the response each time the Visitor visitor update is sent. For example, the Salesforce package may map Lead or Contact field values.

...

Note

The Visitor can access any Personalization personalization values using their browser inspector. Don’t Do not map sensitive information that you don’t want the Visitor visitor to see.

Info

All of the functionality below works for any Visitorvisitor, but for an Anonymous Visitors Visitor you will only have access to the website data set via the website.

Set

...

Segments from Personalized

...

Data

You can use Visitor visitor data to determine when Facets Segments should be applied.

Code Block
languagejs
// Apply the Personalization facetSegment 'IS_CONTACTED' when the Visitor has a recorded phone call.
S4SCloudsend2crm.personalization.setFacetWhensetSegmentWhen('IS_CONTACTED', function(visitor) {
  return Boolean(visitor.data.callDate);
});

Access Personalized

...

Data Directly

Code Block
window.addEventListener('load', (evt) => {
	// Display a welcome back message on page load.
	let visitorName = S4SCloudsend2crm.analytics?.visitor.data.firstName;
	if (visitorName) {
		alert('Welcome back, ' + visitorName + '!');
	}
});

Custom data

Custom Personalization personalization data can be set for the current Visitor visitor by calling the S4S Cloud Send2CRM library function:

Code Block
languagejs
S4SCloudsend2crm.personalization?.setData('firstName', 'John');

Listen for changes

Subscribe to the send2crmDataChanged event to be notified when Send2CRM personalization data changes.

See Personalization Events for more details.