Campaign Analytics
Campaigns
Campaign Analytics
Per-campaign donation analytics with trend data, top donors, and breakdowns.
GET
Campaign Analytics
Campaign Analytics
Returns detailed analytics for a single campaign. Includes a daily donation trend, top donor list, payment method breakdown, frequency breakdown, UTM source breakdown, and peak donation hour.Path Parameters
The campaign ID to retrieve analytics for.
Query Parameters
The organization ID. Used to verify the authenticated user’s access to this campaign.
ISO 8601 start date for the daily trend window (e.g.,
"2026-02-01"). Defaults to 30 days ago.ISO 8601 end date for the daily trend window (e.g.,
"2026-03-04"). Defaults to today.Authentication
Requires a valid Clerk session JWT in the
Authorization: Bearer header. The authenticated user must be a member of the organization that owns this campaign.Response
Core campaign metadata.
Aggregated totals across all succeeded donations for this campaign (all-time, not filtered by date range).
Daily donation data for the requested date range. One entry per calendar day, pre-filled with zeros for days with no donations.
Up to 10 top donors by total amount given to this campaign. Last names are truncated to an initial for privacy.
Breakdown of succeeded donations by payment method.
Breakdown of succeeded donations by giving frequency.
Up to 5 top UTM sources by total amount raised, for donations that have a
utmSource value.The UTC hour of day (0–23) that received the most donations across all time.
null if the campaign has no donations.Example
Error Responses
| Status | Error | Description |
|---|---|---|
| 400 | Validation failed | orgId is missing or invalid. |
| 401 | Unauthorized | Missing or invalid Authorization header. |
| 403 | Forbidden | Authenticated user is not a member of the specified org. |
| 404 | Campaign not found | No campaign with this ID exists for the given org. |