Get campaign analytics
Changed onReturns a campaign's performance summary and daily timeline, with optional breakdowns by age, gender and other audience dimensions.
Returns performance analytics for a whole campaign in one call: summary metrics, a daily timeline over the requested date range (summed across the campaign's ads), and optional demographic breakdowns. Breakdowns are fetched live from Meta, TikTok or LinkedIn at the campaign level (one call per dimension, no per-ad fan-out), so an agency dashboard gets campaign-level age/gender/placement/etc. without summing thousands of per-ad reads. campaignId is the platform campaign id; pass platform when a campaign id could be ambiguous across platforms. If no date range is provided, defaults to the last 90 days. Date range is capped at 730 days max.
History: when an ad account connects, Zernio imports its last 90 days of metrics. summary and daily come from those synced metrics, so they hold no data for days before that. Breakdowns and Google's impression share are read live from the platform over the requested range, so they are not limited by the import. When the campaign belongs to a Meta ad account, a range reaching further back answers 202 with backfillPending: true and the covered part while the older days (up to 730 days back) are imported in the background; repeat the request until it returns 200. Other platforms never return 202.
Google adds searchImpressionShare, searchBudgetLostImpressionShare, searchRankLostImpressionShare, searchTopImpressionShare and searchAbsoluteTopImpressionShare under analytics.summary for the requested inclusive range. These ratios are queried together without daily segmentation and cached for 10 minutes. Unavailable values are null. analytics.impressionShareCache reports cachedAt and stale independently of synced metrics.
Request
- Base URL: https://zernio.com/api
- URL: https://zernio.com/api/v1/ads/campaigns/{campaignId}/analytics
- Auth: HTTP bearer
Path parameters
Platform campaign id (platformCampaignId).
Query parameters
Disambiguate when the campaign id exists across platforms (e.g. facebook, instagram).
Start of date range (YYYY-MM-DD). Defaults to 90 days ago.
End of date range (YYYY-MM-DD). Defaults to today. Max 730-day range.
Comma-separated breakdown dimensions.
Meta: age, gender, country, publisher_platform, device_platform, region, platform_position, impression_device, video_asset, image_asset, body_asset, title_asset.
TikTok: gender, age, country (or country_code), publisher_platform (or platform), ac, language, placement. TikTok serves at most 365 days per breakdown, so a longer range is read over its last 365 days and analytics.breakdownsRange says which window.
LinkedIn (firmographics): job_title, job_function, seniority, industry, company, company_size, country, region. Rows carry the raw pivot value plus a resolved name. LinkedIn serves these aggregated over the whole range, delays the data 12-24h, and omits segments with fewer than 3 events.
A known dimension the platform cannot break down by is listed in analytics.unsupportedBreakdowns instead of being dropped (with guidance in analytics.breakdownHints where there is an alternative); the rest of the response is unchanged. An unknown name returns 400. A TikTok dimension that fails is listed in analytics.breakdownErrors and the response stays 200. Metrics TikTok refuses for a dimension are listed in analytics.breakdownDroppedMetrics, and the row values derived from them are null.
Response
Campaign analytics
Example response
{
"analytics": {
"summary": {
"actions": {
"link_click": 160,
"post_engagement": 300,
"offsite_conversion.fb_pixel_purchase": 42
},
"actionValues": {
"offsite_conversion.fb_pixel_purchase": 2456.78,
"offsite_conversion.fb_pixel_add_to_cart": 980.5
},
"costPerAction": {
"link_click": 0.1052,
"offsite_conversion.fb_pixel_purchase": 4.0114
}
},
"daily": [
{
"actions": {
"link_click": 160,
"post_engagement": 300,
"offsite_conversion.fb_pixel_purchase": 42
},
"actionValues": {
"offsite_conversion.fb_pixel_purchase": 2456.78,
"offsite_conversion.fb_pixel_add_to_cart": 980.5
},
"costPerAction": {
"link_click": 0.1052,
"offsite_conversion.fb_pixel_purchase": 4.0114
}
}
],
"breakdownDroppedMetrics": {
"publisher_platform": [
"total_purchase",
"total_purchase_value",
"total_initiate_checkout_value"
]
}
}
}Changes
- info
added the optional property
/////to the response with the status - info
added the optional property
/////to the response with the status - info
added the optional property
/////to the response with the status - info
added the optional property
/////to the response with the status - info
added the optional property
/////to the response with the status - info
added the optional property
/to the response with the status - info
added the optional property
/to the response with the status - info
added the optional property
/to the response with the status - info
added the optional property
/to the response with the status - info
added the optional property
/to the response with the status
- info
- info
added the optional property
///////////to the response with the status - info
added the optional property
///////////to the response with the status - info
added the optional property
///////////to the response with the status - info
added the optional property
//////////to the response with the status - info
added the optional property
//////////to the response with the status - info
added the optional property
//////////to the response with the status - info
added the optional property
///////to the response with the status - info
added the optional property
///////to the response with the status - info
added the optional property
///////to the response with the status - info
added the optional property
//////to the response with the status - info
added the optional property
//////to the response with the status - info
added the optional property
//////to the response with the status
- info