Get Stats
Fetches aggregated analytics for an app over a given time period. Used by the Appfiliate dashboard to display clicks, installs, revenue, and conversion rates.
GET
/v1/stats/:appIdReturns aggregated click, install, and purchase statistics for the specified app.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
appId | string | Required | The app ID to fetch stats for. |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
days | number | Optional | Number of days to look back. Defaults to 30. |
Example Request
curl
curl "https://us-central1-appfiliate-5a18b.cloudfunctions.net/api/v1/stats/app_myapp?days=30"Response
200 OK
{
"clicks": 1243,
"installs": 187,
"install_rate": 15.0,
"revenue": 1672.50,
"purchases": 42,
"period_days": 30
}Response Fields
| Parameter | Type | Required | Description |
|---|---|---|---|
clicks | number | Required | Total tracking link clicks in the period. |
installs | number | Required | Total attributed installs in the period. |
install_rate | number | Required | Click-to-install conversion rate as a percentage (e.g. 15.0 means 15%). |
revenue | number | Required | Total purchase revenue in the period, rounded to two decimal places. |
purchases | number | Required | Total number of tracked purchases in the period. |
period_days | number | Required | The number of days the stats cover (echoes the query parameter). |
Install rate calculation
The install_rate is calculated as (installs / clicks) * 100, rounded to one decimal place. If there are zero clicks, the rate is 0.