Skip to main content

Overview

The Analytics API provides access to KPI dashboards, timeseries data, funnel analysis, retention cohorts, and activity metrics. All analytics are powered by the BigQueryAnalyticsService and require Customer JWT authentication.

Endpoints

KPI Dashboard

GET /api/v1/analytics/kpis
Authentication: Customer JWT (Authorization: Bearer header) Returns paginated KPI tiles with sparkline data for the dashboard overview. Query parameters:
ParameterTypeRequiredDescription
start_datestring (date)YesStart of the date range (e.g., 2026-02-01)
end_datestring (date)YesEnd of the date range (e.g., 2026-02-19)
comparebooleanNoInclude comparison with the previous period
Response:
{
  "data": {
    "kpis": [
      {
        "name": "Daily Active Users",
        "value": 12450,
        "change": 8.3,
        "sparkline": [11200, 11500, 11800, 12100, 12450]
      },
      {
        "name": "Revenue",
        "value": 45230.50,
        "change": 12.1,
        "sparkline": [38000, 40000, 42000, 44000, 45230]
      }
    ]
  }
}

KPI Timeseries

GET /api/v1/analytics/kpis/timeseries
Authentication: Customer JWT (Authorization: Bearer header) Returns timeseries data for a specific metric at the requested granularity. Query parameters:
ParameterTypeRequiredDescription
start_datestring (date)YesStart of the date range
end_datestring (date)YesEnd of the date range
metricstringYesMetric identifier (e.g., dau, revenue, sessions)
granularitystringYeshourly, daily, weekly, or monthly
Response:
{
  "data": {
    "metric": "dau",
    "granularity": "daily",
    "points": [
      { "timestamp": "2026-02-01T00:00:00Z", "value": 11200 },
      { "timestamp": "2026-02-02T00:00:00Z", "value": 11500 },
      { "timestamp": "2026-02-03T00:00:00Z", "value": 11800 }
    ]
  }
}

Funnel Analysis

GET /api/v1/analytics/funnel/{funnelName}
Authentication: Customer JWT (Authorization: Bearer header) Returns conversion data for a named funnel. Path parameters:
ParameterTypeDescription
funnelNamestringFunnel identifier (e.g., onboarding, purchase, activation)
Query parameters:
ParameterTypeRequiredDescription
start_datestring (date)YesStart of the date range
end_datestring (date)YesEnd of the date range
Response:
{
  "data": {
    "funnel": "onboarding",
    "steps": [
      { "name": "flow_started", "count": 5000, "conversion": 100.0 },
      { "name": "step_1_completed", "count": 4200, "conversion": 84.0 },
      { "name": "step_2_completed", "count": 3500, "conversion": 70.0 },
      { "name": "flow_completed", "count": 2800, "conversion": 56.0 }
    ]
  }
}

Retention Cohorts

GET /api/v1/analytics/retention
Authentication: Customer JWT (Authorization: Bearer header) Returns cohort retention curves grouped by the specified interval. Query parameters:
ParameterTypeRequiredDescription
start_datestring (date)YesStart of the date range
end_datestring (date)YesEnd of the date range
cohort_intervalstringYesCohort grouping: daily, weekly, or monthly
Response:
{
  "data": {
    "cohort_interval": "weekly",
    "cohorts": [
      {
        "cohort_date": "2026-02-03",
        "size": 1200,
        "retention": [100.0, 62.5, 48.3, 41.0]
      },
      {
        "cohort_date": "2026-02-10",
        "size": 1350,
        "retention": [100.0, 65.2, 50.1]
      }
    ]
  }
}

User Activity

GET /api/v1/analytics/activity
Authentication: Customer JWT (Authorization: Bearer header) Returns active, new, and churned user counts for the specified date range. Query parameters:
ParameterTypeRequiredDescription
start_datestring (date)YesStart of the date range
end_datestring (date)YesEnd of the date range
Response:
{
  "data": {
    "active_users": 12450,
    "new_users": 3200,
    "churned_users": 890,
    "reactivated_users": 150
  }
}

Async Bulk Export

For large-scale data exports, AppDNA provides an asynchronous export workflow backed by the SdkEventExport entity.

Export Lifecycle

1. Create export request  -->  status: "processing"
2. Server processes events in background
3. Export completes  -->  status: "completed", download_url available
4. Download file before expiration

Export Entity Fields

FieldTypeDescription
statusstringprocessing, completed, or failed
params.start_datestring (date)Export date range start
params.end_datestring (date)Export date range end
params.event_namesstring[]Filter by event names (empty = all events)
download_urlstringSigned URL for downloading the export file
event_countnumberTotal events in the export
file_size_bytesnumberSize of the export file
completed_atstring (datetime)When the export finished processing
expires_atstring (datetime)When the download URL expires
Export download URLs are signed and time-limited. Download the file before the expires_at timestamp. After expiration, you must create a new export request.

Callback URL

You can provide a callback_url when creating an export. AppDNA will send a POST request to this URL when the export completes or fails:
{
  "export_id": "exp-abc123",
  "status": "completed",
  "download_url": "https://storage.googleapis.com/...",
  "event_count": 150000,
  "file_size_bytes": 48230400
}
All analytics queries are scoped to the authenticated user’s tenant_id and app_id. There is no way to query across tenants or applications.
Analytics data has a processing delay of up to 5 minutes from event ingestion. Real-time dashboards reflect this latency.