Prerequisites
Before you begin, ensure you have:- A valid Orgnization ID (contact support@infinitewatch.ai to get one)
Step 1: Set Up Web Insights (For Web Applications)
If you want to generate web insights from your website, start by adding the InfiniteWatch SDK. Choose the guide for your framework:- HTML / CDN — single script tag, no build tools needed
- React —
@infinitewatch/reactprovider component - Next.js —
@infinitewatch/nextfor App Router - Vue.js —
@infinitewatch/vueplugin
Quick Start (HTML)
The simplest way is a single script tag in your HTML<head>:
Replace
YOUR_ORGANIZATION_ID with your actual organization ID. You can find this in your InfiniteWatch dashboard or contact support@infinitewatch.ai.How It Works
Once the SDK is set up, InfiniteWatch will automatically:- Record user sessions and interactions
- Capture DOM events, mouse movements, and clicks
- Generate web insights data
- Send data to your InfiniteWatch dashboard
The script loads asynchronously, so it won’t block your page load. It automatically starts recording when the page loads.
Step 2: Identify Your Users
After the tracker is initialized and recording has started, you can associate sessions with specific users in your system using theidentify() method. This links session recordings and analytics to individual users.
Basic Usage
With Additional User Information
In a Login Flow
What It Does
When you callidentify():
- Links Sessions to Users: Associates the current session with your system’s user identifier
- Persists Identity: The
external_idis stored in a cookie (2-year expiration) and persists across page reloads and sessions - Auto-Collects Metadata: Automatically gathers browser information (user agent, language, screen dimensions, timezone, etc.)
- Enriches Events: All subsequent events will include the
external_idin their payloads
Required Field: The
external_id is required - use a stable identifier from your system (like a database user ID). Optional fields include email, full_name, and custom metadata.Privacy: Only the
external_id is persisted in cookies. Email, full name, and metadata are sent to the API but not stored in browser cookies.Best Practices
- Call Early: Identify users as soon as they’re authenticated to ensure all session data is linked
- Use Stable IDs: Use consistent identifiers (database IDs) rather than temporary values
- Update Anytime: You can call
identify()multiple times to update user information
Step 3: Set Up Your Privacy Settings
InfiniteWatch records DOM content from your pages to generate web insights. You can control exactly what gets captured by adding privacy CSS classes to specific HTML elements. This lets you protect sensitive information while still collecting the data you need.Always apply privacy classes to the specific elements you want to protect — never to the entire page or
<body>. Applying them too broadly will prevent InfiniteWatch from generating useful insights.Mask Sensitive Text (rr-mask)
The rr-mask class replaces all text content within an element (and its children) with masking characters. The element structure and layout remain visible in session replays, but the actual text is hidden.
rr-mask for any element that displays confidential text — names, email addresses, phone numbers, physical addresses, credit card details, affiliations, gender, or similar personal information.
Block Entire Elements (rr-block)
The rr-block class completely prevents an element from being recorded. During replay, a placeholder with the original element’s dimensions is shown instead.
rr-block for sensitive images, videos, embedded third-party content, or entire sections where you want nothing to be recorded at all.
Password Fields (Automatic)
Allinput[type="password"] fields are automatically masked — no additional classes or configuration required. You don’t need to do anything extra to protect password inputs.
Recommendations
- Apply
rr-maskorrr-blockto specific elements, not to your page wrapper or<body> - Use
rr-maskfor fields displaying confidential text (names, phones, addresses, emails, credit cards, affiliations, gender, etc.) - Use
rr-blockfor visual or embedded content you want fully hidden from recordings - Add
rr-blockto any area where users write free-form content — live-chat widgets, review sections (product, hotel, service), comment sections, feedback forms, and support ticket inputs — to keep conversations private and avoid polluting your insights with unrelated text - Password fields are handled automatically — no setup needed
- Test your privacy configuration before deploying to production to make sure the right content is protected
Applying privacy classes to the entire page will block or mask all content, which means InfiniteWatch won’t be able to generate meaningful insights from your sessions. Target only the elements that contain sensitive data.
