Hanzo
OpenapiCampaign

Returns a campaign's results over a window: the analytics funnel (impressions,…

Returns a campaign's results over a window: the analytics funnel (impressions, clicks, conversions, revenue, visitors), the spend each channel's connector…

GET /v1/campaign/{id}/metrics

Addresshttps://api.hanzo.ai/v1/campaign/{id}/metrics
MethodGET
Operationget_campaign_by_id_metrics
AuthAuthorization: Bearer $HANZO_API_KEY

Returns a campaign's results over a window: the analytics funnel (impressions, clicks, conversions, revenue, visitors), the spend each channel's connector reports, and the derived growth KPIs — CTR, CVR, CAC and ROAS.

There is exactly ONE metrics plane and nothing is stored here: the funnel is an analytics query over the campaign's utm_campaign-tagged events, and the spend is each provider's own number read through the org's connector. A warehouse that is not emitting yet degrades to available:false with zeroes — honest-empty, never a 500 and never a fabricated number. When the campaign runs more than one creative and an experiment is wired, abTest carries the A/B analysis.

Request

4 fields.

FieldInTypeRequiredDescription
idpathstringyesID is the campaign to report on, from the path.
rangequerystringRange is the lookback window: 24h, 7d, 30d or 90d.
startquerystringStart is an explicit RFC3339 window start.
endquerystringEnd is an explicit RFC3339 window end.

Response

StatusBodyMeaning
200campaignResultsok

200 body — 26 fields.

FieldInTypeAlwaysDescription
abTestbodyanyABTest is the creative A/B analysis from the experiments primitive (experiment.Analyze, pull-model), present only when the campaign runs more than one creative…
availablebodybooleanAvailable is false when the analytics warehouse is not connected or the query failed: the funnel below is then zero because nothing could be read, not because…
cacbodynumberCAC is customer acquisition cost: spend DOLLARS per conversion, rounded to cents.
campaignIdbodystringCampaignID is the campaign these results are for, echoed from the request.
channelsbodyChannelMetric[]Channels is the per-channel spend breakdown that SpendCents sums, one row per channel on the campaign including the ones that never launched.
channels[].externalIdbodystringExternalID is the provider-side id of the execution the spend belongs to.
channels[].kindbodystringKind is which channel this row is: paid, organic or email.
channels[].platformbodystringPlatform is the provider the spend was read from: meta, google, x, instagram, or the email provider.
channels[].spendCentsbodyintegerSpendCents is what the provider itself reports this channel spent, in CENTS.
channels[].spendErrorbodystringSpendError is why this channel's spend could not be read (connector not connected, provider error), as one secret-free line.
channels[].statusbodystringStatus is the channel's launch state on the campaign — pending, live, paused, failed or unavailable.
clicksbodyintegerClicks is the campaign's click events over the window.
conversionsbodyintegerConversions is the terminal funnel events attributed to the campaign — orders completed, signups completed, explicit conversion events.
ctrbodynumberCTR is clicks per impression, a fraction rounded to 4 places (0.0123 = 1.23%), not a percentage.
cvrbodynumberCVR is conversions per click, a fraction rounded to 4 places.
endbodystringEnd is the window's end, RFC3339 UTC — the read's own clock unless an explicit pair was given.
impressionsbodyintegerImpressions is how many times the campaign's creatives were shown, counted from its utm_campaign-tagged impression events.
namebodystringName is the campaign's display name at read time, so a result can be labelled without a second fetch.
rangebodystringRange is the window actually used: 24h, 7d, 30d, 90d, or "custom" when an explicit start/end pair was honored.
revenuebodynumberRevenue is the summed revenue attribute of the campaign's events, in whole CURRENCY UNITS (dollars) — the one money value here that is not in cents.
roasbodynumberROAS is return on ad spend: revenue per spend DOLLAR, rounded to 2 places (2.5 = 2.50backper2.50 back per 1).
sourcebodystringSource names the analytics table the funnel was read from, so an operator can see exactly what was counted.
spendCentsbodyintegerSpendCents is the campaign's total spend in CENTS: the sum of what each live channel's provider reports.
startbodystringStart is the window's inclusive start, RFC3339 UTC.
statusbodystringStatus is the campaign's lifecycle state at read time — draft, live, paused, completed or failed.
visitorsbodyintegerVisitors is how many distinct people the campaign reached, counted by event identity across ALL its events in the window — not a subset of Impressions, so it…

Failure carries the platform error shape — see Errors.

Examples

hanzo campaign metrics <id>

Campaign API · All Hanzo APIs · Interactive reference

How is this guide?

On this page