# Rebuild and restart a specific service
# Example: ./rebuild op-dashboard
```
Troubleshooting [#troubleshooting]
```bash
./danger_wipe_everything # ⚠️ Removes all containers, volumes, and data
# Only use this if you want to start fresh!
```
The `danger_wipe_everything` script will delete all your Actually Tracking data including databases, configurations, and cached files. Use with extreme caution!
All these scripts should be run from within the `self-hosting` directory. Make sure the scripts are executable (`chmod +x script-name` if needed).
Updating [#updating]
To grab the latest and greatest from Actually Tracking you should just run the `./update` script inside the self-hosting folder.
If you don't have the `./update` script, you can run `git pull` and then `./update`
Also read any changes in the [changelog](/docs/self-hosting/changelog) and apply them to your instance.
---
## Session Replay
URL: https://actuallytracking.com/docs/session-replay
Session replay captures a structured recording of what users do in your app or website. You can replay any session to see which elements were clicked, how forms were filled, and where users ran into friction—without guessing.
Session replay is **not enabled by default**. You explicitly opt in per-project. When disabled, the replay script is never downloaded, keeping your analytics bundle lean.
How it works [#how-it-works]
Actually Tracking session replay is built on [rrweb](https://www.rrweb.io/), an open-source library for recording and replaying web sessions. It captures DOM mutations, mouse movements, scroll positions, and interactions as structured data—not video.
The replay module is loaded **asynchronously** as a separate script (`op1-replay.js`). This means:
* Your main tracking script (`op1.js`) stays lightweight even when replay is disabled
* The replay module is only downloaded for sessions that are actually recorded
* No impact on page load performance when replay is turned off
Limits & retention [#limits--retention]
* **Unlimited replays** — no cap on the number of sessions recorded
* **30-day retention** — replays are stored and accessible for 30 days
Setup [#setup]
Script tag [#script-tag]
Add `sessionReplay` to your `init` call. The replay script loads automatically from the same CDN as the main script.
```html title="index.html"
```
NPM package [#npm-package]
```ts title="op.ts"
import { ActuallyTracking } from '@actually-tracking/web';
const op = new ActuallyTracking({
clientId: 'YOUR_CLIENT_ID',
trackScreenViews: true,
sessionReplay: {
enabled: true,
},
});
```
With the npm package, the replay module is a dynamic import code-split by your bundler. It is never included in your main bundle when session replay is disabled.
Options [#options]
| Option | Type | Default | Description |
| -------------------- | --------- | -------------------------------------- | ------------------------------------------------------------------------------------ |
| `enabled` | `boolean` | `false` | Enable session replay recording |
| `maskAllInputs` | `boolean` | `true` | Mask all input field values |
| `maskAllText` | `boolean` | `true` | Mask all text content in the recording |
| `unmaskTextSelector` | `string` | — | CSS selector for elements whose text should NOT be masked when `maskAllText` is true |
| `blockSelector` | `string` | `[data-actuallytracking-replay-block]` | CSS selector for elements to replace with a placeholder |
| `blockClass` | `string` | — | Class name that blocks elements from being recorded |
| `ignoreSelector` | `string` | — | CSS selector for elements excluded from interaction tracking |
| `flushIntervalMs` | `number` | `10000` | How often (ms) recorded events are sent to the server |
| `maxEventsPerChunk` | `number` | `200` | Maximum number of events per payload chunk |
| `maxPayloadBytes` | `number` | `1048576` | Maximum payload size in bytes (1 MB) |
| `scriptUrl` | `string` | — | Custom URL for the replay script (script-tag builds only) |
Privacy controls [#privacy-controls]
Session replay captures user interactions. All text and inputs are masked by default — sensitive content is replaced with `***` before it ever leaves the browser.
Text masking (default on) [#text-masking-default-on]
All text content is masked by default (`maskAllText: true`). This means visible page text, labels, and content are replaced with `***` in replays, in addition to input fields.
This is the safest default for GDPR compliance since replays cannot incidentally capture names, emails, or other personal data visible on the page.
Selectively unmasking text [#selectively-unmasking-text]
If your pages display non-sensitive content you want visible in replays, use `unmaskTextSelector` to opt specific elements out of masking:
```ts
sessionReplay: {
enabled: true,
unmaskTextSelector: '[data-actuallytracking-unmask]',
}
```
```html
Product Analytics
Welcome to the dashboard
John Doe · john@example.com
```
You can also use any CSS selector to target elements by class, tag, or attribute:
```ts
sessionReplay: {
enabled: true,
unmaskTextSelector: '.replay-safe, nav, footer',
}
```
Disabling full text masking [#disabling-full-text-masking]
If you want to disable full text masking and return to selector-based masking, set `maskAllText: false`. In this mode only elements with `data-actuallytracking-replay-mask` are masked:
```ts
sessionReplay: {
enabled: true,
maskAllText: false,
}
```
```html
This will be masked
This will be visible in replays
```
Only disable `maskAllText` if you are confident your pages do not display personal data, or if you are masking all sensitive elements individually. You are responsible for ensuring your use of session replay complies with applicable privacy law.
Blocking elements [#blocking-elements]
Elements matched by `blockSelector` or `blockClass` are replaced with a same-size grey placeholder in the replay. The element and all its children are never recorded.
```html
This section won't appear in replays at all
```
Or with a custom selector:
```ts
sessionReplay: {
enabled: true,
blockSelector: '.payment-form, .user-avatar',
blockClass: 'no-replay',
}
```
Ignoring interactions [#ignoring-interactions]
Use `ignoreSelector` to exclude specific elements from interaction tracking. The element remains visible in the replay but clicks and input events on it are not recorded.
```ts
sessionReplay: {
enabled: true,
ignoreSelector: '.debug-panel',
}
```
Self-hosting [#self-hosting]
If you self-host Actually Tracking, the replay script is served from your instance automatically. You can also override the script URL if you host it separately:
```ts
sessionReplay: {
enabled: true,
scriptUrl: 'https://your-cdn.example.com/op1-replay.js',
}
```
Related [#related]
* [Session tracking](/features/session-tracking) — understand sessions without full replay
* [Session replay feature overview](/features/session-replay) — what you get with session replay
* [Web SDK](/docs/sdks/web) — full web SDK reference
* [Script tag](/docs/sdks/script) — using Actually Tracking via a script tag