このページでは

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.

Link agent sessions to Session Replay

このページはまだあなたの言語に翻訳されていません。 現在取り組んでいますので、後でもう一度確認してください。

When your frontend runs Amplitude Session Replay, you can link each agent session to the recording of the visit it happened in. Pass the browser's session ID and device ID to the backend when you open the agent session, and a Session Replay link shows in the sessions pane.

The two IDs identify different things. The agent session is the job, such as a ticket or a conversation, and your application owns that ID. The browser session is the visit, and Amplitude's Session Replay generates that ID on the frontend. One visit can contain several agent sessions.

Where each ID comes from

  • Agent sessionId: Your application generates or reuses this from your existing unit-of-work ID (thread, ticket, task). Refer to Choose a session ID.
  • browserSessionId and deviceId: The Amplitude Analytics Browser SDK maintains both on the client. Read them with amplitude.getSessionId() and amplitude.getDeviceId(), then forward them to your backend on the request that opens the agent session.

Pass the IDs to the agent session

With the AI SDK, pass browserSessionId and deviceId when you open the agent session on the backend. For request-header examples, refer to Link to the standard-analytics session in the SDK reference.

The Session Replay ID (<deviceId>/<sessionId>) then lands as [Amplitude] Session Replay ID on the session's [Agent] events. Once at least one event carries it, a Session Replay link shows in the sessions pane.

If you send events without the AI SDK, add the replay properties to every agent event yourself. Refer to Browser and edge notes.

これは役に立ちましたか?