Fundamentals
What Is DOM Session Replay and How It Differs from Screen Video
Published November 13, 2026 · 6 min read
DOM session replay records serialized HTML structure and incremental page events instead of pixel video streams, keeping payloads compact while preserving sharp text and interaction timelines.
Why session replay is not screen video
When store owners first hear the term session replay, they often picture a continuous video recording of a shopper’s screen. In practice, modern web session replay tools do not record video frames or capture camera feeds. Instead, SessionLens uses an open-source DOM serialization approach (powered by rrweb) that records the structure of the webpage and the sequence of browser events that happen inside the tab.
When a visitor lands on your storefront, the tracker takes an initial snapshot of the Document Object Model (DOM) and thereafter records only incremental changes: DOM mutations, mouse coordinates, clicks, scroll positions, viewport resizes, and masked form interactions. Those events are compressed and sent in small batches to the server. When you open a recording in the dashboard, the player reconstructs the page state along an interactive timeline.
Because the player rebuilds the actual HTML and CSS structure rather than decoding compressed video frames, text remains sharp at any zoom level and you can inspect the exact URL path, viewport dimensions, and timestamped event markers alongside the playback.
How the two-stage loader keeps storefront overhead low
Store performance directly affects checkout conversion, so an analytics script must not block rendering. SessionLens uses a two-stage loading architecture. The snippet you place on your site loads /t.js, a small ~600-byte loader cached for 60 seconds. That loader immediately fetches the versioned core script (/t/<hash>.js), which is cached immutably for up to one year.
Because the loader is asynchronous and includes explicit exclusion attributes for common optimization plugins—data-cfasync="false" for Cloudflare Rocket Loader, nowprocket for WP Rocket, and data-no-optimize="1" plus data-no-defer="1" for LiteSpeed Cache and Autoptimize—caching layers do not bundle or delay the script or serve stale versions after an update.
During an active visit, recorded events are buffered in memory and sent every five seconds via POST /api/ingest, or flushed with navigator.sendBeacon when the visitor leaves the page. The server verifies the site key and Origin header, compresses each chunk with gzip, and stores it in PostgreSQL alongside session statistics.
- Playback controls: Play, pause, jump to event markers, and adjust playback speed from 1x to 8x.
- Inactivity skipping: Automatically fast-forward through periods where the visitor left the tab idle.
- Diagnostic tabs: Inspect the Activity timeline, Console error logs, timestamped team Notes, and device Info alongside the replay.
- Sampling support: High-traffic stores can pass data-sample="0.3" on the script tag to record a configurable fraction of visits.
- Setup verification: Append ?sl_debug=1 to your store URL on any device to view an on-screen status bar showing the active session ID and ingest delivery status.
What a session replay reveals that aggregate charts miss
Pageview counters and bounce rates tell you which URL lost visitors, but they rarely explain why the visitor left. Watching five or ten replays of sessions that exited on a product or checkout page turns abstract drop-off percentages into concrete interface fixes.
For example, a replay immediately shows whether a shopper repeatedly clicked a size guide button that failed to open on mobile Safari, scrolled past a shipping notice without seeing it, or encountered a JavaScript error when applying a discount code. Instead of guessing which redesign might improve conversion, your team can fix the exact element that blocked real shoppers.
When you spot an important moment in a recording, you can leave a timestamped note on the timeline, star the session, add custom tags, or generate a share link (/share/:token) so a developer or designer can watch the exact reproduction without needing to hunt through hundreds of visits.
Default privacy safeguards during DOM recording
Because DOM serialization captures page markup, privacy controls must happen in the browser before any payload is transmitted. SessionLens masks form input values by default so passwords, payment fields, and personal details are replaced with asterisks prior to upload.
Site owners can also annotate sensitive page containers with class="sl-block" to replace the entire element with a neutral placeholder box, or class="sl-mask" to mask inline text such as account balances or order addresses. Combined with cookie-free browser storage—keeping the visitor identifier in localStorage and session continuity in sessionStorage—DOM replay gives store teams visual context without setting cross-site tracking cookies.
See your store through your visitors’ eyes
Install the asynchronous SessionLens script in about two minutes. Start on the permanent Free plan with 1,000 monthly recorded sessions—no credit card required.