![Ringle](assets/ringle-logo.png)

# Demo analytics and session transcripts

## Purpose
Review every conversation your demo workspace has run. Filter the session history by date, outcome, channel, or language, and open any session to read its full transcript.

## Prerequisites
- A demo workspace with at least one finished conversation (chat or voice). Run one from the Chat page if the history is empty; sessions are recorded when the conversation ends.

## Steps

### Step 1

![demo-analytics, step-01](screenshots/demo-analytics/step-01.png)

**Action:** Click Analytics in the workspace sidebar.

**What you should see:** The Analytics page opens. A filter bar (Start Date, End Date, Outcome, Channel, Language) sits above a Session History table. Each session row shows a short Session ID (text chat ids start with "text::"), the start date and time, and the duration in seconds. It also has a colored Outcome chip (Completed, Abandoned, or Failed), the language, a Channel chip, and a View button.

### Step 2

![demo-analytics, step-02](screenshots/demo-analytics/step-02.png)

**Action:** Open the Channel filter. Pick Chat. Combine it with the date pickers or the Outcome and Language filters to narrow the list further.

**What you should see:** The dropdown offers All, Voice, Chat, and Email. The table narrows to matching sessions as soon as you pick one. Web chat sessions display a "Web" channel chip. Clearing a filter back to All restores the full history.

### Step 3

![demo-analytics, step-03](screenshots/demo-analytics/step-03.png)

**Action:** Click View on a session.

**What you should see:** The Session Detail page opens with a Back to Analytics button. The Session card summarizes the metadata: language, start and end time, outcome, turn count, and whether translation was enabled. The Transcript card replays the whole conversation as chat bubbles: bot turns on the left, user turns on the right. Each bubble is labeled with its turn number and timestamp.

## Troubleshooting
- "No sessions found": no conversation has finished in this workspace yet, or the filters exclude everything. Clear the date pickers and set Outcome and Channel back to All.
- A conversation you ran a moment ago is missing: sessions appear once the conversation ends. Click Stop on the Chat or Voice page, then return to Analytics.
- The transcript contains bot lines you never saw in the chat window, such as "One moment..." or follow-up questions: the transcript is the verbose record and includes interim turns the live chat view may not have rendered. It is the more complete account of the session.
- The transcript card says "No transcript available": the session ended before any turns were exchanged (for example, Start followed immediately by Stop).
- The transcript card says "This transcript is no longer retained.": the transcript for that session has been cleaned up. The Session card still shows the session's metadata.

## Notes
- Routes: `/demos/:demoWorkspaceId/analytics` (list) and `/demos/:demoWorkspaceId/analytics/:callId` (session detail).
- Source components: `pages/demo-workspace/DemoWorkspaceAnalytics.jsx` and `pages/demo-workspace/DemoWorkspaceSessionDetail.jsx` in the portal app.
- The detail page shows outcome, turn count, and translation state; it does not show per-turn latency or quality scores.
- Analytics covers demo workspace sessions only, so browsing and filtering here is always safe.
