Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

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

These custom values are stored in the data property of the Visitor object.

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

Set Facets from Personalized data

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

// Apply the Personalization facet 'IS_CONTACTED' when the Visitor has a recorded phone call.
S4SCloud.personalization.setFacetWhen('IS_CONTACTED', function(visitor) {
  return Boolean(visitor.data.callDate);
});

Access Personalized data directly

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