Custom event
A custom event is unique to your organization. For example, most retail sites have an ADD
event that captures when a guest clicks the add button. However, you might want to capture, for example, how many times a guest adds items to a wish list, and for this, there is no standard event in Sitecore CDP. To do this, you can send a custom event, for example, ADD_TO_WISHLIST
.
You can track how often a custom event is raised by creating a goal for an experiment in Sitecore Personalize. You can also use the raising of the custom event as the basis for declaring a winner in your experiment.
You send a custom event in the same way that you send a standard event. You must be consistent with the name of the custom event you send and you must not use the name of a standard event.
To send a custom event, use the following required attributes:
Attribute |
Type |
Description |
Example |
---|---|---|---|
|
string (uppercase) |
The touchpoint where the user interacts with your brand. |
|
|
string (uppercase) |
The name of the custom event. This is a custom value of your choice. However, you must not set the value to any of the Sitecore CDP reserved event names. |
You must not set the value to any of the Sitecore CDP reserved event names:
|
|
string (uppercase ISO 639-1) |
The language the user is using your app in. |
|
|
string (uppercase ISO 4217) |
The alphabetic currency code of the currency the user is using in your app. |
|
|
string |
The name of the webpage where the interaction with your brand takes place. This is a custom value of your choice. |
|
|
string |
The name of the point of sale where the interaction with your brand takes place. |
|
|
string |
The browser ID. |
|
{
"channel": "MOBILE_APP",
"type": "ADD_TO_WISHLIST",
"language": "EN",
"currency": "EUR",
"page": "home",
"pos": "myretailsite/ireland",
"browser_id": "a38b230c-11eb-4cf9-8d5d-274e9f344925"
}
You can extend a custom event by including a maximum of 50 custom attributes of your choice.
In the type
attribute of the event, the custom event name is specified as myretailsite:CLICKED_POPUP
. The event contains the custom attributes clickedPopup
and timeBetweenPopupAndClick
.
{
"channel": "MOBILE_APP",
"type": "myretailsite:CLICKED_POPUP",
"language": "EN",
"currency": "EUR",
"page": "home page",
"pos": "myretailsite/ireland",
"browser_id": "a38b230c-11eb-4cf9-8d5d-274e9f344925",
"ext": {
"clickedPopup": "true",
"timeBetweenPopupAndClick": "8 seconds"
}
}
This example shows a custom event that is used to track variant performance against a custom goal. In this example, the custom event name is specified in the type
parameter as ADD_BAG
. The event contains an ext
object which includes a custom goal value bagValue
and attribute bagConverted
.
If the custom goal is set up to track the numerical price of bag using bagValue
, each time the custom event triggers, this number will be derived from the ext
object and considered in goal calculations.
Additionally, if the custom goal is also set up to track an additional attribute such as bagConverted
, the attribute's string value can be used to determine if the custom event is successful.
{
"channel": "WEB",
"type": "ADD_BAG",
"language": "EN",
"currency": "EUR",
"page": "home page",
"pos": "myeurosite",
"browser_id": "a38b230c-11eb-4cf9-8d5d-274e9f344925",
"ext": {
"bagValue": "1234",
"bagConverted": "true"
}
}