Cohort
The Cohort API provides data which is available on the Cohort Analysis view on the justtrack dashboard.
Table & graph API
For cohort purposes you need only one request to feed your tables and graphs.
curl -H X-API-Key: <API_KEY> https://api.justtrack.io/reporting/v1/cohort
Request
General request to the Cohort API should look like:
{
"cumulative": bool,
"interval": {
"from": "YYYY-mm-dd",
"until": "YYYY-mm-dd"
},
"filters": {
"<dimension>": [string]
},
"dx": [],
"metric": string
}
Field | Type | Description |
---|---|---|
cumulative | bool | Set false for non-cumulative aggregation for each day.Set true for cumulative aggregation (each day number will contain the result of the previous one). |
interval | Interval object | The date range within the app installation happened. |
filters | Filters object | Optional filters to limit requested. Refer to our supported request values for options. |
dx | []int | For every selected dx the response will include one data point of the requested metric. For example, if you want to get metrics for the first 3 days (including install date), your dx value has to be [0, 1, 2]. You can request up to 90. |
metric | string | Metric to calculate. Refer to our supported request values for options. |
Responses
200
{
"unit": string,
"average": {
"cohortSize": float,
"values": [float]
},
"rows": {
"<YYYY-mm-dd>": {
"cohortSize": float,
"values": [float]
}
}
}
unit
The unit for the values. Can be $ or %, depending on the metric.
average
A Row with an average value for all days.
rows
List of objects, where each entry represents data for the specific table row. The Key is the date on which the installation of the app has happened.
Field | Type | Description |
---|---|---|
cohortSize | float | Amount of installs at the specific day. |
values | [float] | List of floats, where each value corresponds to the requested day after the installation. |
400
If you provide a valid JSON request body but with a data error, you'll receive an INVALID_ARGUMENT
response:
{
"code": 400,
"requestId": "a0b12345-6c78-90123-4def-ghij56789012",
"details": [
"requested metrics are not supported: [<INVALID_METRICS>]",
"requested dimensions are not suported: [<INVALID_DIMENSIONS>]"
],
"status": "INVALID_ARGUMENT"
}
If you provide an invalid JSON request body, you'll receive an INVALID_REQUEST
response:
{
"code": 400,
"requestId": "a0b12345-6c78-90123-4def-ghij56789012",
"details": [
"could not decode body: <MESSAGE>"
],
"status": "INVALID_REQUEST"
}
500
If there is a backend error, you'll receive an INTERNAL
error response:
{
"code": 500,
"requestId": "",
"details": [],
"status": "INTERNAL"
}
As the error details
are internal, we won't include them in the response.
Supported request values
Here, you'll find the available values for the metrics
and filters
request fields.
Supported metrics
Metric | Description |
---|---|
activeUsers | The number of active users. This metric doesn't support cumulative mode. |
averageRevenuePerActiveUser | The average revenue per active user |
averageTimeSpendInApp | The average amount of seconds that users spend in an app |
monetizationAdImpressions | The number of successful ad impressions |
monetizationAdImpressionsBanner | The number of successful ad impressions with banner type |
monetizationAdImpressionsInterstitial | The number of successful ad impressions with interstitial type |
monetizationAdImpressionsRewarded | The number of successful ad impressions with rewarded type |
retentionRate | The number of active users divided by number of installs. This metric doesn't support cumulative mode. |
Supported dimension filters
Dimension | Description |
---|---|
app | App version |
campaign.id | Campaign ID |
country | ISO Alpha-2 country code |
installAppVersionCode | App version code |
network.id | Ad partner ID |
testGroupId | Test Group ID |