IMPORTANT: This version of Sitefinity CMS is out of support and the respective product documentation is no longer maintained and can be outdated. Use the version selector to view a supported product version.
NOTE: Sitefinity Digital Experience Cloud (DEC) was renamed to Sitefinity Insight as a part of the Sitefinity 13.0 release. However, Sitefinity CMS and its documentation prior to version 13.0 continue using the former name - Digital Experience Cloud.
The Progress Sitefinity Digital Experience Cloud connector in Sitefinity CMS provides an easy-to-use infrastructure for creating new handlers, as well as overriding the built-in ones. However, in some cases, you may require custom logic that does not depend on Sitefinity CMS events and requires a custom implementation of sending interactions to Progress Sitefinity Digital Experience Cloud. Therefore, you can take advantage of the .NET SDK. Once the Progress Sitefinity Digital Experience Cloud is active after you set the connector settings and credentials, sending of interactions looks similar to the following example:
string
dataCenterKey = Config.Get<DataIntelligenceConnectorConfig>().DataCenterApiKey;
dataSource = Config.Get<DataIntelligenceConnectorConfig>().ApplicationName;
InteractionClient interactioncleint =
new
InteractionClient(dataCenterKey);
subjectId = ClaimsManager.GetCurrentUserId().ToString();
obj =
"page-url/news"
;
predicate =
"Has visited"
// Built-in predicates used by the built-in handlers may be found here: Telerik.Sitefinity.DataIntelligenceConnector.Models.Predicates
interactioncleint.ImportInteraction(dataSource,
Interaction() { Subject = subjectId, Object = obj, Predicate = predicate, Timestamp = DateTime.UtcNow });
Apart from the interaction client, you can use the subject mapping client. All these examples apply as-is in the context of a Sitefinity CMS website. Storing and validating the settings in a configuration is a nice addition by Sitefinity CMS in order to enforce good practice about managing configurable data.
In the code example above, you get the UserId as subjectId. This example, however, implies that the contact is logged on to your website. If the contact is not logged in, you can use the tracking cookie which is automatically created by the Progress Sitefinity Digital Experience Cloud connector. This cookie contains a tracking ID which is used as a subject in an interaction and when the contact identifies (for example, logs on to the website), a subject mapping that maps the tracking cookie ID and UserId is sent to the cloud.
The following code example demonstrates how to get the tracking cookie value:
using
Telerik.Sitefinity.DataIntelligenceConnector.Cookies;
CookiesManager cookiesManager =
CookiesManager();
subjectId = cookiesManager.GetCookieValue();
Back To Top
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important