1. Events

Funnel events

Sitecore Search JS SDK for React offers the following funnel events that are dispatched when a visitor adds an item to their cart or wish list, completes an order, and so on.

Use the generic trackAddEvent and trackRemoveEvent to track addition and removal of entities into and from any type of conversion funnel. Both events take an array of EntityPayload objects.

Note

All attributes are optional unless indicated otherwise.

trackAddEvent

Tracks add to conversion funnel events. It is dispatched when the visitor adds an entity to the conversion funnel.

Note

Dispatch this event verbosely because the SDK cannot infer when this action is happening.

NameTypeDescriptionValue
entitystringRequired.

Type of entity.
content
namestringRequired.

Describes the type of conversion action.
bookmark

review

compare

cart

wishlist

like

upvote

download

order_confirm
payloadAddEventPayloadRequired.

Payload dispatched with the event.
-

AddEventPayload

Payload dispatched with trackAddEvent.

NameTypeDescription
itemsarray< EntityPayload >Required.

Array of payloads for entities
actionSubtypestringconversion
reviewReviewEventModel
customAttributesRecord< string, any>This object contains name value pairs of custom attributes.

EntityPayload

This payload describes an entity. Use this payload type in all events when you want to track interaction with an entity.

NameTypeDescription
idnumberRequired.

ID of the entity.
entityTypestringRequired.

Name of the entity.
urlstringURL of the entity page. Typically the detail page of the entity.

When not supplied, the SDK uses the URL of the page.
sourceIdstringID of the source of the entity, as assigned by the connector.

ReviewEventModel

This payload describes a review.

NameTypeDescription
idstringRequired.
ratingnumberNumber value of the rating in the displayed range.
commentstringThe text entered by visitor in the comment field, if displayed.

trackRemoveEvent

Tracks remove from conversion funnel events. It is dispatched when the visitor removes an entity from the conversion funnel.

Note

Dispatch this event verbosely because the SDK cannot infer when this action is happening.

NameTypeDescriptionValue
entitystringRequired.

Type of entity.
content
namestringRequired.

The name of the conversion funnel from which the entity is removed and tracked by the event..
bookmark,

review

compare

wishlist

like

cart
payloadRemoveEventPayloadRequired.

Payload dispatched with the event.
-

RemoveEventPayload

Payload dispatched with trackRemoveEvent.

NameTypeDescription
itemsarray< EntityPayload >Required.

Array of payloads for entities
actionSubtypestringconversion
reviewReviewEventModel

ReviewEventModel

This payload describes a review.

NameTypeDescription
idstringRequired.
ratingnumberNumber value of the rating in the displayed range.
commentstringThe text entered by visitor in the comment field, if displayed.

EntityPayload

This payload describes an entity. Use this payload type in all events when you want to track interaction with an entity.

NameTypeDescription
idnumberRequired.

ID of the entity.
entityTypestringRequired.

Name of the entity.
urlstringURL of the entity page. Typically the detail page of the entity.

When not supplied, the SDK uses the URL of the page.
sourceIdstringID of the source of the entity, as assigned by the connector.
If you have suggestions for improving this article, let us know!