1. Calculated facets

Key behavior cache

Version:

The key behavior cache is a calculated facet that stores information about a contact’s most recently triggered events. The key behavior cache facet is represented by the Sitecore.XConnect.Collection.Model.KeyBehaviorCache class.

Calculation logic

The following table describes where the data each list of Sitecore.XConnect.Collection.Model.KeyBehaviorCacheEntry comes from:

PropertyCalculation logic
CampaignsTaken from interaction’s Events property where event is of type CampaignEvent, and from the interaction’s CampaignId property.
GoalsTaken from interaction’s Events property where event is of type Goal.
ChannelsTaken from the interaction’s ChannelId property.
OutcomesTaken from interaction’s Events property where event is of type Outcome.
PageEventsTaken from interaction’s Events property where the ParentEventId is the ID of a PageEvent, and the event is not an Outcome or Goal.
VenuesTaken from the interaction’s VenueId property.
CustomValuesNot currently set.

Entries are trimmed from each list if:

  • The associated interaction falls outside the configured maximum time period (for example, 30 days)
  • The maximum number of list cache entries has been exceeded - the oldest cache entries are trimmed
  • The number of unique interactions represented by all cache entries exceeds the maximum - the oldest cache entries are trimmed
Note

If the maximum interaction count is 25 and each cache entry is represented by a unique interaction, the list is limited to 25 entries even if the maximum cache entry count is 50.

Configuring the key behavior cache

The following configuration options are defined in two locations in the \App_data\config\sitecore\Collection\sc.XConnect.Collection.Model.Plugins.xml. You must update the configuration values in both locations:

  • <IContactMergeHandler.KeyBehaviorCacheHandler>
  • <ICalculatedFacetHandler.KeyBehaviorCacheHandler>
ElementDescription
MaximumCacheEntryCountSpecifies the maximum number of items in the cache for a given category, such as goals, page events, and so on.

The default value is 50 entries.
MaximumInteractionPeriodSpecifies the maximum period for interactions that xDB uses during updates.

The default value is 30 days.
MaximumInteractionCountSpecifies the maximum number of interactions that xDB examines during updates.

The default value is 25 interactions.
If you have suggestions for improving this article, let us know!