Verify Browser Session Replay capture

이 페이지는 아직 귀하의 언어로 번역되지 않았습니다. 현재 작업 중이므로 곧 다시 확인해 주십시오.

A replay passes through five stages between the page and Amplitude. Check them in order. The first stage that looks wrong is where the problem is. For changes in each release, go to the Session Replay Browser SDK release notes.

For playback problems after a replay arrives, such as missing styles or a replay that's temporarily unavailable, go to Troubleshoot Session Replay.

Turn on debug logging

The SDK explains each decision in its debug log. Turn it on in a test environment, and turn it off before you release.

The plugin uses the Browser SDK 2 log level.

ts
amplitude.add(sessionReplayPlugin({ sampleRate: 1 }));
amplitude.init("AMPLITUDE_API_KEY", {
  logLevel: amplitude.Types.LogLevel.Debug,
});

Messages appear in the browser console with the prefix Amplitude Logger [Log]:, Amplitude Logger [Debug]:, or, for upload failures, Amplitude Logger [Warn]:.

Check whether the session was selected

The SDK records a session only when all of these conditions are true. The SDK checks them in this order:

  1. init() has run and has a session ID and a device ID.
  2. Your code hasn't stopped recording with stop() or shutdown().
  3. The SDK loaded its remote configuration, and capture is on for the project.
  4. The user isn't opted out.
  5. The session matches targeting if the project uses it. Otherwise, the sample rate selects it.

The debug log names the check that failed:

The sample rate in Session Replay settings overrides sampleRate in code. The SDK selects a session from a hash of its session ID, so every page and tab that shares a session ID gets the same result.

Check what the SDK captured

Read the replay properties from the SDK.

Keep a reference to the plugin, and call its method:

ts
const sessionReplayTracking = sessionReplayPlugin({ sampleRate: 1 });
amplitude.add(sessionReplayTracking);
amplitude.init("AMPLITUDE_API_KEY");

// After init finishes:
console.log(sessionReplayTracking.getSessionReplayProperties());
// { "[Amplitude] Session Replay ID": "<device ID>/<session ID>" }

An empty object, {}, means the session isn't recording. Go back to Check whether the session was selected.

Some content never appears in a replay, even when recording works. For the list, go to Known limitations.

Check what the SDK masked

By default, Session Replay masks the text of every input field and records other page text. Check masking in a test replay before you record real users:

  1. Record a test session on a page that shows the data you need to hide.
  2. Open the replay in Amplitude.
  3. Confirm that masked text appears as asterisks, and that blocked elements appear as empty placeholders.

Masking happens in the browser, before upload. If the project sets a privacy level in Session Replay settings, that level overrides privacyConfig.defaultMaskLevel in code. To change what's masked, go to Mask data.

Check what the SDK sent

Open the browser developer tools, select the Network tab, and filter for sessions. Interact with the page, because the SDK sends a batch only after it records new activity.

The SDK compresses each upload with gzip and sends Content-Encoding: gzip, so the Payload tab shows unreadable bytes.

With the standalone SDK, you can set enableTransportCompression: false in a test environment to send readable JSON. With debug logging on, each accepted batch also logs Session replay event batch tracked successfully for session id <session ID>, size of events: <n> KB. The X-Client-Library request header names the variant and version, for example plugin/1.36.7 or standalone/1.51.8.

When the user hides or leaves the page, the SDK sends the last batch with navigator.sendBeacon. The beacon request carries the API key in its URL, skips compression, and has a 64 KB limit.

Read upload errors

The SDK logs these messages when an upload fails:

For request failures you can't see in the browser, use the Ingestion Monitor.

Check that the replay matches its session

Amplitude links a replay to the user's events by device ID and session ID. Compare the IDs on both sides:

  1. In the Network tab, read device_id and session_id from the replay upload URL.
  2. In User Lookup, open an event from the same session and read its device ID and session ID.
  3. If the IDs differ, fix the source that sends the wrong value. With the standalone SDK, pass the IDs your analytics tool uses, and call setSessionId() whenever its session changes.

The plugin also adds [Amplitude] Session Replay ID, in the form <device ID>/<session ID>, to every Browser SDK 2 event in the session except Identify events. After a replay arrives, Amplitude creates an [Amplitude] Replay Captured event for it, which you can find in the user's activity.

If your project uses a custom session definition or doesn't send session IDs, go to Choose a session matching option.

이 내용이 도움이 되었나요?

For AI agents: a documentation index is available at /docs/llms.txt. Append .md to any page URL for markdown, or send Accept: text/markdown.

이 페이지에서