---
title: Track Pageviews - WebView
description: Track pageviews in your apps using the Web Tracking Tag
lastUpdated: 09 May 2025
source_url:
  html: https://docs.contentsquare.com/en/webview-tracking-tag/track-pageviews/
  md: https://docs.contentsquare.com/en/webview-tracking-tag/track-pageviews/index.md
---

To aggregate user behavior and engagement at the screen/page level, track page transitions by calling the [`trackPageview`](https://docs.contentsquare.com/en/web/command-reference/#trackpageview) command.

```javascript
window._uxa = window._uxa || [];
window._uxa.push(["trackPageview", "PAGE_TITLE_OR_URL"]);
```

The Tag logs a pageview event that identifies the new page with the page title that you provide.

## Track pageviews differences (with vs without WebView mode)

Tracking Pageviews has different rules depending if the Tag is loaded in WebView mode or not.

### `trackPageview` command differences

| Webview mode | Web context |
| - | - |
| The Tag will not generate any natural pageview, you have to manually track all your screens. | The Tag will generate a natural pageview when loaded. |
| The value you set is the one that will be seen in the Contentsquare platform. | The tag will prepend the value with the domain and append it with the query parameters. |
| If no value (second array element) is provided, no default value will be provided | The tag will set the path as default value |

### Note on pageview tracking in WebView mode

When set in WebView mode, the CS Tag will not trigger [natural pageviews](https://docs.contentsquare.com/en/web/sending-pageviews/#natural-pageview). If you rely on natural pageviews when the page is loaded from a web browser, make sure to use `trackPageview` as the page is fully loaded, as soon as possible.

To do so, use the following code to call the `trackPageview` API as the DOM is ready:

```javascript
document.addEventListener("DOMContentLoaded", function () {
  window._uxa = window._uxa || [];
  window._uxa.push(["trackPageview", "PAGE_TITLE_OR_URL"]);
});
```
