Analytics
Query paywall performance metrics including opens, conversions, revenue, and cohort retention.
All analytics endpoints require a date range via start_date and end_date query parameters (ISO 8601 date strings). End dates are inclusive.
Overview
GET /v1/projects/:id/analytics/overviewReturns top-level metrics for the project within a date range.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
start_date | string | Yes | Start date (e.g., 2025-03-01) |
end_date | string | Yes | End date (e.g., 2025-03-15) |
Example
curl "https://agentwallie.com/api/v1/projects/PROJECT_ID/analytics/overview?start_date=2025-03-01&end_date=2025-03-15" \
-H "Authorization: Bearer sk_your_private_key"Response 200 OK
{
"opens": 5420,
"conversions": 312,
"conversionRate": 0.0576,
"revenue": 15600.00,
"trialStarts": 198,
"period": {
"start": "2025-03-01T00:00:00.000Z",
"end": "2025-03-16T00:00:00.000Z"
}
}Funnel
GET /v1/projects/:id/analytics/funnelReturns the impression-to-purchase funnel, optionally filtered by campaign or paywall.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
start_date | string | Yes | Start date |
end_date | string | Yes | End date |
campaign_id | string | No | Filter by campaign |
paywall_id | string | No | Filter by paywall |
Example
curl "https://agentwallie.com/api/v1/projects/PROJECT_ID/analytics/funnel?start_date=2025-03-01&end_date=2025-03-15" \
-H "Authorization: Bearer sk_your_private_key"Response 200 OK
{
"steps": [
{ "name": "placement_triggered", "count": 12500 },
{ "name": "paywall_open", "count": 5420 },
{ "name": "purchase_started", "count": 890 },
{ "name": "transaction_complete", "count": 312 }
],
"overallConversion": 0.0576
}Revenue
GET /v1/projects/:id/analytics/revenueReturns revenue data grouped by time period, optionally broken down by product or campaign.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
start_date | string | Yes | Start date |
end_date | string | Yes | End date |
group_by | string | No | Time grouping: day, week, month. Default: day |
breakdown | string | No | Break down by product or campaign |
Example
curl "https://agentwallie.com/api/v1/projects/PROJECT_ID/analytics/revenue?start_date=2025-03-01&end_date=2025-03-15&group_by=week&breakdown=product" \
-H "Authorization: Bearer sk_your_private_key"Response 200 OK
{
"periods": [
{
"period": "2025-03-03",
"revenue": 4200.00,
"breakdown": [
{ "key": "annual_pro", "revenue": 3150.00 },
{ "key": "monthly_pro", "revenue": 1050.00 }
]
},
{
"period": "2025-03-10",
"revenue": 5100.00,
"breakdown": [
{ "key": "annual_pro", "revenue": 3825.00 },
{ "key": "monthly_pro", "revenue": 1275.00 }
]
}
],
"total": 9300.00
}Cohorts
GET /v1/projects/:id/analytics/cohortsReturns cohort-based retention data.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
start_date | string | Yes | Start date |
end_date | string | Yes | End date |
cohort_period | string | No | Cohort grouping: week or month. Default: month |
Example
curl "https://agentwallie.com/api/v1/projects/PROJECT_ID/analytics/cohorts?start_date=2025-01-01&end_date=2025-03-15&cohort_period=month" \
-H "Authorization: Bearer sk_your_private_key"Response 200 OK
{
"cohorts": [
{
"period": "2025-01",
"initialUsers": 1200,
"retention": [1.0, 0.72, 0.61]
},
{
"period": "2025-02",
"initialUsers": 1450,
"retention": [1.0, 0.68]
}
]
}Flexible Query
POST /v1/projects/:id/analytics/queryA flexible analytics query endpoint for custom metric analysis.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
metric | string | Yes | opens, conversions, or revenue |
group_by | string | Yes | campaign, paywall, product, or date |
granularity | string | No | Time granularity when group_by is date: day, week, month |
filters.start_date | string | Yes | Start date |
filters.end_date | string | Yes | End date |
filters.campaign_id | string | No | Filter by campaign |
filters.paywall_id | string | No | Filter by paywall |
Example
curl -X POST https://agentwallie.com/api/v1/projects/PROJECT_ID/analytics/query \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk_your_private_key" \
-d '{
"metric": "conversions",
"group_by": "paywall",
"filters": {
"start_date": "2025-03-01",
"end_date": "2025-03-15"
}
}'Response 200 OK
{
"metric": "conversions",
"groupBy": "paywall",
"results": [
{ "key": "Premium Upgrade", "value": 187 },
{ "key": "Trial Offer", "value": 125 }
]
}