> Documentation index: https://docs.zernio.com/llms.txt. Every page is also Markdown: add .md to its URL.

# Analytics

Read the daily impressions, clicks and spend Zernio syncs from Reddit for an ad, with CTR, CPC and CPM.

Zernio syncs impressions, clicks and spend per ad and day from Reddit, in the ad account's time zone, and derives CTR, CPC and CPM from them.

## Read ad analytics

Call `GET /v1/ads/{adId}/analytics` with the ad's `id` ([Get ad analytics](/ad-insights/get-ad-analytics)).

<Tabs items={['Node.js', 'Python', 'curl']}>
<Tab value="Node.js">
```typescript
const { data: insights } = await zernio.adinsights.getAdAnalytics({
  path: { adId: '66f0a1b2c3d4e5f6a7b8c9d0' },
  query: { fromDate: '2027-01-04', toDate: '2027-01-11' }
});

console.log(insights.analytics.summary.spend);
```
</Tab>
<Tab value="Python">
```python
insights = client.ad_insights.get_ad_analytics(
    ad_id="66f0a1b2c3d4e5f6a7b8c9d0",
    from_date="2027-01-04",
    to_date="2027-01-11",
)

print(insights["analytics"]["summary"]["spend"])
```
</Tab>
<Tab value="curl">
```bash
curl "https://zernio.com/api/v1/ads/66f0a1b2c3d4e5f6a7b8c9d0/analytics?fromDate=2027-01-04&toDate=2027-01-11" \
  -H "Authorization: Bearer $ZERNIO_API_KEY"
```
</Tab>
</Tabs>

Response (`200`), trimmed:

```json
{
  "ad": { "id": "66f0a1b2c3d4e5f6a7b8c9d0", "name": "Planner launch", "platform": "reddit", "status": "active", "currency": "USD" },
  "analytics": {
    "summary": { "spend": 318.4, "impressions": 142600, "clicks": 1870, "ctr": 1.31, "cpc": 0.17, "cpm": 2.23 },
    "daily": [ { "date": "2027-01-04", "spend": 45.2, "impressions": 20100, "clicks": 262 } ]
  }
}
```

`GET /v1/ads/tree` rolls the same metrics up per campaign and ad group ([Get campaign tree](/ad-campaigns/get-ad-tree)).

## How it behaves

- Those 3 metrics are the whole sync: `reach`, video and conversion metrics stay 0 on Reddit.
- When the account connects, Zernio imports its last 90 days of metrics. `summary` and `daily` hold no data for days before that, because only Meta backfills an older range on request.
- The demographic `breakdowns` parameter is not available on Reddit.
- Ads created in Reddit Ads Manager sync too, so `GET /v1/ads?platform=reddit` lists every ad in the synced ad accounts.

## If it fails

| Error | Cause | Fix |
|-------|-------|-----|
| `404` | The `adId` is not an ad of your account | Use the `id` from `GET /v1/ads` or the create response. |
| `reach` or a conversion metric is 0 | Reddit syncs only impressions, clicks and spend | Read those, and the CTR, CPC and CPM derived from them. |

## Related

- [Get ad analytics](/ad-insights/get-ad-analytics): metrics, date ranges and rollups.
- [Get campaign tree](/ad-campaigns/get-ad-tree): metrics per campaign and ad group.
- [Send a conversion event](/platforms/reddit-ads/conversions): server-side events to a Reddit pixel.
- [Create a campaign](/platforms/reddit-ads/create-ads): the ads these metrics describe.