---
title: Custom Page Events - Web
description: A page event or a custom page event is a value (an element or an event) triggered during a session on a specific page
lastUpdated: 11 March 2026
source_url:
  html: https://docs.contentsquare.com/en/web/custom-page-events/
  md: https://docs.contentsquare.com/en/web/custom-page-events/index.md
---

## General principles

### Use

Custom page events are additional information on the session that can be used to segment sessions. Similar to dynamic vars, custom page events can be sent at any time during a session. Custom pages events are used when we want to segment based on a specific visitor (`action` or `onload`) event.

They are as flexible as anything you can do with JavaScript on a web page. For instance, VoC events triggered (3 stars only, smiley face emoji…), specific messages and validation errors and even things like if page took more than x seconds to load, visitor’s status, such as **"is the user logged in?"**,option selected in drop-down menu. And many more..., up to your imagination.

Furthermore, it can also be used as a trigger for Event Triggered Replay (ETR) where the full user session or specific pageview is collected.

### Limits

* It is possible to save up to 40 page events per pageview. If more are received, only the first 40 will be kept.
* The maximum size is 255 characters.

## Contentsquare Tag Configurator (CSTC)

Use the [Contentsquare Tag Configurator ↗](https://support.contentsquare.com/hc/en-us/articles/37271705463185-CSTC-Template-Page-Event) to implement page events through a visual interface.

## Google Tag Manager (Template)

1. Open your container and go to the **templates** section. ![](https://docs.contentsquare.com/_astro/main-1.BR8xO2Cv_Z1Rabw1.webp)

2. Select **Search Gallery**. ![](https://docs.contentsquare.com/_astro/main-2.CDPvDirB_Z1usb2F.webp)

3. Type in **`contentsquare`** and select the **Contentsquare - Page Events** option. ![](https://docs.contentsquare.com/_astro/add-page-events-select.DgSchWv3_2jrr6X.webp)

4. Click **Add to workspace**. ![](https://docs.contentsquare.com/_astro/add-page-events.BpgltVE4_19wCc0.webp)

5. Confirm your choice by selecting **Add** ![](https://docs.contentsquare.com/_astro/add-page-events-confirm.g5yfF37j_2gbVAu.webp)

6. Go to the Tags section and click the **New** button to create a new tag. ![](https://docs.contentsquare.com/_astro/add-tag.DuGAskV4_1e0yKr.webp)

7. Configure it by selecting the top-right button. ![](https://docs.contentsquare.com/_astro/tag-config.krkkPQIC_19Jyy1.webp)

8. Search for **`contentsquare`** and select the **Contentsquare - Page Events** template that you've previously added to your container. ![](https://docs.contentsquare.com/_astro/new-page-events.CC7-Kvea_ZftENt.webp)

9. Give a title to the tag and input your Tag ID in the dedicated field.

10. Enter the event name.

11. (Optional) If needed, add additional page events.

    ![](https://docs.contentsquare.com/_astro/page-events.DssBmZ4h_Z1NkNUQ.webp)

12. Select the trigger.

13. Save your changes and go back to your container. You should now see both the template and the newly created tag. ![](https://docs.contentsquare.com/_astro/main-7.BAnsQ6tT_1HroSA.webp)

## Adobe Launch

Prerequisite

You have installed the [Contentsquare extension](https://docs.contentsquare.com/en/web/#installing-the-contentsquare-extension).

1. Within Tag properties, select **Rules** > **Add Rule**.

2. Specify a name, events, and conditions.

3. Add an Action with the following settings:

   * Extension: `Contentsquare`,
   * Action Type: `Page Events`,
   * Name: `Contentsquare - Page Event`.

4. On the right-hand side, enter the event name.

   ![](https://docs.contentsquare.com/_astro/page-events.Bl2oAZt7_sFKwi.webp)

5. Select **Keep Changes** > **Save**.

## Custom HTML

### Defining page Event

To define a page Event which will be automatically sent right away, use the `trackPageEvent` command:

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

For example, here's how to collect a click event:

```javascript
window._uxa = window._uxa || [];
window._uxa.push(["trackPageEvent", "SubscribedToPropertyButtonClick"]);
```

Or how to collect a user identifier to filter Session Replays, with the `@user-identifier@` prefix:

Note

This feature is part of [Experience Monitoring ↗](https://contentsquare.com/platform/experience-monitoring/), which is only available on Enterprise plans or as an add-on to Pro plans. Contact your Customer Success Manager or [sales ↗](https://contentsquare.com/request-a-demo/) to learn more.

```html
<script type="text/javascript">
  window._uxa = window._uxa || [];
  window._uxa.push(["trackPageEvent", "@user-identifier@USER_IDENTIFIER"]);
</script>
```

[See User Identifiers](https://docs.contentsquare.com/en/web/personal-data-handling/#user-identifier-implementation)

## Verifying the sending of page events

Our [Contentsquare Tracking Setup Assistant Chrome Extension ↗](https://chrome.google.com/webstore/detail/contentsquare-tracking-se/pfldcnnaiaiaogmpfdjjpdkpnigplfca) displays each page event sent.

### Inspecting the payload

If you can't use our Chrome extension, use the [`_cs_debug`](https://docs.contentsquare.com/en/web/cookies/#_cs_debug) cookie.

1. From the browser console, run this command to create the cookie:

   ```plaintext
   document.cookie = "_cs_debug=compressionDisabled"
   ```

   Note

   Sessions collected with the `compressionDisabled` flag on are filtered out from the Session Replay pipeline.

2. Reload the page.

3. In the Network tab, search for `pageEvent`, select the request, and check the value of the `value` parameter.

### Checking the requests

To check the actual request that is sent for transactions, follow GET requests sent to `//c.contentsquare.net/pageEvent`, with these parameters.

| Name | Description | Type |
| - | - | - |
| `value` | Page Event (compressed) | String |
| `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 |
| `sn` | Session number | Integer |
| `isETR` | Identifies the page Event has ETR or not | Boolean |
| `v` | Tracking tag version | String |
