For developers: Override built-in tracking event handlers
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.
You can override the built-in event handlers to upload specific data to SDEC. Similar to the custom event handlers, the built-in event handlers also inherit one of the handler base abstract classes:
- SentencesTrackingHandlerBase<T>
- SubjectMetadataTrackingHandlerBase<T>
- MappingsTrackingHandlerBase<T>
Where <T> is the type of Sitefinity CMS event that implements the IEvent interface.
Next, you override the Compose* method of the respective class.
To find the exact class names of all built-in event handlers, check the DataExperinceCloudConnector configuration where all the classes are registered.
Following is an example of how to override a built-in event handler:
public class CustomFormEntrySubmittedTrackingHandler : FormEntrySubmittedTrackingHandler
{
public override List<Sentence> ComposeSentences(Modules.Forms.Events.IFormEntryCreatedEvent @event)
{
string pageUrl = SystemManager.CurrentHttpContext.Request.Url.AbsolutePath;
var obj = string.Format("{0}\\{1}", @event.FormTitle, pageUrl);
List<Sentence> sentences = new List<Sentence>()
{
this.SentenceMng.CreateSentence(
predicate,
obj,
new Dictionary<string, string>() { { "PageTitle", pageTitle }, { "PageUrl", pageUrl }, { "FormTitle", @event.FormTitle } },
new Dictionary<string, string>())
};
}
}