EngageServer.event(type, eventData, req[, extensionData])
This is a server-side function used for implementing server-side tracking. If you want to implement client-side tracking instead, use the client-side functions.
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. |
req | object | The HTTP request. |
[extensionData]optional | object | Custom data about an event. 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. |
req | object | The HTTP request. |
[extensionData]optional | object | Maximum 50 custom attributes of your choice. |
Example 15. 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 16. 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 17. 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 18. 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 19. 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 20. 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 21. 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 22. 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.