Documentation
Onboarding guide
Get from zero to live analytics in minutes: installation, custom events, SaaS metrics, AI observability, and session replay.
Onboarding guide
Record and replay user sessions to understand behavior, debug issues, and improve UX. Session replay is off by default. Turn it on with sessionReplay.enabled: true.
Session replay is off by default. Turn it on and customize it in your init code:
WysLeap.init({
siteId: 'your-site-id',
options: {
_apiKey: 'your-api-key',
sessionReplay: {
enabled: true, // Enable/disable session replay
maskSensitive: true, // Auto-mask passwords, emails, etc.
sampleRate: 0.5 // Record 50% of sessions (default: 1.0, all)
}
}
});When maskSensitive: true, (the default), recordings mask:
class="sensitive", data-sensitive or data-privateMark any element whose text should be masked with data-sensitive, data-private or class="sensitive". To leave an element out of recordings entirely, add class="rr-block".
<!-- Mask sensitive text content -->
<div data-sensitive>
User's SSN: 123-45-6789
</div>
<!-- Inputs are always masked while maskSensitive is on (the default) -->
<input type="text" placeholder="API Key" />
<!-- Leave an entire section out of the recording -->
<section class="rr-block">
<!-- Not recorded; shown as a placeholder in replays -->
</section>Text masking only applies while maskSensitive is on. If you set maskSensitive: false, inputs and marked text are recorded as-is.
Record a fraction of sessions to reduce data usage and costs:
sessionReplay: {
enabled: true,
sampleRate: 0.5 // Record 50% of sessions
}Note: Sampling is deterministic per session (same visitor always gets same decision).
Toggle which event types are recorded. Disabling event types you don't need reduces data volume and storage costs.
sessionReplay: {
enabled: true,
// Event-type toggles
recordMousemove: false, // Mouse movement tracking (default: off)
recordClick: true, // Click events (default: on)
recordScroll: true, // Scroll events (default: on)
recordInput: true, // Form input changes (default: on)
recordMedia: true, // Media element events (default: on)
}By default, WysLeap records the entire page. If you need to limit recording to a specific flow (for example, only capturing interactions inside a checkout form for compliance reasons), you can pass an allowlist of CSS selectors to recordElement.
recordElement is an allowlist, not a filter.
When set, the recorder captures only DOM mutations inside the matching elements. Everything outside is dropped, including the rest of the page's content. If your selectors don't match any elements on a given page, the replay for that page will be blank. Leave this unset (or use []) to record the entire page. That's the right choice for almost all customers.
sessionReplay: {
enabled: true,
// Default: record the full page (omit or leave empty)
recordElement: [],
// Advanced: scope recording to specific elements only.
// Use this ONLY when you need to limit replays to a specific flow
// (e.g., a checkout form) for privacy or compliance reasons.
// Anything outside these selectors will NOT appear in the replay.
// recordElement: ['#checkout-form', '.payment-section'],
}When recordElement is set but matches zero elements on a page, WysLeap will log a warning to the browser console naming the selectors, so check DevTools if your replays look empty.
Once session replay is enabled, you can view recordings in your analytics dashboard:
Learn about privacy and consent settings, sampling, and more configuration options.