# Analytics

What Zernio reads from The Trade Desk today: campaigns, ad groups, creatives and their statuses. Spend and other metrics are not synced yet.

Zernio syncs The Trade Desk's campaigns, ad groups and creatives with their statuses, but no metrics yet: The Trade Desk's public samples do not show the report columns Zernio would read.

## Read ad analytics

`GET /v1/ads/tree` returns every campaign, ad group and ad of an advertiser with its status. Their metrics stay empty for The Trade Desk.

```bash
curl "https://zernio.com/api/v1/ads/tree?accountId=ACCOUNT_ID&adAccountId=abc1234" \
  -H "Authorization: Bearer $ZERNIO_API_KEY"
```

Read spend, impressions and clicks in The Trade Desk until Zernio syncs them.

## How it behaves

- An ad group is `active` when it is enabled in The Trade Desk. A campaign is `active` while one of its ad groups is.
- Once a campaign is archived, it and everything under it read as `cancelled`.
- Each creative an ad group serves is one ad, with id `<adGroupId>:<creativeId>` on The Trade Desk.
- A listing that comes back cut short never marks campaigns as gone.

## If it fails

| Error | Cause | Fix |
|-------|-------|-----|
| A campaign made in The Trade Desk is missing | The sync has not run since | Call `POST /v1/ads/sync` or wait for the next sync. |
| An empty tree | `adAccountId` is not one of the connection's advertisers | Use an id from `GET /v1/ads/accounts`. |

## Related

- [Get campaign tree](/ad-campaigns/get-ad-tree)
- [List ads](/ad-campaigns/list-ads)
- [Conversions](/platforms/the-trade-desk/conversions)