Returns the performance of each campaign, ad set, or ad of a property for a date range of up to 31 days. Each row combines ad platform metrics (spend, impressions) with the events that AnyTrack tracked.
Metrics
Section titled “Metrics”Ask for metrics by name in metrics. Each row returns a nested metrics object, for example data[0].metrics.spend. The first page returns requested totals directly in summary, for example summary.spend. Dynamic names are literal keys, for example data[0].metrics[“events.Purchase”] and summary[“events.Purchase”]. Money metrics aggregate stored reporting values; the configured reporting currency belongs to the property.
| Metric | Value | Source |
|---|---|---|
spend | Amount spent on the ads. | Ad platform |
impressions | Number of times the ads were shown. | Ad platform |
reach | Sum of ad-platform reach across the requested dates; a person may be counted on multiple days. | Ad platform |
linkClicks | Number of clicks on the ad links. | Ad platform |
results | Results that the ad platform attributes to the ads, for the campaign objective. | Ad platform |
resultValues | Value of the results that the ad platform attributes to the ads. | Ad platform |
sessions | Number of sessions that AnyTrack tracked. | AnyTrack |
clients | Approximate number of distinct property-scoped client IDs (browsers). | AnyTrack |
eventValues | Sum of the values of the conversion events. | AnyTrack |
events.<EventName> | Number of events with this name, for example events.Purchase. | AnyTrack |
frequency | impressions ÷ reach. | Calculated |
cpm | 1,000 × spend ÷ impressions. | Calculated |
cpc | spend ÷ linkClicks. | Calculated |
ctr | linkClicks ÷ impressions, as a ratio: 0.02 is 2%. | Calculated |
roas | eventValues ÷ spend. | Calculated |
cpe.<EventName> | spend ÷ the number of events with this name. | Calculated |
A calculated metric is null when its divisor is zero, negative, or unavailable, or another required input is unavailable. Unavailable ad platform metrics are also null. AnyTrack gets spend, impressions, reach, link clicks, and results from Meta Ads, Google Ads, TikTok Ads, ChatGPT Ads, and Microsoft Ads. Taboola and Outbrain campaigns have no ad platform metrics.
Before you call
Section titled “Before you call”This endpoint needs IDs that other endpoints return:
- Call List the account properties. Copy the
idof the property: it is thepropertyId. - Call this endpoint with these IDs.
Authentication
Section titled “Authentication”bearerAuth: API key created in the dashboard (atk_…). Send it in the Authorization: Bearer YOUR_API_KEY header.
Path parameters
Section titled “Path parameters”propertyIdstringrequiredlistProperties (id).Request body
Section titled “Request body”fromstring · daterequired2026-01-31tostring · daterequiredto must be on or after from.2026-01-31attributionstringlast-ad-click gives the credit to the last ad click before the conversion. first-ad-click gives the credit to the first ad click.last-ad-click first-ad-clickDefault last-ad-clickgroupBystringcampaign, adset (ad set), or ad.campaign adset adDefault campaignmetricsarray of stringsummary. Use the metric names in the Metrics section, events.<EventName>, or cpe.<EventName>. AnyTrack removes duplicate names.1Max items 20Item max length 80conversionEventsarray of stringeventValues and roas. Defaults to the property conversion events, or Purchase if none are configured. Other named event metrics are independent of this selection.1Max items 20Item min length 1Item max length 64filtersobjectShow 6 child attributes
channelarray of stringchannel values of the report rows. With this filter, rows that have spend but no tracked event are not included.1Max items 50Item min length 1Item max length 256platformarray of string1Max items 50Item min length 1Item max length 256adNetworkarray of stringadNetwork values of the report rows.1Max items 50Item min length 1Item max length 256campaignIdsarray of stringid of rows grouped by campaign.1Max items 50Item min length 1Item max length 256adsetIdsarray of stringid of rows grouped by adset.1Max items 50Item min length 1Item max length 256adIdsarray of stringid of rows grouped by ad.1Max items 50Item min length 1Item max length 256sortobjectShow 2 child attributes
metricstringrequiredevents.<EventName> or cpe.<EventName>.spend impressions reach frequency linkClicks sessions clients eventValues results resultValues cpm cpc ctr roasdirectionstringdesc: highest value first. asc: lowest value first.asc descDefault desclimitinteger50Min 1Max 100cursorstringnextCursor from the previous page. Keep the property and query fields unchanged. limit may change where supported. Pages are not snapshot-consistent.1Max length 2048Responses
Section titled “Responses”Every response field is present unless it shows optional. A type that ends in | null can be null.
200 Successful response
Section titled “200 Successful response”dataarray of objectShow 7 child attributes
idstringfilters.campaignIds, filters.adsetIds, or filters.adIds to filter a report.typestringgroupBy value of the request.campaign adset adnamestring | nullchannelstring | nullfilters.channel.adNetworkstring | nullfilters.adNetwork.statusstring | nullnull when the ad platform does not give a status.active paused terminatedmetricsmap of (number | null)events.Purchase). A value is null when its inputs are unavailable or its divisor is not positive. See the operation Metrics section for formulas.nextCursorstring | nullcursor with the same query to get the next page. null on the last page.reportobjectShow 8 child attributes
propertyIdstringfromstringtostringtimezonestringcurrencystringattributionstringlast-ad-click first-ad-clickgroupBystringcampaign adset adconversionEventsarray of stringsummarymap of (number | null) | nullsummary.spend or summary[“events.Purchase”]). Returned on the first page when available; later pages return null. Do not add summary values to page rows.Errors
Section titled “Errors”Every error returns the error object.
| Status | Description and action |
|---|---|
400 | invalid_request, invalid_cursor: A parameter or a body field is not valid, or the cursor belongs to a different query. Correct the request. error.details, when present, names invalid fields. Do not reuse a cursor with a different query. |
401 | unauthenticated: Missing, invalid or deleted API key. Send a valid key in Authorization: Bearer. MCP uses an OAuth access token, which may also expire or be revoked. |
403 | api_access_unavailable: API access is disabled for this account. Contact AnyTrack support. OAuth requests also require the anytrack:read scope (insufficient_scope). |
404 | not_found: An ID does not exist, or it belongs to a different account. The API gives the same error for both. Check the IDs. Get them again from the list endpoints. |
413 | payload_too_large: The request body is larger than 16 KB. Send a smaller request body. |
429 | rate_limited: The account sent more than 60 requests in one minute. Wait for the number of seconds in the Retry-After header, then retry. |
500 | response_too_large, internal_error: The response is larger than 1 MB, or the API has an internal error. For response_too_large, ask for fewer rows or metrics. For internal_error, contact AnyTrack support with the requestId. |
503 | service_unavailable: The service is not available for a short time. Retry later, and wait longer after each failed retry. |
504 | upstream_timeout: A downstream request timed out (the report client timeout is 65 seconds). Narrow the date range, then retry with backoff. |
Request example
Section titled “Request example”Command template. Replace the path placeholders. Put the request body in request-body.json, as in the schema above. Add the query parameters that you need. This is not a recorded request or response.
curl --request POST 'https://api.anytrack.io/v1/properties/{propertyId}/reports/campaigns' \ --header 'Authorization: Bearer YOUR_API_KEY' \ --header 'Content-Type: application/json' \ --data @request-body.json