> 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-analytics.md).

# GET /gammas/{gammaId}/analytics

Retrieve doc-level engagement metrics for a single Gamma.

## Get Gamma analytics

> Returns doc-level engagement metrics for a Gamma: total views, unique viewers/editors, card count, last opened time, and a 30-day daily unique-viewer breakdown. Requires at least edit permission on the Gamma. When the API key's user has manage permission the metrics cover all viewers (\`scope: "all"\`); otherwise they cover only that user's own activity (\`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":{"GammaAnalytics":{"type":"object","properties":{"scope":{"description":"Which activity the metrics cover: `all` — every 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"},"totalViews":{"type":"number","description":"Total number of view events, including repeat opens by the same viewer."},"uniqueViewers":{"type":"number","description":"Total unique viewers (authenticated + anonymous)"},"uniqueEditors":{"type":"number","description":"Total unique editors"},"cardCount":{"type":"number","description":"Number of cards in the Gamma"},"lastOpened":{"type":"string","nullable":true,"description":"ISO-8601 timestamp of the most recent view, or null if never viewed"},"dailyViews":{"description":"Daily unique viewer breakdown (30-day rolling window)","allOf":[{"$ref":"#/components/schemas/DailyViews"}]}},"required":["scope","gammaId","totalViews","uniqueViewers","uniqueEditors","cardCount","lastOpened","dailyViews"]},"DailyViews":{"type":"object","properties":{"dayCount":{"type":"number","description":"Number of days in the window"},"timezone":{"type":"string","description":"IANA timezone used for day boundaries"},"days":{"description":"Per-day viewer counts","type":"array","items":{"$ref":"#/components/schemas/DailyViewEntry"}}},"required":["dayCount","timezone","days"]},"DailyViewEntry":{"type":"object","properties":{"date":{"type":"string","description":"Calendar date (YYYY-MM-DD)"},"uniqueViewers":{"type":"number","description":"Number of unique viewers on this day"}},"required":["date","uniqueViewers"]}}},"paths":{"/v1.0/gammas/{gammaId}/analytics":{"get":{"description":"Returns doc-level engagement metrics for a Gamma: total views, unique viewers/editors, card count, last opened time, and a 30-day daily unique-viewer breakdown. Requires at least edit permission on the Gamma. When the API key's user has manage permission the metrics cover all viewers (`scope: \"all\"`); otherwise they cover only that user's own activity (`scope: \"self\"`). Data is eventually consistent (~hourly).","operationId":"getGammaAnalytics","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"}}],"responses":{"200":{"description":"Analytics retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GammaAnalytics"}}}},"400":{"description":"Invalid request parameters"},"401":{"description":"Invalid or missing API key"},"403":{"description":"Access denied — at least edit permission required"},"404":{"description":"Gamma not found"}},"summary":"Get Gamma analytics","tags":["public-api"]}}}}
```

{% hint style="info" %}
Accepts either the API file ID or the doc ID from a `gamma.app/docs/...` URL. Requires at least edit permission on the Gamma. The response `scope` field is `all` when the API key owner has manage permission (metrics cover every viewer) or `self` when they have edit permission only (metrics cover that user's activity). Metrics are eventually consistent and update about hourly.
{% endhint %}

## Related

* [GET /gammas/{gammaId}/analytics/cards](/analytics/get-gamma-card-analytics.md) for per-card view time and reach
* [GET /gammas/{gammaId}/analytics/viewers](/analytics/get-gamma-viewer-analytics.md) for per-viewer engagement rows
* [GET /gammas/{gammaId}](/management/get-gamma.md) for title, thumbnail, and URL metadata
* [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-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.
