Configure custom xConnect models


How to configure the application to load the assembly containing a custom name type.

This section applies to both the collection service and the processing service.

By default, .NET core does not load all assembly files in the application directly. Whenever you add a configuration that includes a custom type name, for example, to register a custom xConnect model, you must configure the application to load the assembly containing the type.


The custom xConnect model is deployed as an assembly, not as a JSON file as is done on the xConnect servers.

To configure the xConnect model in a Sitecore host application:

  1. In the sitecoreruntime folder, create a new folder which has the same name as the current environment. The default is Production. If you are configuring your development environment, for example, it should be Development.

  2. Copy the assembly into the environment folder sitecoreruntime\<environment>.

  3. You can now add a configuration to extend the xConnect configuration and include the custom xConnect model. Inside the config folder, add a file and name it, for example, xConnectModels.xml.

  4. Inside the xConnectModels.xml file, add the following content:

                    <TypeName>UTDemo.XConnectExtensions.CampaignModel, UTDemo.XConnectExtensions</TypeName>

    This code registers the custom xConnect model provided by the UTDemo.XConnectExtensions.CampaignModel class.

To allow callers to use a custom xConnect model event, you must provide a mapping for the event. The default mappings are provided in the \sitecore\Sitecore.Tracking\Config\config.xml file. You must add your mappings in a patch file:

  1. In the config folder, add a new file and name it, for example, eventMappings.xml.

  2. Add your custom event mappings to the config file using the same node structure as the \sitecore\Sitecore.Tracking\Config\config.xml file. This example adds a custom event type called cg:

                <cg>UTDemo.XConnectExtensions.CustomGoal, UTDemo.XConnectExtensions</cg>

Callers can now set the type of an event to cg to register that event type. For example, a client can send this HTTP request: