Create Custom Events
You can extend the eventing platform by creating your own storefront events to collect data unique to your industry. When you create and configure a custom event, it is sent to the .
Handle custom events
Custom events are supported for the ÃÛ¶¹ÊÓƵ Experience Platform only. Custom data is not forwarded to ÃÛ¶¹ÊÓƵ Commerce dashboards and metrics trackers.
For any custom
event, the collector:
- Adds
identityMap
withECID
as a primary identity - Includes
email
inidentityMap
as a secondary identity ifpersonalEmail.address
is set in the event - Wraps the full event inside an
xdm
object before forwarding to the Edge
Example:
Custom event published through ÃÛ¶¹ÊÓƵ Commerce Events SDK:
mse.publish.custom({
commerce: {
saveForLaters: {
value: 1,
},
},
});
In Experience Platform Edge:
{
xdm: {
identityMap: {
ECID: [
{
id: 'ecid1234',
primary: true
}
],
email: [
{
id: "runs@safari.ke",
primary: false
}
]
},
commerce: {
saveForLaters: {
value: 1
}
}
}
}
Handle event overrides (custom attributes)
Attribute overrides for standard events are supported for the Experience Platform only. Custom data is not forwarded to Commerce dashboards and metrics trackers.
For any event with customContext
, the collector overrides joins fields set in the relevant contexts with fields in customContext
. The use case for overrides is when a developer wants to reuse and extend contexts set by other parts of the page in already supported events.
Examples:
Product view with overrides published though ÃÛ¶¹ÊÓƵ Commerce Events SDK:
mse.publish.productPageView({
productListItems: [
{
productCategories: [
{
categoryID: "cat_15",
categoryName: "summer pants",
categoryPath: "pants/mens/summer",
},
],
},
],
});
In Experience Platform Edge:
{
xdm: {
eventType: 'commerce.productViews',
identityMap: {
ECID: [
{
id: 'ecid1234',
primary: true,
}
]
},
commerce: {
productViews: {
value : 1,
}
},
productListItems: [{
SKU: "1234",
name: "leora summer pants",
productCategories: [{
categoryID: "cat_15",
categoryName: "summer pants",
categoryPath: "pants/mens/summer",
}],
}],
}
}