Analytics
CampaignOS provides comprehensive analytics across contacts, campaigns, messages, and events.
Overview Dashboard
GET /api/workspaces/{workspaceId}/analytics
Returns summary metrics for the last 30 days.
Auth: Session required
Response:
{
"contacts": {
"total": 50000,
"new": 1200
},
"campaigns": {
"total": 25,
"active": 8
},
"messages": {
"total": 150000,
"sent": 145000,
"opened": 43500,
"clicked": 14500,
"openRate": 0.30,
"clickRate": 0.10
},
"events": {
"total": 500000
}
}Campaign Analytics
GET /api/workspaces/{workspaceId}/analytics/campaigns/{campaignId}
Detailed performance analytics for a specific campaign.
Query Parameters:
| Param | Type | Default | Description |
|---|---|---|---|
period | string | 30d | Time period (e.g., 7d, 30d, 90d) |
Response:
{
"campaign": { "id": "cmp_1", "name": "Welcome Series" },
"enrollments": {
"total": 5000,
"active": 1200,
"completed": 3800
},
"messages": {
"total": 12000,
"sent": 11500,
"delivered": 11200,
"opened": 3360,
"clicked": 1120,
"bounced": 200,
"failed": 100,
"openRate": 0.30,
"clickRate": 0.10,
"bounceRate": 0.018
},
"statusBreakdown": [
{ "status": "DELIVERED", "_count": 11200 },
{ "status": "OPENED", "_count": 3360 }
],
"channelBreakdown": [
{ "channel": "EMAIL", "_count": 10000 },
{ "channel": "PUSH", "_count": 2000 }
],
"abTests": [
{
"id": "ab_1",
"name": "Subject Line Test",
"variants": [
{ "name": "Variant A", "sent": 500, "opened": 150 },
{ "name": "Variant B", "sent": 500, "opened": 200 }
]
}
]
}Time Series
GET /api/workspaces/{workspaceId}/analytics/timeseries
Daily time series data for key metrics.
Query Parameters:
| Param | Type | Default | Description |
|---|---|---|---|
days | number | 30 | Number of days |
Response:
{
"period": "30d",
"series": [
{
"date": "2026-01-15",
"events": 1500,
"contacts": 40,
"messages": 500,
"opens": 150,
"clicks": 50
}
]
}Attribution
GET /api/workspaces/{workspaceId}/analytics/attribution
UTM-based traffic attribution data.
Query Parameters:
| Param | Type | Default | Description |
|---|---|---|---|
days | number | 30 | Lookback period |
Response:
{
"period": "30d",
"sources": [
{
"source": "google",
"medium": "cpc",
"campaign": "summer-sale",
"uniqueVisitors": 500,
"totalEvents": 1200
}
],
"totalAttributedEvents": 5000,
"conversions": 150
}Funnel Analysis
GET /api/workspaces/{workspaceId}/analytics/funnel
Track conversion through a sequence of event types.
Query Parameters:
| Param | Type | Default | Description |
|---|---|---|---|
steps | string | required | Comma-separated event types |
days | number | 30 | Lookback period |
Example: /analytics/funnel?steps=page_view,signup,purchase&days=30
Response:
{
"period": "30d",
"steps": [
{ "step": "page_view", "count": 10000, "dropoff": 0, "conversionFromPrevious": 1.0 },
{ "step": "signup", "count": 1000, "dropoff": 9000, "conversionFromPrevious": 0.10 },
{ "step": "purchase", "count": 200, "dropoff": 800, "conversionFromPrevious": 0.20 }
],
"overallConversion": 0.02
}Cohort Retention
GET /api/workspaces/{workspaceId}/analytics/cohorts
Cohort-based retention analysis grouped by signup date.
Query Parameters:
| Param | Type | Default | Description |
|---|---|---|---|
days | number | 30 | Lookback period |
metric | string | events | Retention metric |
Response:
{
"period": "30d",
"metric": "events",
"cohorts": [
{
"cohort": "2026-01-01",
"size": 100,
"activeContacts": 60,
"retentionRate": 0.60,
"retention": {
"week_0": 100,
"week_1": 80,
"week_2": 65,
"week_3": 60
}
}
]
}Last updated on