Events

Sitecore Discover JavaScript SDK for React offers many interfaces to track events. This topic lists the various event types, events, and contextual information required to register events.

Note

Not all events are dispatched by JS SDK when they occur. Some have to be registered verbosely or using callbacks.

In an implementation with JS SDK for React:

  • The SDK registers most user interaction with your components because the two are coupled.

  • You must verbosely dispatch login and funnel events.

Events dispatched by JS SDK

The following table lists events that the JS SDK for React dispatches on its own:

Event interface

Event type

trackAppearEvent

Global event

trackSearchResultsClickEvent

Search results widget event

trackSearchResultsFacetClickEvent

Search results widget event

trackRecommendationClick

Recommendation widget

trackPreviewSearchClick

Preview search widget

trackPageViewEvent

Global event

Events to be dispatched using callbacks

The following table lists events that you need to dispatch using callbacks.

Event interface

Event type

trackAddToCartEvent

Funnel event

trackOrderConfirmEvent

Funnel event

trackPDPViewEvent

Funnel event

trackStatusCartEvent

Funnel event

trackUserLoginEvent

Global event

Do you have some feedback for us?

If you have suggestions for improving this article,