> For the complete documentation index, see [llms.txt](https://developers.gamma.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.gamma.app/analytics/get-gamma-viewer-detail-analytics.md).

# GET /gammas/{gammaId}/analytics/viewers/{userId}

Retrieve per-card engagement for a single authenticated viewer.

## Get single-viewer analytics

> Returns one viewer's engagement with a Gamma: display name, email, last-opened time, cards viewed, and the relative time spent on each card (percentage of that viewer's total view time). Only authenticated viewers are addressable. Requires at least edit permission on the Gamma. When the API key's user has manage permission any viewer is addressable (\`scope: "all"\`); otherwise only the API key user's own activity is addressable (\`scope: "self"\`). Data is eventually consistent (\~hourly).

```json
{"openapi":"3.0.0","info":{"title":"Gamma Public API","version":"1.0"},"tags":[{"name":"public-api","description":"Public API endpoints for external integrations"}],"servers":[{"url":"https://public-api.gamma.app","description":"Production"}],"security":[{"api-key":[]}],"components":{"securitySchemes":{"api-key":{"type":"apiKey","in":"header","name":"X-API-KEY","description":"API key for authentication"}},"schemas":{"GammaViewerDetailAnalytics":{"type":"object","properties":{"scope":{"description":"Which viewers are addressable: `all` — any viewer of the Gamma\n(the API key's user has manage permission); `self` — only the API key\nuser's own activity (edit permission).","enum":["all","self"],"type":"string"},"gammaId":{"type":"string","description":"The Gamma (file) ID"},"userId":{"type":"string","description":"The viewer's user ID"},"displayName":{"type":"string","nullable":true,"description":"Display name of the viewer"},"email":{"type":"string","nullable":true,"description":"Email of the viewer"},"lastOpened":{"type":"string","nullable":true,"description":"ISO-8601 timestamp of the viewer's most recent Gamma open/view, or null if unknown"},"cardsViewed":{"type":"number","description":"Number of cards this viewer has viewed, counting only cards currently in the Gamma"},"cardCount":{"type":"number","description":"Total number of cards in the Gamma (the denominator for cardsViewed)"},"perCardTimeSpent":{"description":"Relative time spent per card, as a percentage of this viewer's total view\ntime on the Gamma. Covers every card in the Gamma, ordered by card\nposition; cards the viewer has never viewed have a viewTimePercent of 0.","type":"array","items":{"$ref":"#/components/schemas/ViewerCardTimeSpent"}}},"required":["scope","gammaId","userId","displayName","email","lastOpened","cardsViewed","cardCount","perCardTimeSpent"]},"ViewerCardTimeSpent":{"type":"object","properties":{"cardId":{"type":"string","description":"The card ID within the Gamma"},"cardName":{"type":"string","nullable":true,"description":"Title of the card, or null if the card has no discernible title"},"cardPosition":{"type":"number","description":"1-indexed position of the card within the Gamma"},"viewTimePercent":{"type":"number","description":"Percentage of this viewer's total view time on the Gamma that was spent\non this card (0-100). Sums to ~100 across the cards the viewer has seen."}},"required":["cardId","cardName","cardPosition","viewTimePercent"]}}},"paths":{"/v1.0/gammas/{gammaId}/analytics/viewers/{userId}":{"get":{"description":"Returns one viewer's engagement with a Gamma: display name, email, last-opened time, cards viewed, and the relative time spent on each card (percentage of that viewer's total view time). Only authenticated viewers are addressable. Requires at least edit permission on the Gamma. When the API key's user has manage permission any viewer is addressable (`scope: \"all\"`); otherwise only the API key user's own activity is addressable (`scope: \"self\"`). Data is eventually consistent (~hourly).","operationId":"getGammaViewerDetailAnalytics","parameters":[{"name":"gammaId","required":true,"in":"path","description":"The ID of the Gamma — accepts a gamma (file) ID or a page/doc ID (the ID in a gamma.app/docs/<id> URL).","schema":{"type":"string"}},{"name":"userId","required":true,"in":"path","description":"The viewer's user ID — the viewerId returned by the viewers list endpoint for authenticated viewers.","schema":{"type":"string"}}],"responses":{"200":{"description":"Viewer analytics retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GammaViewerDetailAnalytics"}}}},"400":{"description":"Invalid request parameters"},"401":{"description":"Invalid or missing API key"},"403":{"description":"Access denied — at least edit permission required; manage permission required to address viewers other than yourself"},"404":{"description":"Gamma not found, or no viewer with this user ID"}},"summary":"Get single-viewer analytics","tags":["public-api"]}}}}
```

{% hint style="info" %}
Requires at least edit permission on the Gamma. Pass the `viewerId` from [GET /gammas/{gammaId}/analytics/viewers](/analytics/get-gamma-viewer-analytics.md) as `userId`. Only authenticated viewers are addressable. The response `scope` field is `all` when the API key owner has manage permission (any viewer is addressable) or `self` when they have edit permission only (only that user's own activity). `perCardTimeSpent` covers every card in the Gamma, ordered by `cardPosition` (1-indexed), with `cardName` on each row (`null` when the card has no discernible title). Cards the viewer has never viewed have `viewTimePercent` of 0. Metrics are eventually consistent and update about hourly.
{% endhint %}

## Related

* [GET /gammas/{gammaId}/analytics/viewers](/analytics/get-gamma-viewer-analytics.md) to list viewers and obtain `viewerId` values
* [GET /gammas/{gammaId}/analytics/cards](/analytics/get-gamma-card-analytics.md) for aggregate per-card stats across all viewers
* [GET /gammas/{gammaId}/analytics](/analytics/get-gamma-analytics.md) for doc-level totals and daily breakdown
* [Error codes](/reference/error-codes.md) for authentication and permission failures


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developers.gamma.app/analytics/get-gamma-viewer-detail-analytics.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
