> For the complete documentation index, see [llms.txt](https://docs.chord.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chord.co/activate/event-streaming/destinations/analytics/contentsquare.md).

# Contentsquare

Contentsquare (formerly Hotjar) is a digital experience analytics platform that automatically captures user behavior, including heatmaps, session recordings, frustration signals and journey analysis, directly in the browser. This destination loads the Contentsquare SDK automatically. Once loaded, the SDK handles all behavior tracking on its own. Chord also tells Contentsquare about single-page-app route changes, and can forward custom event properties as [dynamic variables](https://docs.contentsquare.com/en/web/sending-dynamic-vars/) for session segmentation.

## Getting started

This is a browser destination. Chord loads the Contentsquare script for you, so you don't need to install it yourself. You need one value:

* **Site ID**: your Contentsquare site ID, found in your Contentsquare account settings.

## Settings

* **Destination Name** (required): a name to tell this destination apart.
* **Contentsquare Site ID** (required): your Contentsquare (Hotjar) Site ID. Find it in your Contentsquare dashboard under **Get started > Tag installation**. Copy just the code between the final `/` and `.js`. For example, if the script tag is `<script src="https://t.contentsquare.net/uxa/d44639f32ad91.js"></script>`, enter `d44639f32ad91`.
* **Dynamic Variable** (optional): forwards event properties to Contentsquare as [dynamic variables](https://docs.contentsquare.com/en/web/sending-dynamic-vars/). They are sent on every `page` event and can be used to segment sessions in Contentsquare. Each entry has a **Source Property** and a **Contentsquare Key**. See [Dynamic variables](#dynamic-variables).
* **Consent Requirements** (optional): the consent categories a visitor must accept before Chord sends data to this destination. See [Consent](/activate/event-streaming/consent.md).

## Connect

Add **Contentsquare (Hotjar)** from the destination catalog, using the settings above. See [Connect a destination](/activate/event-streaming/connect-a-destination.md) for the full steps.

## Events

**Page events**

On every `page` event the destination does two things:

1. **Notifies Contentsquare of the route change.** On single-page-app navigations (any `page` event after the first event Chord handles on a page load), it pushes `trackPageview` with the page path (`properties.path`, or `context.page.path` if there isn't one) so Contentsquare registers each route change as a distinct pageview. On traditional multi-page sites, the Contentsquare SDK captures the initial pageview itself, so the explicit call is skipped to avoid double-counting.
2. **Forwards dynamic variables.** If dynamic variables are configured, it resolves each mapped source property from the event and pushes a `trackDynamicVariable` call for each non-empty value.

**Track and identify events**

Track and identify events are not forwarded. The Contentsquare SDK handles behavior capture on its own once loaded.

## Custom events

Custom events are not forwarded. Contentsquare's script captures behavior on its own.

## Dynamic variables

Dynamic variables let you attach event properties to each pageview so you can segment sessions in Contentsquare, for example to filter heatmaps by `page_type` or `customer_type`.

To set them up, open the destination in Chord and add rows to the **Dynamic Variable** table:

| Field                 | Description                                                                                       |
| --------------------- | ------------------------------------------------------------------------------------------------- |
| **Source Property**   | Dot-notation path to the property in your Chord `page` event (for example `properties.page_name`) |
| **Contentsquare Key** | The variable name Contentsquare will receive (for example `page_name`)                            |

Example storefront call:

```js
chord.page({
  page_name: 'Home',
  page_type: 'storefront',
  customer_type: 'guest'
})
```

With that call, set the source paths to `properties.page_name`, `properties.page_type` and `properties.customer_type`.

Contentsquare supports up to 40 distinct dynamic variables per pageview. Variables with empty or missing values are silently skipped.

## Initialization

On the first event of any type, the destination loads `https://t.contentsquare.net/uxa/{siteId}.js`. It tracks SDK loading state (`fresh`, `loading`, then `loaded` or `failed`) to prevent duplicate script loads. If the script fails to load, a warning is logged and no further load attempts are made.

## CSP requirements

If your site uses a Content Security Policy, allow the following domains:

| Directive     | Domain                        |
| ------------- | ----------------------------- |
| `script-src`  | `https://t.contentsquare.net` |
| `connect-src` | `https://t.contentsquare.net` |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.chord.co/activate/event-streaming/destinations/analytics/contentsquare.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
