Tracking interaction facets
Version:
This topic describes how to add facets to an interaction in the context of the tracker. For more information about facets, see the following topics:
Store facet data in custom values
- Create an interaction facet and register it in the model.
- Create an instance of an interaction facet in a tracking context. The facet must be marked
[Serializable]. - Add the facet to
Sitecore.Analytics.Tracker.Current.Interaction.CustomValuesas shown. In this example, the facet key is used as a dictionary key:
Create an interaction conversion processor
- Create a processor that inherits
ConvertToXConnectInteractionProcessorBase - Implement the
Process()method as shown. Copy theCustomerMoodfacet fromargs.TrackerVisitData.CustomValuestoargs.Facets.
Note
Custom values (args.TrackerVisitData.CustomValues) are not saved to xConnect. If custom values are not converted into a format that is supported by xConnect, the data will be lost.
Register the interaction conversion processor
Patch your processor in the main ConvertToXConnectInteractionProcessor as shown:
If you have suggestions for improving this article, let us know!