Documentation · API reference
GET
/api/v1/sites/{site}/retentionOf the visitors first seen in a week or month
This page as Markdown, or in an AI chatMore ways to read this page
Of the visitors first seen in a week or month, the share who came back.
# Of the visitors first seen in a week or month
> tidekeeper's API reference: https://tidekeeper.eu/docs/api/get-sites-site-retention
`GET /api/v1/sites/{site}/retention`
Of the visitors first seen in a week or month, the share who came back.
## Parameters
- `site` (in path, needed): A site's id or name
- `grain` (in query): week or month
- `what` (in query): visit, or goal:<name>
## The answer
200, `RetentionReport`
- `back_first` (number or null): Back in the first period after the one they were first seen in: the mean over the cohorts old enough to say, and how many those are.
- `back_first_cohorts` (integer, needed)
- `back_fourth` (number or null): Still coming in the fourth period.
- `back_fourth_cohorts` (integer, needed)
- `by_source` (list of RetentionSplit, needed)
- `cohorts` (list of CohortRow, needed)
- `coverage` (Coverage, needed)
- `days_to_return` (number or null): Median days until a visitor's second day.
- `grain` (string, needed): `week` or `month`.
- `site` (string, needed)
- `what` (string, needed): `visit`, or a goal's name.
## Asking
```sh
curl https://tidekeeper.eu/api/v1/sites/example.org/retention \
-H "Authorization: Bearer $TIDEKEEPER_TOKEN"
```
Parameters
- sitein the address
- neededA site's id or name
- grainin the query
- week or month
- whatin the query
- visit, or goal:<name>
The answer
Status 200
RetentionReport
- back_first
- number or nullBack in the first period after the one they were first seen in: the mean over the cohorts old enough to say, and how many those are.
- back_first_cohorts
- integerneeded
- back_fourth
- number or nullStill coming in the fourth period.
- back_fourth_cohorts
- integerneeded
- by_source
- list of RetentionSplitneeded
- cohorts
- list of CohortRowneeded
- coverage
- Coverageneeded
- days_to_return
- number or nullMedian days until a visitor's second day.
- grain
- stringneeded`week` or `month`.
- site
- stringneeded
- what
- stringneeded`visit`, or a goal's name.
Asking
curl https://tidekeeper.eu/api/v1/sites/example.org/retention \ -H "Authorization: Bearer $TIDEKEEPER_TOKEN"
const answer = await fetch("https://tidekeeper.eu/api/v1/sites/example.org/retention", { headers: { Authorization: `Bearer ${process.env.TIDEKEEPER_TOKEN}`, }, }).then((r) => r.json());