Custom Event with No Custom DataΒΆ

In Sitecore 8.x, page events have a number of standard properties available to store data. These include:

  • Data
  • DataKey
  • Name
  • Text

This section is appropriate if the custom event you are mapping to in Sitecore 9 does not have any additional properties to consider.

Consider an example where, in Sitecore 8.x, you captured a page event when the visitor views a page that displays the status of his membership in a customer loyalty program.

In MongoDB, the page event looks like the following:

    "Name" : "Loyalty program status checked",
    "ItemId" : NUUID("4257b6b4-e263-4356-bba1-9affce442a77"),
    "Timestamp" : NumberLong(0),
    "Text" : "Loyalty program status checked for member 100011",
    "PageEventDefinitionId" : NUUID("5963f929-f278-4784-ba9d-be2fa5b86ae9"),
    "DateTime" : ISODate("2017-11-11T11:00:00.000Z"),
    "Value" : 5

In Sitecore 9, you created the following custom event to represent this data:

using Sitecore.XConnect;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MigrationTool.Examples.Loyalty
    public class LoyaltyProgramStatusCheckedEvent1 : Event
        public LoyaltyProgramStatusCheckedEvent1(Guid definitionId, DateTime timestamp) : base(definitionId, timestamp)

You want to implement the following mapping:

Sitecore 8.x property Sitecore 9 property
DateTime Timestamp
PageEventDefinitionId DefinitionId
Text Text
Value EngagementValue