Skip to content

Campaign Performance

Endpoint

GET /api/v1/analytics/campaign-performance?from=&to=&campaign=

Returns rollup metrics for one campaign — or all campaigns if campaign is omitted.

What it returns

For each campaign:

  • posts — count of posts inside the campaign in the window.
  • impressions, likes, comments, shares, reach — sums from post_stats.
  • engagement_rate — weighted average across the campaign's snapshots.
  • short_link_clicks — sum of click counts for short links bound to campaign posts.
  • postSucceed, postFailed — direct counters from the post_campaigns document (incremented at publish time).

Sister surfaces

  • Engagement accepts campaign=<id> to plot a single campaign's trend over time.
  • Short Link Stats — drill into per-link clicks for any short URL inside the campaign.

Setting up a campaign

Posts join a campaign by including campaign: <id> in the body of POST /api/v1/posts. See Composer → Campaigns.