Zernio
APIFor you
Zernio
APIFor you
Platforms

X Ads

Overview

Build

Create a campaignPromote a post

Target

TargetingTailored Audiences

Measure

AnalyticsX Pixel

Operate

Manage ads

Reference

Limits & errors
Dashboard
OverviewPlatformsAPI ReferenceResources
X Ads

Analytics

Read spend, impressions, clicks, CTR, CPC and CPM for an X ad over a date range.


Zernio syncs the performance of every X ad and serves it per ad, or rolled up per campaign and line item.

Read ad analytics

Call GET /v1/ads/{adId}/analytics with the ad's _id for spend, impressions, clicks, CTR, CPC and CPM over a date range (Get ad analytics).

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);

Response (200), trimmed:

{
  "ad": { "id": "66f0a1b2c3d4e5f6a7b8c9d0", "name": "Q2 product awareness", "platform": "twitter", "status": "active", "currency": "USD" },
  "analytics": {
    "summary": { "spend": 421.7, "impressions": 203800, "clicks": 3140, "ctr": 1.54, "cpc": 0.13, "cpm": 2.07, "engagement": 5820 },
    "daily": [ { "date": "2027-01-04", "spend": 59.8, "impressions": 29100, "clicks": 448 } ]
  }
}

Roll up per campaign

GET /v1/ads/tree rolls the same metrics up per campaign and line item (Get campaign tree).

How it behaves

  • X reports reach as 0, because Zernio does not sync it.
  • The demographic breakdowns parameter is not available on X.
  • X exposes no per-pixel or per-event counts. Conversions show as WEB_CONVERSION metrics on each ad (Read the tag).

If it fails

ErrorCauseFix
404The adId is not an ad of your accountUse the _id from GET /v1/ads or the create response.
reach is 0Zernio does not sync reach from XRead impressions instead.

Related

  • Get ad analytics: metrics, date ranges and rollups.
  • Get campaign tree: metrics per campaign and line item.
  • Read the tag: the X Pixel and its conversion events.
  • Create a campaign: the ads these metrics describe.
Was this page helpful?

Tailored Audiences

Create a Tailored Audience on an X Ads account and upload its members by email.

X Pixel

Read and create the X Pixel, manage its conversion events, check they are tracking and install it on Shopify or WordPress.

On this page

Read ad analyticsRoll up per campaignHow it behavesIf it failsRelated