---
title: "Contact Behavior Profile"
slug: "contact-behavior-profile"
abstract: "Overview of the xConnect Contact Behavior Profile (CBP) calculated facet and how it is calculated."
---
# Contact Behavior Profile

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:

- [Using aggregated profile scores](https://doc.sitecore.com/xp/en/developers/103/sitecore-experience-platform/contact-behavior-profile.html#UUID-261c3b36-fa0a-37bc-4636-f80cb1ec4477_section-idm23215924067661 "Using aggregated profile scores") - this approach is enabled by default.
- [Using the most recent profile scores](https://doc.sitecore.com/xp/en/developers/103/sitecore-experience-platform/contact-behavior-profile.html#UUID-261c3b36-fa0a-37bc-4636-f80cb1ec4477_section-idm273223707933678 "Using the most recent profile scores") - this approach is obsolete and disabled by default.

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. |

<details>
<summary><h2>Using aggregated profile scores</h2></summary>

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.

</details>

<details>
<summary><h2>Using the most recent profile scores</h2></summary>

> [!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. For more information, see [Enable the Contact Behavior Profile with the most recent profile scores](https://doc.sitecore.com/xp/en/developers/103/sitecore-experience-platform/enable-the-contact-behavior-profile-with-the-most-recent-profile-scores.html "Enable the Contact Behavior Profile with the most recent profile scores").

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.

</details>

<details>
<summary><h2>Enabling the Contact Behavior Profile with the most recent profile scores</h2></summary>

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](https://doc.sitecore.com/xp/en/developers/103/sitecore-experience-platform/enable-the-contact-behavior-profile-with-the-most-recent-profile-scores.html "Enable the Contact Behavior Profile with the most recent profile scores").

</details>

<details>
<summary><h2>Extending the Contact Behavior Profile</h2></summary>

You cannot extend the Contact Behavior Profile. You must [create your own calculated facet](https://doc.sitecore.com/xp/en/developers/103/sitecore-experience-platform/facets.html "Facets").

</details>