Installation
Install Session Replay through the Ours Privacy Web SDK or Tag Manager.
Installation
Session Replay must first be enabled by your account team. Once enabled, you can install it two ways.
Prerequisites
- Session Replay is enabled on your account. Contact your account representative to provision it.
- Your domain is whitelisted. Add the site domain that will run Session Replay to the allowed-domains list in the dashboard.
- (Recommended) Custom domain configured. Loading Session Replay from a first-party domain gives you stronger first-party trust and is required for some compliance configurations.
Option 1 — Ours Privacy Web SDK (recommended)
If you already use the Ours Privacy Web SDK, enable Session Replay by adding a session_replay config block to your init call:
ours('init', '{cdp_token}', {
session_replay: {
token: 'replay_token',
mask_all_text: true, // optional
sampleRate: 1, // optional, 0.0–1.0 — set to 0 to disable auto-start
alwaysRecordEvents: ['checkout', 'signup'], // optional
// Selector overrides — see Privacy and Masking
block_selector: '.cc-card, [data-private]',
ignore_selector: '.cc-noise',
mask_text_selector: '.cc-pii',
},
});Replace {cdp_token} with your CDP token and replay_token with the Session Replay token from your account team.
The Web SDK takes care of:
- Loading the replay script from your first-party domain
- Wiring event-triggered recording automatically
- Setting
has_session_replayon outgoing events when a session is being recorded
When a replay token is present, the Web SDK starts replay automatically.
See Configuration for the full options reference.
Option 2 — Ours Privacy Tag Manager
You can also load Session Replay through the Ours Privacy Tag Manager by adding the Session Replay script as a tag. This works with any Other Tag Manager we support as well. Configuration mirrors Option 1.
Where Session Replay does not run
Session Replay does not run inside cross-origin iframes (e.g., Shopify Web Pixel sandboxes, ad-tech pixel containers). Install the SDK on the parent frame; same-origin frames are included automatically.
Next steps
- Privacy and masking — protect sensitive content before going live
- Configuration — every supported option
- Sampling and triggers — record only what you care about
How is this guide?