Deep dive into Sitecore’s xConnect

What is xConnect?

A service layer between xDB and any trusted client which operates autonomously with Sitecore.

Sitecore uses xConnect for all its analytics and marketing automation features.

Main features

  • Automatic indexing of any contact, facet, interaction, or event
  • Push and pull operations on contacts and interactions
  • Search features make use of technologies like Solr or Azure Search
  • Choose to store your analytics data in either MongoDB or SQL Server
  • xConnect can capture complete user profiles, behaviors and interests
  • Power to connect and collect data from other external “non-Sitecore” applications
  • Clients can not access xDB data without xConnect
  • xConnect is the only way of communication to access any xDB data

How can xConnect be connected by third party?

The xConnect Client API is portable and can be used out of Sitecore project in normal .NET based applications as well without any dependency with Sitecore context.

If you want to write to xConnect from e.g a mobile application, you must set up a client that collects data from your application and submits that data to xConnect

No client has direct access to the xDB


xConnect application roles


xConnect Collection Service

  • Receives contacts and interactions
  • Allows reading of contact and interaction data by ID or identifier from the xDB Collection database
  • The xDB index contains contact and interaction data
  • Supports data extraction
  • Can be hosted in IIS and Azure App Service

xConnect Collection Search Service

  • Search contacts and interactions
  • This role can also collect data.
  • Can be hosted in IIS and Azure App Service

xConnect Search Indexer

  • This role adds and updates contact and interaction data
  • Windows Service Name: Sitecore xConnect Search Indexer Windows Service
  • Rebuilds the xDB search index
  • Uses xConnect Search to search in the xDB index
  • All data gets indexed – unless they are marked as PII sensitive
  • Can be hosted in Windows Service or Azure WebJob

xConnect Model


The xConnect model is a representation of the structure and type of data that is collected by xConnect.

This model is made up of smaller partial models

It hosts a JSON version of all partial models – The xConnect’s \App_data\Models folder must contain a JSON representation of all models. When a new model is created, it must be deployed to xConnect before it can be used.

There are type restrictions which must be concerned, facets and events must be unique within a model and across referenced models

Default facets are stored in Sitecore.xConnect.Collection.Model.DLL

Contact

A contact represents an individual who interacts with or may potentially interact with your organization

There are known and anonymous contacts and extendable via custom facets

The right to be forgotten is a contact’s right to have all personally identifiable data removed from the xDB.

The Sitecore Tracker is responsible for recording a contact’s activity during a web session, on session end the records will be submitted to xConnect

Contact merge is owned by xConnect and called by the tracker when an anonymous contact identifies themselves as a contact that already exists

Event 

An event is anything significant that occurs within the context of an interaction, such viewing a web page or making a purchase in a physical store.

Inherits the Sitecore.XConnect.Event Class

Event models determine what is be collected when an event is triggered. xConnect ships with the following default event models:

  • Event
  • Goal:Event
  • Outcome:Event
  • CampaignEvent:Event
  • DownloadEvent:Event
  • SearchEvent:Event
  • PageViewEvent:Event (System event)
  • PersonalizationEvent:Event (System event)
  • MVTestTriggered (System event)

Interaction

An interaction is the point where contact interacts with the application/organization like Login, Adding item to the Cart or placing order via phone, Payment or just simply browsing the site.

Represented by the Sitecore.XConnect.Interaction Class

Must contain at least one event

Interaction Model is extendable with custom facets

Facet

A facet is an information that enriches a contact or an interaction

Inherits Sitecore.XConnect.Facet Class

Contact facets should describe the qualities of a contact, not their behavior (e.g Frequent Flyer Status)

Interaction facets should describe the entire interaction (e.g ID of manager on duty during visit)

Contact facets or facet properties marked [PIISensitive] are not indexed if indexing of facets marked [PIISensitive] is disabled. Indexing of [PIISensitive] facets is disabled by default.

Contact and interaction facets or facet properties marked [DoNotIndex] are not indexed and searchable

To see how to create a model

https://doc.sitecore.com/developers/91/sitecore-experience-platform/en/create-a-model.html


xConnect Client API (C#)


The xConnect Client API is a portable web API that allows trusted clients to create, read, update, and search contacts and interactions over HTTPS. The xConnect Client API implements the oData protocol

The xConnect Client API is the only way to work with experience data. 

You cannot access the collection database or search index directly

The xConnect Client API has is asynchronous, but there are synchronous versions of most extension methods available

xConnect Client API is configured under C:\path\to\sitecore\App_Config\Sitecore\XConnect.Client.Configuration\Sitecore.XConnect.Client.config

For what you can use the Client API?

References

https://doc.sitecore.com/developers/90/sitecore-experience-platform/en/xconnect-218634.html

https://doc.sitecore.com/developers/90/sitecore-experience-platform/en/xconnect-search-indexer.html

https://doc.sitecore.com/developers/90/sitecore-experience-platform/en/xconnect-client-api–c–.html


Comments

Leave a comment