- Interfaces
EventData
| Type | Interface |
| Extends | EventAttributesInput |
| Import path | @sitecore-cloudsdk/events/browser |
Data for custom events.
Signature
Properties
| Name | Type | Description | Value |
|---|---|---|---|
| type | string | Required.The type of the event.To send a custom event using event, or to add a custom event to the event queue using addToEventQueue, set type to a unique value. Do not set type to a reserved event name.Recommendation: Include the name of the site in the unique value, for example, "myretailsite".Reserved event names event name starting with "SC_"."ADD" - standard ADD event."ADD_CONSUMERS" - standard ADD_CONSUMERS event."ADD_CONTACTS" - standard ADD_CONTACTS event."CAMPAIGN_TRACKING" - internally reserved event. Do not use."CHECKOUT" - standard CHECKOUT event."CLEAR_CART" - standard CLEAR_CART event."CONFIRM" - standard CONFIRM event."FEEDBACK" - FEEDBACK event."IDENTITY" - standard IDENTITY event."INTERACTION" - internally reserved event. Do not use."ORDER_CHECKOUT" - standard ORDER_CHECKOUT event."PAYMENT" - standard PAYMENT event."SUBSCRIPTION" - internally reserved event. Do not use."SEARCH" - standard SEARCH event."TRACKING" - internally reserved event. Do not use."VIEW" - standard VIEW event.To send a standard event using event, set type to the standard event name, such as ORDER_CHECKOUT or SC_SEARCH_WIDGET_VIEW.We recommend that you send standard events using their dedicated functions instead of the event function. For example, send an IDENTITY event using the identity function. | "myretailsite" |
| extensionData | ExtensionData | Optional.Any custom data to collect about an event in addition to the other attributes provided for the event data. | { customKey: "customValue" } |
| searchData | NestedObject | Optional.ImportantRequires a Sitecore Search subscription.Sitecore Search data about the event.Use only in the following, standard events set, the event and all its data will be available in Sitecore Search.Construct according to the Sitecore Search Events API reference and data model. | N/A |
Examples
Example 40. Custom event
Here's a basic event data object for a custom event named "myretailsite:CLICKED_PROMO":
Example 41. Custom event with optional data
Example 42. SC_SEARCH_WIDGET_VIEW event
Here's an example event data object for a SC_SEARCH_WIDGET_VIEW event with search data:
Some code examples, images, and UI labels may still use XM Cloud while engineering assets are being updated.
Example 43. SC_SEARCH_WIDGET_CLICK event for an item
Here's an example event data object for a SC_SEARCH_WIDGET_CLICK event with search data. This object describes a click event on an item:
Example 44. SC_SEARCH_WIDGET_CLICK event for a facet
Here's an example event data object for a SC_SEARCH_WIDGET_CLICK event with search data. This object describes a click event on a facet:
Example 45. SC_SEARCH_WIDGET_CLICK event for a suggestion
Here's an example event data object for a SC_SEARCH_WIDGET_CLICK event with search data. This object describes a click event on a suggestion: