Versions Compared

Key

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

...

To ensure the correct timing when making alterations handle the S4SCloudLoading send2crmLoading event in your own script:

Code Block
window.addEventListener('S4SCloudLoadingsend2crmLoading', (evt) => {
	// Facet evaluation code goes here.
});

...

Code Block
languagejs
// Apply the Personalization facet 'VIP_VISITOR' when the 'IMPORTANT_GOAL' Goal value reaches 50 total for the Visitor.
S4SCloudsend2crm.personalization.setFacetForGoal('VIP_VISITOR', 'IMPORTANT_GOAL', 50);

S4S Cloud The Facet will be applied automatically set the Facet when the specified Goal reaches the given value.

...

Code Block
languagejs
// Apply the Personalization facet 'REPEAT_VISITOR' when the Visitor has more than one Session.
S4SCloudsend2crm.personalization.setFacetWhen('REPEAT_VISITOR', function(visitor) {
  return (visitor.sessionCount > 1);
});

...

To check whether a visitor has a Facet applied, call the S4S Cloud send2crm library function:

Code Block
languagejs
if (S4SCloudsend2crm.personalization.hasFacet('VIP_VISITOR')) {
  // Do something special.
}

...

Facets are recorded against the visitor, and never removed once applied. They are also sent to the S4S Cloud send2crm service for Identified Visitors and synchronized across different browsers.

...

If the personalizationCookie setting is enabled, S4S Cloud send2crm will automatically populate a cookie named S4SCloud send2crm with the values of all Facets separated by pipe (|) characters. e.g.:

...