Global events
Sitecore Discover JS SDK for React offers the following events to track visits, views, and logins.
trackUserLoginEvent
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.
| Argument | Type | Description |
|---|---|---|
| user | UserEventModel | Required. Describes the user. |
| context | Context | Required. Describes the page and context within which this event is dispatched. |
trackAppearEvent
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.
| Argument | Type | Description |
|---|---|---|
rfkId | string | Required. Identifies the Discover widget for which this event is being tracked. |
context | Context | Required. Describes the page and context within which this event is dispatched. |
trackPageViewEvent
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.
| Argument | Type | Description |
|---|---|---|
context | Context | Required. Describes the page and context within which this event is dispatched. |
If you have suggestions for improving this article, let us know!