1. Events

VIEW events

Version:

The VIEW event tracks when the site visitor views a webpage in your app. It triggers every time your webpage loads. Because it is an essential event to track, it's important that you send VIEW events from all webpages where you want to track site visitor behavior.

Content SDK and JSS apps automatically capture VIEW events, with no coding required.

Tip

By default, the VIEW event triggers when a webpage loads, but not when a route changes. To capture VIEW events in response to a route change, send the events using the routing tools of your framework:

Contributed by: Boris Brodsky

You can send VIEW events by using the pageView function and optionally passing it the page view event data object.

The page view event data object

The page view event data object represents all the data about the event.

The page view event data object is optional, but we recommend that you provide it so you can also provide the following optional data in it:

Examples

Tip

During development, use your web browser's developer tools to check the payload containing all the event data that is sent to Sitecore.

Example 1. Sending a VIEW event

Here's an example page view event data object for a VIEW event. The object contains some optional event data and extension data. This object is passed to the pageView function, which sends the event:

By default, VIEW events include UTM parameters. Consider the following URL:

https://myretailsite.com?utm_source=newsletter&utm_medium=email&utm_campaign=summer_sale&utm_term=running+shoes

A VIEW event captured on the previous URL will contain all the UTM parameters in the event data. The event data object associated with this URL contains the following payload:

{
  "browser_id": "a38b230c-11eb-4cf9-8d5d-274e9f344925​",
  "channel": "WEB",
  "client_key": "",
  "currency": "EUR",
  "ext": {
    "pageVariantId": "page_variant_3",
    "customKey": "customValue"
  },
  "language": "EN",
  "page": "home",
  "pos": "",
  "requested_at": "2026-10-05T10:36:32.506Z",
  "type": "VIEW",
  "utm_campaign": "summer_sale",
  "utm_medium": "email",
  "utm_source": "newsletter",
  "utm_term": "running shoes"
}


If you have suggestions for improving this article, let us know!