Analytics API
Query aggregated analytics, attribution data, and per-connector metrics. All endpoints require authentication.
Dashboard Summary
GET
/api/analytics/summaryGet high-level analytics for the dashboard overview
| Parameter | Type | Description |
|---|---|---|
period | string | Time period: 7d, 30d, 90d, or custom. Defaults to 30d. |
from | string | Start date (ISO 8601) for custom period |
to | string | End date (ISO 8601) for custom period |
curl "https://your-instance.com/api/analytics/summary?period=30d" \
-H "x-api-key: apex_key_abc123"
Returns aggregated metrics:
{
"visitors": 12450,
"leads": 342,
"conversions": 89,
"conversionRate": 0.026,
"topChannels": [
{ "channel": "organic_search", "visitors": 5200, "conversions": 42 },
{ "channel": "paid_search", "visitors": 3100, "conversions": 28 }
],
"period": { "from": "2025-01-01", "to": "2025-01-31" }
}
Attribution Summary
GET
/api/attribution/summaryGet multi-touch attribution data across channels
| Parameter | Type | Description |
|---|---|---|
model | string | Attribution model: first_touch, last_touch, linear, or position_based. Defaults to position_based. |
period | string | Time period: 7d, 30d, 90d. Defaults to 30d. |
curl "https://your-instance.com/api/attribution/summary?model=linear&period=30d" \
-H "x-api-key: apex_key_abc123"
Returns per-channel attribution with credited conversions:
{
"model": "linear",
"channels": [
{ "channel": "organic_search", "creditedConversions": 34.5, "revenue": 12400 },
{ "channel": "paid_search", "creditedConversions": 22.0, "revenue": 8800 },
{ "channel": "email", "creditedConversions": 15.5, "revenue": 6200 }
]
}
Tip
Use position_based (the default) for a balanced view that credits both the first and last touchpoints more heavily, with remaining credit distributed evenly across middle touches.
Metrics Overview
GET
/api/metricsGet aggregated metrics across all connectors
curl "https://your-instance.com/api/metrics" \
-H "x-api-key: apex_key_abc123"
Connector Metrics
GET
/api/metrics/:connectorTypeGet metrics for a specific connected platform
| Parameter | Type | Description |
|---|---|---|
connectorTyperequired | string | Connector type: google_ads, meta_ads, linkedin_ads, etc. (path parameter) |
period | string | Time period: 7d, 30d, 90d. Defaults to 30d. |
curl "https://your-instance.com/api/metrics/google_ads?period=30d" \
-H "x-api-key: apex_key_abc123"
Returns platform-specific metrics. Fields vary by connector type:
{
"connectorType": "google_ads",
"spend": 4500.00,
"impressions": 125000,
"clicks": 3100,
"conversions": 28,
"cpa": 160.71,
"roas": 2.8,
"campaigns": [
{ "name": "Brand Search", "spend": 1200, "conversions": 15 },
{ "name": "Competitor Keywords", "spend": 3300, "conversions": 13 }
]
}