- Functions
pageView
Version:
| Type | Function |
| Import path | @sitecore-cloudsdk/events/browser |
Sends a VIEW event.
Signature
Parameters
| Name | Type | Description |
|---|---|---|
pageViewData | PageViewData | Optional. Data for VIEW events. |
Return value
Returns a promise.
Examples
Example 31. Running the pageView function
Note
To run this function, you have to first initialize the Cloud SDK.
See more examples and other data you can include in the event.
Here's an example of how to use the pageView function:
:::
Example 32. Customizing VIEW event capturing
JSS Next.js apps automatically send VIEW events from every webpage using the src/components/CdpPageView.tsx component, with no coding required. If this default implementation doesn't suit your application requirements, you can disable it, and then set up your own, customized VIEW event capturing.
Here's an example of how to set up your custom VIEW event capturing:
:::
If you have suggestions for improving this article, let us know!