Once you read through the above two links, it will be easy to understand the following. I spent over 2 months trying to figure things out with the help of the product team.

Using the Universal Tracker, we can store Interactions and Events within those interactions. The interactions and events in the interaction are sent to the Web API endpoint, this is called the Collection Stage.

During the Collection stage all the interactions and events are stored in temporary storage (SQL Server). An individual interaction can be closed by a completed request or by the visit being timed out. Once the interaction is closed the next stage is Processing.

During the Processing stage you can enhance the data before sending it to the xDB by adding filters which can do lookups like the GeoIP lookup on an IP. Once processing is complete the data is sent to the xConnect service to be stored in the XDB.

The Universal Tracker Client SDK is a Portable Class Library that supports all interaction and event types registered in xConnect, including the standard interactions; event, goal, outcome, campaign. The SDK also supports additional events, like Device Information, Geolocation, Page Opened, Page Closed and Error. The SDK will be open source and is pre-baked into the Sitecore Mobile SDK, powered by Xamarin. I would say that the current focus is on getting UT stable in the Mobile SDK and cover all use cases.

The expectation is that you start an Interaction, send a few goals or events and then close out the session. Unfortunately in my use case, I need to be able to start multiple interactions for different contacts and send events. Currently there are only three public web API available, put events, put interaction, complete interaction.

I also need to be able to search for an active Interaction by the contact identifier, which is not available. There is a hidden method available to search for an interaction by interaction id but that won't help me.

Setup

Let's get started by setting up some basic items so we can track our anonymous contacts. I needed to setup a channel called SUGCON.

UT does not work with the ref data service so we need to sync the channels we need from /Sitecore/system/Marketing Control Panel/Taxonomies/Channel to the \Sitecore.Tracking.Processing.Service\sitecore\Sitecore.Tracking.Processing.ChannelManagement\PipelinesConfig\channelTypes.json file manually.

Next, setup an event and goals. Be sure to deploy what you have created.

Once they are setup, we can use the goal and event id's to trigger events for UT.

In my scenario, I need the anonymous contacts to be indexed. Modify the IndexAnonymousContactData setting to true in the xconnectpath\root\App_data\jobs\continuous\IndexWorker\App_data\Config\Sitecore\SearchIndexer\sc.Xdb.Collection.IndexerSettings.xml file. There is an identical setting in xconnectpath\root\App_data\Config\Sitecore\SearchIndexer\sc.Xdb.Collection.IndexerSettings.xml file which is not used.

The Universal Tracker is responsible for collecting, processing and sending interactions to xConnect. The Sitecore processing and reporting roles are responsible for the data aggregation and reporting. UT interactions are ignored by default by the WebVisitFilter because the interactions are not PageViews or Web visits. In order for us to process the Universal Tracker interactions we need to disable WebVisitFilter for all dimensions in the sitecorewebpath\App_Config\Sitecore\ExperienceAnalytics\Sitecore.ExperienceAnalytics.Aggregation.config file.

The Sitecore.Tracking.Collection.Service\sitecore\Sitecore.Tracking\Config\config.xml configuration file controls how submitted events are mapped to the corresponding xConnect events defined in the Sitecore Marketing Control panel. If you submit an event that is unknown and is not specified in this config, there is a risk of data loss or improper parsing.

You can specify additional types by adding the published type to the config.xml file, with a fully qualified name with the syntax AssemblyName.Namespace.ClassName, AssemblyName.

The Sitecore.Tracking.Collection.Service\sitecore\Sitecore.Tracking.Plugin.Status\Config\config.xml file controls the UT Status plugin, which displays the status page. By default, the setting LocalAccessOnly is set to true, which means the status controller only accepts requests from the local machine. External requests will return an HTTP 404 (not found) error. Set LocalAccessOnly to false to allow external requests.

The example below shows how we are starting an interaction and also triggering a goal that the user has attended the conference.

The call to start interaction returns a 201 (Created) along with the Interaction Id. We can use this Id to push more events to the UT as shown in the following example. All subsequent calls would need the id to be passed.

Closing Interactions

You can close the interactions by sending a PUT request as shown below.

You can also set a timeout attribute per channel to closing out Interactions in the Sitecore.Tracking.Processing.Service\sitecore\Sitecore.Tracking.Processing.ChannelManagement\PipelinesConfig\channelTypes.json file.

All the active interaction and interactions are stored temporarily in the UT database before they are processed. You can run queries to see the values. Be sure to convert the binary data field to text to investigate.

The following is some sample C# code to push an interaction with an event and a goal.

Processing

The interactions are not processed in real time by we can modify some setting to make it more efficient. By default, the processing engine checks for closed interactions every 5 seconds. We can modify the BatchSize and ProcessingThresholdPercent in Sitecore.Tracking.Processing.Service\sitecore\Sitecore.Tracking.Processing.Engine\Config\config.xml file to optimize the processing.

Feature requests:
- Get/search for an active interactions by the contact identifier.
- Manually trigger UT to process the completed interactions.
- Search for an active Interaction by the contact identifier.
- Manage multiple interactions at one time. (switching between active interactions)