Documentation
Visit Replay & Real User Monitoring (RUM)
Visit Replay is TrynShop's lightweight observability platform. It records high-fidelity DOM session replays, JavaScript exceptions, network latency, and custom Virtual Try-On telemetry with strict privacy masking and zero page performance degradation.
Accurate DOM Replay
Reconstructs DOM mutations with millisecond fidelity, variable playback speeds (1x to 8x), and automatic skipping of inactive periods.
Client-Side Privacy Masking
All passwords, credit card fields, and text inputs are masked before leaving the browser. Custom classes allow selective masking and blocking.
Diagnostics & DevTools
Captures runtime JS errors with stack traces, unhandled promise rejections, console logs, and network fetch/XHR response codes and latency.
How recording works
Rather than streaming heavy video files (like MP4 or WebM), Visit Replay captures DOM mutations, user input events, and scroll positions as lightweight structured streams.
┌───────────────────────────────────────────────────────────┐
│ Customer Browser / App │
├───────────────────────────────────────────────────────────┤
│ 1. Initial Snapshot --> Full DOM structure & CSS snapshot│
│ 2. Incremental Diffs --> Mouse moves, clicks, scroll │
│ 3. Privacy Masking --> Passwords & sensitive data (***) │
│ 4. Diagnostics --> JS errors, network latency, logs │
│ 5. Custom Events --> VTO opened, GLB loaded, cart │
└─────────────────────────────┬─────────────────────────────┘
│ (Gzip batches every 5s / beacon)
▼
POST /v1/ingest (replay-ingestion)- Initial Structural Snapshot: Takes a full DOM tree snapshot once on initial page load.
- Incremental Delta Diffs: Only records small mutation changes, mouse coordinates, and clicks.
- Zero Client Latency: Events buffer in memory and flush asynchronously every 5 seconds or on page unload via
navigator.sendBeacon.
Supported platforms
Shopify
Install the official Shopify App and enable the Theme App Extension block in the Theme Editor.
WordPress / WooCommerce
Add the single-line embed tag or use the TrynShop WordPress plugin with zero configuration.
Custom & Headless
Use the @trynshop/replay-sdk npm package or CDN script in Hydrogen, Next.js, or Vue.
Privacy & security by default
Protecting customer Personally Identifiable Information (PII) is our top priority. Data masking is executed entirely on the client side before event payloads leave the browser.
Automatic Field Masking
All <input type="password">, email fields, phone inputs, credit card forms, and textareas are masked with asterisks (***) by default.
Admin & Editor Exclusions
WordPress admin panels (/wp-admin, wp-login.php) and Shopify Theme Customizer / design mode frames are excluded automatically by default.
Custom Route Exclusions
Exclude sensitive custom routes (e.g. /checkout, /account/billing) so recording stops entirely on checkout and account pages.
// Mark any sensitive element to mask or block entirely:
<div class="tryn-replay-mask">Customer secret note</div>
<div class="tryn-replay-block">Hidden billing breakdown</div>
Shopify setup
Follow these steps to enable Visit Replay on your Shopify store using the Theme App Extension.
- Install the Visit Replay Session Recorder app from the Shopify App Store.
- Open your Shopify Admin > Online Store > Themes and click Customize.
- Navigate to App embeds in the left sidebar and enable VisitReplay Recorder.
- Adjust optional settings:
- Sampling Rate: 10% to 100% of store sessions (default: 100%).
- Mask Form Inputs: Enabled by default for strict PII protection.
- Exclude URL Paths: Comma-separated paths like
/checkout, /cart/checkout. - Record Network & Errors: Enable DevTools diagnostics.
- Click Save in the theme editor. Sessions will begin appearing in TrynShop Studio immediately.
Web SDK & CDN script setup
For custom web applications, React, Vue, Next.js, or headless Shopify (Hydrogen), integrate via script tag or npm package:
Option A: Single-Line Script Tag
Option B: NPM Package (@trynshop/replay-sdk)
// 1. Install SDK:
npm install @trynshop/replay-sdk
// 2. Initialize in your app root:
import { TrynReplay } from '@trynshop/replay-sdk';
TrynReplay.init({
projectKey: 'pk_live_your_store_key',
samplingRate: 1.0,
maskAllInputs: true,
recordNetwork: true,
recordConsoleErrors: true,
excludePaths: ['/checkout', '/admin'],
});Custom event telemetry
Track custom user actions and Virtual Try-On interactions on your timeline to diagnose drop-offs and feature engagement:
// Track Virtual Try-On events
TrynReplay.track('vto_opened', { productId: 'frame_123', mode: '3d_live' });
TrynReplay.track('camera_permission_granted', { platform: 'ios_safari' });
TrynReplay.track('glb_loaded', { durationMs: 420, modelSizeKb: 1250 });
// Identify logged-in customer (optional)
TrynReplay.identify('usr_99882', {
tier: 'VIP',
prescriptionsCount: 2,
});Diagnostics & replay player
The TrynShop Studio Replay Player provides a unified session intelligence workspace to inspect sessions:
- Interactive Timeline Scrubber: Clickable timeline markers for clicks, route changes, errors, and custom events.
- Variable Speed & Skip Inactive: Playback at 1x, 2x, 4x, or 8x speed while automatically fast-forwarding through idle time.
- DevTools Console Drawer: Inspect exact console errors, stack traces, and network API responses side-by-side with the replay.
Storage & cost-effective architecture
Visit Replay uses a two-tier storage architecture designed to keep infrastructure costs negligible even at scale:
Fast Relational Index (2% of data)
PostgreSQL stores indexed metadata (duration, device, OS, geo IP, error counts) for millisecond search and filtering.
Cloudflare R2 Object Storage (98% of data)
Gzip-compressed event chunks stored with zero egress bandwidth charges, making high replay volumes extremely cost-effective.