WysLeap
Documentation

Onboarding Guide

Get from zero to live analytics in minutes — installation, custom events, SaaS metrics, AI observability, and session replay.

Session Replay

Record and replay user sessions to understand behavior, debug issues, and improve UX. Session replay is enabled by default.

How It Works

  • Event-based recording (not video) for smaller data footprint
  • DOM snapshots + mouse movements + clicks + scrolls + form inputs
  • Pixel-perfect replay of user interactions
  • GDPR compliant with automatic sensitive data masking

Basic Configuration

Session replay is enabled by default. You can customize settings in your init code:

html
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)
    }
  }
});

Privacy & Data Masking

Automatic Sensitive Data Masking

When maskSensitive: true, these fields are automatically masked:

  • Password inputs (type="password")
  • Email inputs (type="email")
  • Credit card inputs (detected by pattern)
  • Any input with data-wysleap-mask attribute

Custom Masking

Add data-wysleap-mask to any element to mask its content:

html
<!-- Mask sensitive text content -->
<div data-wysleap-mask>
  User's SSN: 123-45-6789
</div>

<!-- Mask input field -->
<input type="text" data-wysleap-mask placeholder="API Key" />

<!-- Mask entire section -->
<section data-wysleap-mask>
  <!-- Everything inside will be masked -->
</section>

Sampling (Reduce Costs)

Record a fraction of sessions to reduce data usage and costs:

html
sessionReplay: {
  enabled: true,
  sampleRate: 0.5  // Record 50% of sessions
}

Note: Sampling is deterministic per session (same visitor always gets same decision).

Recording Controls

Toggle which event types are recorded. Disabling event types you don't need reduces data volume and storage costs.

html
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)
}

Default Behavior

  • recordMousemove is offby default — mouse movements are the largest event category (~60-70% of replay data) and aren't needed for most click/scroll/funnel analysis. Enable it if you need mouse trail replay.
  • All other event types are on by default. The full page is recorded unless you opt into element-level scoping (see next section).

Element-Level Scoping (Advanced, optional)

By default, WysLeap records the entire page. If you need to limit recording to a specific flow — for example, only capture 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.

html
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 — check DevTools if your replays look empty.

Viewing Session Replays

Once session replay is enabled, you can view recordings in your analytics dashboard:

  1. Navigate to Analytics Dashboard
  2. Click on any visitor or session
  3. Click "Watch Replay" to see the full session recording

Need Advanced Configuration?

Learn about advanced settings, custom identifiers, and more configuration options.

Next: Advanced Config