---
title: "Engage.pageView(eventData[, extensionData])"
slug: "engage-pageview"
abstract: "Describes the client-side pageView() function in the Sitecore Engage SDK (Sitecore CDP Stream API)."
---
# Engage.pageView(eventData\[, extensionData\])

> [!note]
> This is a client-side function used for implementing client-side tracking. If you want to implement [server-side tracking](https://doc.sitecore.com/cdp/en/developers/api/stream-api/sitecore-engage-sdk-reference/functions/server-side-tracking-with-the-engage-sdk-package.html "Server-side tracking with the Engage SDK package") instead, use the [server-side functions](https://doc.sitecore.com/cdp/en/developers/api/stream-api/sitecore-engage-sdk-reference/functions/sending-events-using-the-engage-sdk.html "Sending events using the Engage SDK").

The `pageView()` function sends a VIEW event. The VIEW event triggers every time your webpage loads. You should send a VIEW event from every webpage that you want to track on your website.

sidebar. Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| [`eventData`](https://doc.sitecore.com/cdp/en/developers/api/stream-api/sitecore-engage-sdk-reference/functions/view-event.html) | object | All the event data. |
| [`[extensionData]`](https://doc.sitecore.com/cdp/en/developers/api/stream-api/sitecore-engage-sdk-reference/functions/extension-data-object.html)<br><br>optional | object | Custom data about an event.<br><br>Maximum 50 custom attributes of your choice. |

Here's an example of how to use the `pageView()` function. In a React app, call this function in an Effect Hook.

```javascript
import { engage } from "./engage.js";
// ...

useEffect(() => {
  if (engage !== undefined) {
      sendPageViewEvent();
  };
}, []);

const sendPageViewEvent = async () => {
  const eventData = {
    channel: "WEB",
    currency: "EUR",
    pointOfSale: "myretailsite/ireland",
    language: "EN",
    page: "home",
    pageVariantId: "351"
  };

  const extensionData = {
    customKey: "customValue"
  };

  await engage.pageView(eventData, extensionData);
};

```