Engage.event(type, eventData[, extensionData])
The event() function sends one of the following:
- A standard event, for example, ADD, CONFIRM, or CHECKOUT.
- A custom event with custom data of your choice.
sidebar. Parameters for a standard event
| Parameter | Type | Description |
|---|---|---|
type | string | The type of the standard event. If you set this value to any of the Sitecore Personalize reserved event names, for example, VIEW, ADD, or CONFIRM, the event becomes a standard event. Sitecore Personalize reserved event names:
|
eventData | object | All the event data specific to the standard event type, for example, an ADD event. |
[extensionData]optional | object | Maximum 50 custom attributes of your choice. |
sidebar. Parameters for a custom event
| Parameter | Type | Description |
|---|---|---|
type | string | The name of the custom event. If you set this value to a custom value of your choice different than Sitecore Personalize reserved event names, for example, "CUSTOM_EVENT_SEARCH" or "myretailsite:CLICKED_POPUP", the event becomes a custom event. |
eventData | object | TFhe required attributes that every event object must include, and optional attributes that event objects can include. |
[extensionData]optional | object | Custom data about an event. Maximum 50 custom attributes of your choice. |
Example 5. ORDER_CHECKOUT event
Here's an example of how to use the event() function to send an ORDER_CHECKOUT event. The eventData object must contain all the required attributes for the event type, in this example, for an ORDER_CHECKOUT event.
2.0 data model does not support this functionality.
Example 6. ADD event
Here's an example of how to use the event() function to send an ADD event. The eventData object must contain all the required attributes for the event type, in this example, for an ADD event.
Example 7. CONFIRM event
Here's an example of how to use the event() function to send a CONFIRM event. The eventData object must contain all the required attributes for the event type, in this example, for a CONFIRM event.
Example 8. CHECKOUT event
Here's an example of how to use the event() function to send a CHECKOUT event. The eventData object must contain all the required attributes for the event type, in this example, for a CHECKOUT event.
Example 9. PAYMENT event
Here's an example of how to use the event() function to send a PAYMENT event. The eventData object must contain all the required attributes for the event type, in this example, for a PAYMENT event.
Example 10. CLEAR_CART event
Here's an example of how to use the event() function to send a CLEAR_CART event. The eventData object must contain all the required attributes for the event type, in this example, for a CLEAR_CART event.
Example 11. SEARCH event
Here's an example of how to use the event() function to send a SEARCH event. The eventData object must contain all the required attributes for the event type, in this example, for a SEARCH event.
Example 12. Custom event
Here's an example of how to use the event() function to send a custom event called myretailsite:CLICKED_POPUP. eventData contains all the required attributes for the event data object. extensionData contains the custom data.