---
title: Sending pageviews - Web
description: Send natural and artificial pageviews from your web page
lastUpdated: 12 December 2025
source_url:
  html: https://docs.contentsquare.com/en/web/sending-pageviews/
  md: https://docs.contentsquare.com/en/web/sending-pageviews/index.md
---

**Reminder:** ー A **pageview** is when a web user visits a page (sometimes called "hit" or "pagehit"). Notably, it automatically contains the current URL of the page, the screen size, the window size and the size of the document.

## How pageviews are sent

Two instructions can be responsible for the launch of a pageview.

### Natural pageview

A pageview is automatically and compulsorily sent when the main tag has loaded. It is not possible to prevent this sending but it is possible to modify the sent URL. Note that the URL which is sent does not include the hash (meaning the elements appearing after the `#`).

[Modify the sent URL](#modifying-the-sent-url)

### Artificial pageview

A JavaScript instruction can be executed to send an artificial pageview via the `trackPageview` command. Use this command when the page changes without provoking a full reload, meaning a new loading of the main tag:

* AJAX loading,
* Popin opening,
* Tabs changing,...

## Sending a natural pageview

You just have to load the main tag.

[Learn more about the main tag...](https://docs.contentsquare.com/en/web/#custom-html)

## Sending an artificial pageview

See [Artificial pageviews](https://docs.contentsquare.com/en/web/artificial-pageviews/#custom-html).

## Modifying the sent URL

Contentsquare provides commands to modify the URL to be sent automatically by the Tag. Use cases include passing information after the '#' sign, or removing Personal Data.

Personal Data and URLs

For a checklist on Personal Data in URLs, jump to the [dedicated section](https://docs.contentsquare.com/en/web/personal-data-handling/#blocking-personal-data-in-urls).

### Modifying the path

To override the path, use the `setPath` command:

```html
<script type="text/javascript">
  window._uxa = window._uxa || [];
  window._uxa.push(['setPath', <PATH_TO_SEND>]);
</script>
```

The domain will be automatically added before, and the query after.

Note

For a natural pageview, make sure to use it **before calling the tag** so the new value is set before the pageview is triggered.

#### Recommendations and limits

* The value passed should be 255 characters maximum.

* Do not add "#", since **fragments** are considered to be anchors and **all that comes after will be erased in the Contentsquare pipeline**.

* Don't use this command to push query parameters. If you do and the initial URL already has query parameters, you will end up having a badly formed URL:

  * Initial URL: `https://www.domain.com/path?initial=1`
  * Sent URL: `https://www.domain.com/overridenPath?overriden=0?initial=1`

#### Example

Let's take the example of a Single Page Application that is using the **fragment** instead of the **path** to define the page identifier:

* The initial URL of the page is: `https://www.domain.com/en#dynamic-app-path/in-the-fragment?query=param`
* The URL inserted in the Contentsquare database would be: `https://www.domain.com/en`
* To fix that, we need to replace the `#` by something else (`/__`): `window._uxa.push(['setPath', window.location.pathname + window.location.hash.replace('#','/__')]);`
* Resulting URL: `https://www.domain.com/en/__dynamic-app-path/in-the-fragment?query=param`

### Modifying the query parameters

To override the query parameters, use the following command:

```html
<script type="text/javascript">
  window._uxa = window._uxa || [];
  window._uxa.push(['setQuery', <QUERY_PARAMETERS_TO_SEND>]);
</script>
```

The domain and path will be automatically added before.

Note

For a natural pageview, make sure to use it **before calling the tag** so the new value is set before the pageview is triggered.

#### Recommendations and limits

* The value passed should be 255 characters maximum.
* Do not add "#", since **fragments** are considered to be anchors and **all that comes after will be erased in the Contentsquare pipeline**.

#### Example

Let's take the example of a page that could be loaded with a popin displayed and we want to be able to identify it:

* The initial URL of the page is: `https://www.domain.com/mypage?existingQueryParam=all`
* Using `setQuery`: `window._uxa.push(['setQuery', window.location.search + '&cookies-popin=true']);`
* Resulting URL: `https://www.domain.com/mypage?existingQueryParam=all&cookies-popin=true`

## Verifying the sending of pageviews

The [Contentsquare Tracking Setup Assistant Chrome Extension ↗](https://chrome.google.com/webstore/detail/contentsquare-tracking-se/pfldcnnaiaiaogmpfdjjpdkpnigplfca) will display each pageview sent with its URL and Custom vars.

### Checking the requests

To check the actual request that is sent, follow GET requests sent to `//c.contentsquare.net/pageview`, with these query parameters:

| Name | Description | Type |
| - | - | - |
| `url` | Page URL | String |
| `cvarp` | Custom vars defined for this page | JSON — **optional** |
| `pid` | Project ID | Integer |
| `r` | A random digit to avoid request caching | Integer |
| `uu` | Unique user ID | String |
| `pn` | Page number (each pageview increments of 1) | Integer |
| `lv` | Last visit | Timestamp |
| `hd` | Hit Date | Timestamp |
| `lhd` | Last hit date | Timestamp |
| `sn` | Session number | Integer |
| `re` | Collection | 1 (standard), 3 (replay) or 5 (triggered replay) |
| `dw` | Document width | Integer |
| `dh` | Document height | Integer |
| `la` | User's browser language | String |
| `dr` | Previous page URL (referrer) | String |
| `sw` | Screen width | Integer |
| `sh` | Screen height | Integer |
| `ww` | Window width | Integer |
| `wh` | Window height | Integer |
| `cvars` | Session's custom vars | JSON — **optional** |
| `cvaru` | User's custom vars | JSON — **optional** |
| `v` | UXA tag's number of versions | String |
| `pvt` | Pageview type | "a" (artificial), "r" (renewal), or "n" (natural) |
| `ex` | Indicates if the pageview can be included in a replay | SR (not included) or empty (can be included) |
| `uc` | User Consent | 0 (Not required), 1 (Not expressed), 2 (Granted) or 3 (Withdrawn) |
| `uxt` | Ongoing UXT tests, where required | JSON — **optional** |
| `uxtv` | Testing tag version, where required | String — **optional** |
