Versions Compared

Key

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

The browser’s local Facet values are updated from the response when a service synch occurs.

...

Applying Segments

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

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

Set a

...

Segment for the Goal threshold

Facets Segments may be applied when the Visitor visitor reaches a threshold value for a particular Goal.

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

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

Set a

...

Segment using Custom Logic

Facets Segments may also be applied using your own logic. This uses a callback function that provides the current Visitor object.

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

See Visitor information for a list of available Visitor properties. The session property contains the current Session object. Use this data to perform your logic and return true if the Facet Segment should be applied.

Retrieving

...

Segments

Use the values of saved Facets Segments to determine when you want to apply Personalization personalization to your website.

Testing

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

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

Persistence

Facets Segments are recorded against the Visitor, they are never visitor, and generally not removed once applied. They are also sent to the S4S Cloud Send2CRM service for Identified Visitors and synchronized across different browsers.

...

Segment Cookie

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

...

This allows accessing the values of applied Facets Segments server-side on your website.

...