Page View Events

Format in Sitecore 8.x

In Sitecore 8.x, each time a page is viewed an event is triggered These events are captured in the interaction in the property Pages. This property is an array.

In addition, a page can trigger its own events. These events are captured under the corresponding member of the Pages array.

The following is an example of an interaction with the Pages property, with the page having its own events:

"Pages" : [
    {
        "DateTime" : ISODate("2018-01-01T12:00:00.000Z"),
        "Duration" : 60,
        "Item" : {
            "_id" : NUUID("506dd1a2-2150-4062-abb8-e029d28af870"),
            "Language" : "en",
            "Version" : 1
        },
        "PageEvents" : [
            {
                "Name" : "Error",
                "ItemId" : NUUID("506dd1a2-2150-4062-abb8-e029d28af870"),
                "Timestamp" : 0,
                "DataKey" : "Presentation error: Data source isn't set or have wrong template...",
                "Text" : "Presentation error: Data source isn't set or have wrong template...",
                "PageEventDefinitionId" : NUUID("c8bf254a-9ccc-4e16-9009-82b7cd33e4be"),
                "DateTime" : ISODate("2018-01-01T12:00:00.000Z"),
                "Value" : 0
            }
        ],
        "PersonalizationData" : {
            "ExposedRules" : []
        },
        "SitecoreDevice" : {
            "_id" : NUUID("fe5d7fdf-89c0-4d99-9aa3-b5fbd009c9f3"),
            "Name" : "Default"
        },
        "MvTest" : {
            "ValueAtExposure" : 0
        },
        "Url" : {
            "Path" : "/about-us"
        },
        "VisitPageIndex" : 5
    }
],

Format in Sitecore 9

In Sitecore 9, all events associated with an interaction are stored directly on the interaction. The events are stored in a property named Events.

Mapping Pages to Page View Events

For each page that is included in the interaction, a page view event is created.

Source object Member of the array located at Pages on the interaction document
Target object Sitecore.XConnect.Collection.Model.PageViewEvent
Mapping definition MongoDB to xConnect Event Mappings > MongoDB Page to xConnect Page View Event
Value to write to target object Property on target object
Duration from source object Duration
Item._id from source object ItemId
Item.Language from source object ItemLanguage
Item.Version from source object ItemVersion
DateTime from source object Timestamp
Url.Path from source object Url

Understanding Page Events

For each page that is included in the interaction, there may be page events to map. A page event is an event that is triggered by a page.

For example, if there is a search box on a page and the visitor uses the search box, a search event may be captured. Since this search event happened while on a specific page, the search event is consider a page event, and it is associated with the page with the search box.

Sitecore comes with a variety of page event types. In addition, custom page event types can be added. The page event types available on your Sitecore server can be found using Content Editor, in the following section: Settings > Analytics > Page Events

Each page event type stores its own data. For example, a page event that represents a search will include the search term. A page event that represents an error will include a description of the error.

The way you determine the page event type for a specific page event is to look at its page event definition id. xDB Data Migration Tool uses this value to determine how to map the data for a page event.