# Translation Widget Analytics

> Query translation widget usage totals and language, host, and page breakdowns through the REST API.

Source: https://docs.oursprivacy.com/docs/platform-api/translation-widget-analytics

Retrieve usage totals and language, host, and page breakdowns for one translation widget over an inclusive calendar-day range.

## GET /rest/v1/translation-widgets/{id}/analytics

Return usage totals and language, host, and page breakdowns for one translation widget over the requested date range. Requires API-key scope or current OAuth user permission: report:translation-analytics

Request URL: `GET https://app.oursprivacy.com/rest/v1/translation-widgets/{id}/analytics`

Authentication: apiKey or oauth2.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string (uuid) | Yes |  |
| `from` | query | string (date) | Yes | Inclusive lower bound of the analytics window as `YYYY-MM-DD`. |
| `to` | query | string (date) | Yes | Inclusive upper bound of the analytics window as `YYYY-MM-DD`. |
| `limit` | query | integer | No | Maximum rows to return for each breakdown. Defaults to 50. |

### Responses

- `200`: Translation widget usage analytics
- `400`: Bad Request
- `401`: Unauthorized — missing, invalid, or expired API key or OAuth access token
- `403`: Forbidden — credential does not have the required current Ours permission
- `404`: Not Found
- `500`: Internal Server Error

#### `200` response body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `totalTranslations` | integer | Yes |  |
| `uniqueUsers` | integer | Yes |  |
| `languagesUsed` | integer | Yes |  |
| `byLanguage` | object[] | Yes |  |
| `byLanguage[].languageCode` | string | Yes |  |
| `byLanguage[].translations` | integer | Yes |  |
| `byLanguage[].uniqueUsers` | integer | Yes |  |
| `byHost` | object[] | Yes |  |
| `byHost[].host` | string | Yes |  |
| `byHost[].translations` | integer | Yes |  |
| `byHost[].uniqueUsers` | integer | Yes |  |
| `topPages` | object[] | Yes |  |
| `topPages[].url` | string | Yes |  |
| `topPages[].translations` | integer | Yes |  |
| `topPages[].uniqueUsers` | integer | Yes |  |
| `topPages[].byLanguage` | object[] | Yes |  |
| `topPages[].byLanguage[].languageCode` | string | Yes |  |
| `topPages[].byLanguage[].translations` | integer | Yes |  |
| `topPages[].byLanguage[].uniqueUsers` | integer | Yes |  |

Full schema: [OpenAPI specification](https://docs.oursprivacy.com/openapi-platform.json).
