Skip to main content

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
}
FieldTypeDescription
cumulativeboolSet false for non-cumulative aggregation for each day.Set true for cumulative aggregation (each day number will contain the result of the previous one).
intervalInterval objectThe date range within the app installation happened.
filtersFilters objectOptional filters to limit requested.

Refer to our supported request values for options.
dx[]intFor 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.
metricstringMetric 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.

FieldTypeDescription
cohortSizefloatAmount 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
MetricDescription
activeUsersThe number of active users. This metric doesn't support cumulative mode.
averageRevenuePerActiveUserThe average revenue per active user
averageTimeSpendInAppThe average amount of seconds that users spend in an app
adImpressionsThe number of successful ad impressions
adImpressionsBannerThe number of successful ad impressions with banner type
adImpressionsInterstitialThe number of successful ad impressions with interstitial type
adImpressionsRewardedThe number of successful ad impressions with rewarded type
retentionRateThe number of active users divided by number of installs. This metric doesn't support cumulative mode.
Supported dimension filters
DimensionDescription
appApp version
campaign.idCampaign ID
countryISO Alpha-2 country code
installAppVersionCodeApp version code
network.idAd partner ID
testGroupIdTest Group ID