Convert a page event
This topic describes how to convert a generic event or a page event that was triggered from the tracker into a custom event before it is saved to xConnect.
xConnect does not distinguish between generic events and page events. Page event definition items are located under /sitecore/system/Settings/Analytics/Page Events, where as generic event definition items are located under /sitecore/system/Marketing Control Panel/Events.
Create a custom event model
Create a custom event model as shown. This example uses the built-in ‘Print’ page event. Refer to the xConnect documentation for more information about creating custom events.
Create an event conversion processor
-
Create a pipeline processor that inherits
ConvertPageEventDataToEventBase. -
Implement
CreateEventandCanProcessPageEventDataas shown. This handler assumes that theOrientationis stored in theCustomValuesdictionary.
Register event conversion processor
Create a new new configuration file named MyBrand.CustomEvents.config and patch in your handler as shown:
Your processor must be patched in before the final event handler as shown.
Trigger the event
Trigger the event with the custom data that the event conversion pipeline processor expects: