1. Events

Global events

Sitecore Discover JS SDK for React offers the following events to track visits, views, and logins.

trackUserLoginEvent

Sent when a user logs in to the page.

Note

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

ArgumentTypeDescription
userUserEventModelRequired.

Describes the user.
contextContextRequired.

Describes the page and context within which this event is dispatched.

trackAppearEvent

Tracks the appearance of a widget on the page. All the widgets inherit this behavior.

Note

Dispatch this event verbosely if you are not using Discover UI components.

When hooked through the JS SDK, Discover UI components handle most user interactions and dispatch events automatically.

ArgumentTypeDescription
rfkIdstringRequired.

Identifies the Discover widget for which this event is being tracked.
contextContextRequired.

Describes the page and context within which this event is dispatched.

trackPageViewEvent

Tracks a visit on a page.

Note

Dispatch this event verbosely if you are not using Discover UI components.

When hooked through the JS SDK, Discover UI components handle most user interactions and dispatch events automatically.

ArgumentTypeDescription
contextContextRequired.

Describes the page and context within which this event is dispatched.
If you have suggestions for improving this article, let us know!