1. JS SDK Reference

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 interfaceEvent type
trackAppearEventGlobal event
trackSearchResultsClickEventSearch results widget event
trackSearchResultsFacetClickEventSearch results widget event
trackRecommendationClickRecommendation widget
trackPreviewSearchClickPreview search widget
trackPageViewEventGlobal event

Events to be dispatched using callbacks

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

Event interfaceEvent type
trackAddToCartEventFunnel event
trackOrderConfirmEventFunnel event
trackPDPViewEventFunnel event
trackStatusCartEventFunnel event
trackUserLoginEventGlobal event
If you have suggestions for improving this article, let us know!