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.
Verify Browser Unified SDK events
このページはまだあなたの言語に翻訳されていません。 現在取り組んでいますので、後でもう一度確認してください。
The Browser Unified SDK sends analytics events through the bundled Browser SDK 2. An analytics event moves through the same four stages as in Browser SDK 2: captured, transformed, sent, and received. This page covers the checks specific to the Unified SDK, starting with initialization, and links to the Browser SDK 2 steps for the other stages.
| Stage | Question | Where to look |
|---|---|---|
| Initialized | Did initAll() set up every product you use? | The accessors and the browser Network tab |
| Captured | Did the SDK accept the call? | Debug logs |
| Transformed | What did plugins add, change, or drop? | An inspection plugin |
| Sent | Did the request leave the browser, and with what payload? | The browser Network tab |
| Received | Did Amplitude accept and store the event? | The upload result and User Lookup |
For problems common to every Amplitude SDK, go to SDK troubleshooting and debugging. For changes between versions, go to the @amplitude/unified changelog.
Turn on debug logging
Pass logLevel inside analytics. Session Replay logs through the same logger, so its messages appear with the analytics messages.
amplitude.initAll("YOUR_API_KEY", {
analytics: { logLevel: amplitude.Types.LogLevel.Debug },
});
For log levels and what each message contains, go to Turn on debug logging in Browser SDK 2. Return logLevel to Warn before you ship.
Check that each product initialized
Await initAll(), then check each product through its accessor:
await amplitude.initAll("YOUR_API_KEY", {
sessionReplay: { sampleRate: 1 },
});
console.log(amplitude.sessionReplay()?.getSessionReplayProperties());
// { "[Amplitude] Session Replay ID": "..." } while recording; {} when not
console.log(typeof amplitude.experiment()?.fetch);
// "function"
In the browser Network tab, filter on amplitude.com and look for these requests:
| Product | Request | When |
|---|---|---|
| Session Replay | sr-client-cfg.amplitude.com/config/<API key> (sr-client-cfg.eu.amplitude.com for EU) | During initAll() |
| Session Replay | api-sr.amplitude.com/sessions/v2/track (api-sr.eu.amplitude.com for EU) | While a session records |
| Feature Experiment | api.lab.amplitude.com/sdk/v2/vardata (api.lab.eu.amplitude.com for EU) | Only after you call fetch() |
| Guides and Surveys | cdn.amplitude.com/engagement-browser/..., then gs.amplitude.com/sdk/v1/... | During initAll(), unless skip |
If getSessionReplayProperties() returns {}, Session Replay isn't recording. Check the log for this message: Session ... not being captured due to capture being disabled for project or because the remote config could not be fetched. Then confirm that sampleRate is above 0.
Check what the SDK sent
Find the request to api2.amplitude.com/2/httpapi (api.eu.amplitude.com for EU) and open its payload. The library field of each Unified SDK event contains two version numbers:
{
"event_type": "Sign Up Clicked",
"library": "amplitude-ts-unified/1.1.43-amplitude-ts/2.48.1"
}
The first version is @amplitude/unified. The second is the bundled Browser SDK 2. Use the second version when you compare behavior against the Browser SDK 2 release notes. For payload fields and compression, go to Check what the SDK sent in Browser SDK 2.
これは役に立ちましたか?