> 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

Returns doc-level engagement metrics for a Gamma: views, unique viewers/editors, card count, last opened time, and a 30-day daily breakdown.

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; Pro plan or higher required (`code: individual_analytics_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 a Pro plan or higher and 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](https://developers.gamma.app/analytics/get-gamma-card-analytics.md) for per-card view time and reach
* [GET /gammas/{gammaId}/analytics/viewers](https://developers.gamma.app/analytics/get-gamma-viewer-analytics.md) for per-viewer engagement rows
* [GET /gammas/{gammaId}](https://developers.gamma.app/management/get-gamma.md) for title, thumbnail, and URL metadata
* [Error codes](https://developers.gamma.app/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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
