Session Replay

Record DOM sessions with rrweb

Session replay records DOM mutations and user interactions using rrweb. Recordings are serialized events, not video.

Enable Replay

Turn it on with the object form.

<Analytics siteKey="your_site_key" sessionReplays={{ enabled: true }} />
nuxt.config.ts
faststats: {
	siteKey: "your_site_key",
	sessionReplays: { enabled: true },
}
new WebAnalytics({
	siteKey: "your_site_key",
	sessionReplays: { enabled: true },
});

Batching

Replay events are buffered in the browser and uploaded in chunks. The defaults prefer fewer, larger chunks so a normal one-minute replay should usually create single-digit storage objects instead of dozens.

sessionReplays: { enabled: true },
replayOptions: {
	flushInterval: 5_000,
	maxEvents: 1000,
	maxBatchSizeBytes: 512 * 1024,
}

The collector coalesces these small reliable browser flushes into fewer storage objects. The recorder still flushes early on page hide, session rotation, periodic full snapshots, and when a batch reaches the byte limit.

Privacy and Masking

The recorder masks inputs by default and lets you hide elements with replayOptions.

new WebAnalytics({
	siteKey: "your_site_key",
	sessionReplays: { enabled: true },
	replayOptions: {
		maskAllInputs: true,
		maskTextSelector: ".sensitive",
		blockSelector: ".no-record",
	},
});
OptionTypeDescription
maskAllInputsbooleanMasks the value of every input field
maskTextSelectorstringMasks text inside elements matching this selector
maskTextClassstringMasks text inside elements with this class
blockSelectorstringSkips recording elements matching this selector
blockClassstringSkips recording elements with this class
recordConsolebooleanRecords console output during the session

Any element you mark with the block selector is replaced with a placeholder, so its content never leaves the browser.

Cookieless Behavior

Replay follows your consent setup. In cookieless or denied mode the recorder stops and clears any buffered events, so nothing is recorded until consent is granted. See Consent and Cookieless.

On this page