Contact Behavior Profile

Abstract

Overview of the xConnect Contact Behavior Profile (CBP) calculated facet and how it is calculated.

The Contact Behavior Profile (CBP) calculated facet stores the matched profiles and patterns for a contact and is represented by the Sitecore.XConnect.Collection.Model.ContactBehaviorProfile class.

From Sitecore 10.1, two approaches for CBP facet behavior are available:

The following table describes the calculation logic applied to each CBP facet property when a new interaction is saved to xConnect:

Property

Type

Description

SourceInteractionStartDateTime

DateTime

The StartDateTime of the interaction that the profile scores came from.

Scores

Dictionary<Guid,Sitecore.XConnect.Collection.Model.ProfileScore>

The contact’s most recently matched profiles. The key is the Guid of the profile definition item, copied from the Scores property of the incoming interaction’s Sitecore.XConnect.Collection.Model.ProfileScores facet.

The following table describes the ProfileScore properties:

Property

Description

MatchedPatternId

The definition ID of the pattern in the Marketing Control Panel. Set by external component, such as tracking.

ProfileDefinitionId

The definition ID of the profile in the Marketing Control Panel.

Score

The total score of all values for this profile.

ScoreCount

The number of times the profile was scored during a session.

Values

The scored values for the profile keys. The key represents the profile key ID, and the value represents the score.

The ContactBehaviorProfile calculated facet contains the aggregated profile scores from all interactions.

The xConnect core model has been extended with the ChangeProfileScoreEvent interaction event. This event represents the contact's profiles delta for the currently submitted interaction, which has to be applied to the contacts' profile scores.

Note

All the threads that submit interaction events and collect profile score changes must send the ChangeProfileScoreEvent event with the profile score deltas. This includes Tracker and Marketing Automation activity.

The contact behavior profile handler AggregatingContactBehaviorProfileHandler includes the AggregatingContactBehaviorProfileHandler, which tracks ChangeProfileScoreEvent events from the submitted interaction, applies deltas, applies decay, and executes pattern matches. All the calculations are stored in the contact’s ContactBehaviorProfile calculated facet. The AggregatingContactBehaviorProfileHandler is configured by default.

Note

The ProfileScores facet is obsolete and ignored by the AggregatingContactBehaviorProfileHandler.

Contact merge with aggregated profile scores

During the contact merge operation, all profile scores from source to target contacts are merged based on the latest SourceInteractionStartDateTime. If the source contact contains a score with, for example, Key1, and the target does not, the score is copied to the target. If the source and the target contacts contain a score with the same key and SourceInteractionStartDateTime of the source contact is the latest one, the score for the target contact is updated for this key.

Note

From Sitecore 10.1, this CBP approach is obsolete. To use this approach, you must make configuration changes because it is disabled by default.

The Scores property in the Contact Behavior Profile is replaced each time an interaction with a ProfileScores facet is submitted. The dictionaries are not merged. This ensures that the behavior profile does not go stale. For example, if a contact matches the ‘Christmas Shopping’ or ‘Getting Married’ profiles, these profiles are only stored until the contact starts to exhibit different behavior. Each entry of the ProfileScores facet describes the ProfileScore of matched patterns.

The previous obsoleted CBP behavior is still available but requires configuration changes because it is disabled by default. See Enable the Contact Behavior Profile with the most recent profile scores.

You cannot extend the Contact Behavior Profile. You must create your own calculated facet.