> ## Documentation Index
> Fetch the complete documentation index at: https://docs.datalyr.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Session replay

> Record website sessions with typed input masked, ask the agent why visitors left, and know what it costs and how long it's kept.

Session replay records what visitors do on your website, with every form value masked
and page text masked wherever you choose. You can watch a session on the **Replays** page, or ask the agent why visitors
from one campaign left before checkout.

## What you get

| Part              | What it is                                                                                                                                                                                                      |
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Recordings        | Clicks, scrolls, page changes, and layout for each recorded session. You play them on the **Replays** page.                                                                                                     |
| Session summaries | A short written account of each session: landing page, source and campaign, pages viewed, how far the visitor got, and friction such as rage clicks, dead clicks, JavaScript errors, and abandoned form fields. |
| Agent answers     | The agent filters sessions and reads their summaries. See [Ask the agent about sessions](#ask-the-agent-about-sessions).                                                                                        |
| Heatmaps          | Click and scroll heatmaps per page. A separate add-on. See [Pricing](#pricing). The heatmap page follows shortly after launch.                                                                                  |

## Before you start

* Session replay is for websites only. It needs `dl.js` or `@datalyr/web` version 1.8.1 or later.
* The SDK must load its container. Sites that set `enableContainer: false` record nothing.
* You must be a workspace owner or admin.
* A workspace set up as a health or wellness business can't turn it on. See [Health and wellness redaction](/advanced/health-wellness-redaction).

## Turn on session replay

1. Open **Replays**.
2. Turn on session replay and confirm the add-on.
3. Open the settings panel on the **Replays** page to change the sample rate or turn recording off.

Recording starts on the next page load. You don't change your tracking code.

<Note>
  If your site sends a Content Security Policy, allow `https://track.datalyr.com` in
  `script-src` and `https://replay.datalyr.com` in `connect-src`. Without them the
  browser blocks the recorder, and nothing is recorded.
</Note>

## Pricing

| Add-on         | Price                           | Captures                                                     |
| -------------- | ------------------------------- | ------------------------------------------------------------ |
| Session replay | \$5 per 1,000 recorded sessions | Recordings you play back, summaries, and agent answers       |
| Heatmaps       | \$1 per 1,000 sessions          | Clicks and scroll depth only. No recordings and no playback. |

Both add-ons are available on every plan, and neither includes free sessions. Every
session counts. You can buy either one alone, or both.

The sample rate in the settings panel on the **Replays** page sets the share of sessions that get
recorded, from 1% to 100%. A lower rate records fewer sessions and costs less.

## How long data is kept

| Data                                | Kept for |
| ----------------------------------- | -------- |
| Raw recordings (what you play back) | 30 days  |
| Heatmap data                        | 90 days  |
| Session summaries                   | 2 years  |

After 30 days you can't play a session back, but the agent can still read its summary.

## What is and isn't recorded

| Recorded                                                                   | Not recorded                                                                                 |
| -------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| Page layout, clicks, scrolls, page changes, and page text                  | Text inside any element you mark `data-dl-mask`. Stricter text modes are in Replay settings. |
| Page URLs, without the query string                                        | Anything typed into a field. Every input value is masked.                                    |
| Event names you send with `track()`, plus value, currency, and product IDs | Other `track()` properties                                                                   |
| Storefront pages on Shopify: home, collection, product, search, and cart   | Shopify checkout pages. See [Shopify checkout](#shopify-checkout).                           |
|                                                                            | Visitors who opted out, declined consent, or send Do Not Track or Global Privacy Control     |
|                                                                            | Mobile apps                                                                                  |

[Session replay privacy and masking](/advanced/session-replay-privacy) lists every default
and the attributes that change them.

### Shopify checkout

Shopify checkout pages are not recorded. Shopify runs checkout in a sandbox that no
storefront script can see into. A recording ends when the visitor starts checkout.

The summary still says whether the visitor reached checkout and whether the order
completed when the Shopify integration is connected, because those events come from
the Datalyr Shopify pixel and webhooks. It can't show what
happened inside checkout.

### In-app browsers

Sessions in the Instagram and Facebook in-app browsers are recorded. Those browsers can
close without warning, so the last few seconds of a session can be missing.

## Ask the agent about sessions

The agent reads replay data in AI chat and over [MCP](/datalyr-mcp). Two tools do this:

| Tool                   | Returns                                                                                                                                         |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| `list_replay_sessions` | Up to 50 sessions of the last 31 days that match your filters, such as source, campaign, device, rage clicks, or added to cart without checkout |
| `get_replay_summary`   | The written summary of up to 20 sessions                                                                                                        |

Ask questions like these:

* `Why did visitors from my Meta retargeting campaign add to cart but not check out last week?`
* `Show sessions with rage clicks on the cart page.`
* `Which pages throw JavaScript errors right before visitors leave?`

The agent answers from summaries, not by watching video. Open the session on
**Replays** to check what it describes.

## Verify

1. Visit your website in a normal browser window.
2. Click through two or three pages.
3. Close the tab.
4. Wait about 35 minutes. A session appears once its visitor has been inactive for 30 minutes, which is when the SDK closes the session.
5. Open **Replays**.
6. Confirm that your session appears in the list and plays.

## When it does not work

| Symptom                         | Cause                                                                               | Fix                                                                                      |
| ------------------------------- | ----------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| No sessions after 35 minutes    | The site runs `dl.js` older than 1.8.1.                                             | Update `@datalyr/web`, or use the hosted `dl.js`.                                        |
| No sessions after 35 minutes    | The site sets `replay: false` or `enableContainer: false` in `init()`.              | Remove the setting.                                                                      |
| No sessions after 35 minutes    | A Content Security Policy blocks the recorder.                                      | Allow the two hosts in the note under [Turn on session replay](#turn-on-session-replay). |
| Your own visit is missing       | Your browser sends Global Privacy Control or Do Not Track, or you declined consent. | Test in a browser without those signals.                                                 |
| The agent answers `not_enabled` | Session replay is off for this workspace.                                           | Turn it on from **Replays**.                                                             |

## Next

* [Session replay privacy and masking](/advanced/session-replay-privacy): mask or reveal parts of your site, and what to tell shoppers.
* [AI chat](/product/ai-chat): ask the questions above inside Datalyr.
* [Connect Claude or Codex](/datalyr-mcp): ask them from your own AI client.
