Create a facet merge handler
A facet merge handler determines what should happen to a particular facet when two contacts are merged. Facet merge handlers are configured on the xConnect Collection service and are executed when a merge operation is submitted.
All value facets are merged automatically - you do not have to create your own handler for every custom facet unless you want to override default behavior.
You should create your own merge handler when:
-
You have created a calculated facet. Calculated facets are not merged automatically.
-
You want to merge a particular facet in a way that differs from the default - for example, you may want the source value to always overwrite the target value.
Create a value facet
Implement a merge handler
Implement a MergingCalculatedFacetHandler as shown.
Return false from the UpdateFacet() method. This method is only used for calculated facet calculations.
Configure facet merge handler
-
Create a file named sc.CustomPlugins.xml in
c:\path_to_xconnect\root\App_data\config\sitecore\Collection\. -
Paste the following configuration, substituting the highlighted lines with your own handler:
-
Copy the sc.CustomPlugins.xml file to all xConnect Collection and Search instances.
NoteDefault merge facet handlers are configured in the c:\path\toxconnect\root\App_data\config\sitecore\Collection\sc.XConnect.Collection.Model.Plugins.xml file.
Contact merge and the tracker
Contact merge is owned by xConnect and called by the tracker when an anonymous contact identifes themselves as a contat that already exists. You can use the xConnect Client API to test a merge handler.