---
title: "VIEW events"
slug: "view-events"
abstract: "Understand VIEW events, which track when a site visitor views a webpage in your app."
---
# VIEW events

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.

JSS Next.js and JSS Angular apps [automatically capture](https://doc.sitecore.com/sdk/en/developers/003/cloud-sdk/getting-started-with-the-cloud-sdk.html "Getting started with the Cloud SDK") `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:
>
> -   *Next.js App Router* - use an effect when the value returned by [`usePathname`](https://nextjs.org/docs/app/api-reference/functions/use-pathname) changes.
>
> -   *Next.js Pages Router* - send the events in [`routeChangeComplete`](https://nextjs.org/docs/pages/api-reference/functions/use-router).
>
>
> Contributed by: [![mvp-boris-brodsky.jpg](https://doc.sitecore.com/api/markdown-image/sdk/en/developers/003/cloud-sdk/images/mvp-boris-brodsky.jpg) Boris Brodsky](https://www.linkedin.com/in/borisbrodsky)

You can send `VIEW` events by using the [`pageView`](https://doc.sitecore.com/sdk/en/developers/003/cloud-sdk/cloud-sdk-reference/cloud-sdk-events/cloud-sdk-events-browser/functions/cloud-sdk-events-browser-pageview.html "pageView") function and optionally passing it the [page view event data object](https://doc.sitecore.com/sdk/en/developers/003/cloud-sdk/cloud-sdk-reference/cloud-sdk-events/cloud-sdk-events-browser/interfaces/cloud-sdk-events-pageviewdata.html "PageViewData").

## 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:

- Data such as the channel and the language of the page where the event triggered, the [referrer URL](https://en.wikipedia.org/wiki/HTTP_referer), [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters), and whether the event triggered on a SitecoreAI [personalized page variant](https://doc.sitecore.com/sai/en/developers/jss/22/jss-sai/page-personalization-and-component-a-b-n-testing.html).
- The search data object. If you provide this object, the event becomes a [Sitecore Search entity page view event](https://doc.sitecore.com/search/en/developers/search-developer-guide/en/creating-an-entity-page-view-event.html), and the event with all its data is sent to Sitecore Search.

    > [!note]
    > Refer to the [Sitecore Search Events API reference and data model](https://doc.sitecore.com/search/en/developers/search-developer-guide/en/events-api-reference-and-data-model.html) to construct search data objects.

- The [extension data object](https://doc.sitecore.com/sdk/en/developers/003/cloud-sdk/cloud-sdk-concepts/concepts-tracking/events.html#UUID-7fc5cdc4-39f8-e174-2e94-4f459b9ba03d_section-idm234411833561624 "Data provided by you").

## Examples

> [!tip]
> During development, use your web browser's developer tools to [check the payload](https://doc.sitecore.com/sdk/en/developers/003/cloud-sdk/cloud-sdk-concepts/concepts-tracking/events.html#UUID-7fc5cdc4-39f8-e174-2e94-4f459b9ba03d_section-idm234451877631545 "Checking the payload") containing all the event data that is sent to Sitecore.

Example 1. Sending a VIEW event without search data

Here's an example page view event data object for a `VIEW` event. The object contains some optional event data and extension data:

```typescript
let eventData: any = {
  language: "EN",
  page: "home",
  channel: "WEB",
  currency: "EUR",
  pageVariantId: "page_variant_3",
  extensionData: {customKey: "customValue"}
};
```

This object is passed to the `pageView` function, which sends the event:

::::tabs
:::tab{title="Browser module"}

```typescript
// ...
pageView(eventData);
// ...
```

:::
:::tab{title="Server module"}

```typescript
// ...
await pageView(request, eventData);
// ...
```

:::
::::

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

```http
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:

```json
{
  "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"
}
```

Example 2. Sending a VIEW event with search data

Here's an example page view event data object for a `VIEW` event. The object contains some optional event data, extension data, and search data:

```typescript
const eventData: any = {
  language: "EN",
  page: "home",
  channel: "WEB",
  currency: "EUR",
  pageVariantId: "page_variant_3",
  extensionData: {customKey: "customValue"},
  searchData: {
    value: {
      context: {
      page: {
        uri: "https://www.sitecore.com"
      }
    },
    entities: [
      {
        id: "https___www_sitecore_com",
        source_id: "407033",
        title: "Modernize your digital presence",
        entity_type: "content",
        entity_subtype: "article"
      }
    ]
   }
  }
};
```

You can send this event by passing the object to the `pageView` function:

::::tabs
:::tab{title="Browser module"}

```typescript
// ...
pageView(eventData);
// ...
```

:::
:::tab{title="Server module"}

```typescript
// ...
await pageView(request, eventData);
// ...
```

:::
::::

For this event data object, the following payload is sent to Sitecore:

```json
{
  "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-08-29T13:`48:03`.188Z",
  "sc_search": {
    "data": {
      "value": {
        "context": {
          "page": {
            "uri": "https://www.sitecore.com"
          }
        },
        "entities": [
          {
            "id": "https___www_sitecore_com",
            "source_id": "407033",
            "title": "Modernize your digital presence",
            "entity_type": "content",
            "entity_subtype": "article"
          }
        ]
      }
    },
    "metadata": {
      "ut_api_version": "1.0"
    }
  },
  "type": "VIEW"
}
```