OverviewProductsPlatformsAPI ReferenceResources
Campaign Results

Name a result metric or define a formula

PUThttps://zernio.com/api/v1/ads/campaign-results/metrics/{key}

Sets a metric key's label and kind: count for things you count (leads, sales), money with its currency (revenue), percent or ratio.

Send formula to make it a computed metric: + - * / and parentheses over spend, impressions, clicks, conversions, purchase_value and the metrics you send, at most 200 characters. A formula cannot read another formula.

It is computed per campaign over the summed values of the range, and has no value when an input is missing or a division is by zero.

PlatformsMetaGoogleTikTokLinkedInPinterestXReddit

Authentication

AuthorizationBearer tokenRequired

API key authentication: send your Zernio API key in the Authorization header, prefixed with Bearer.

Path parameters

keystringRequired

Body

application/json

What every request needs

labelstring, max 80Required
kindstringRequiredOne of count | money | percent | ratio
Optional parameters2 fields
currencystring or null

ISO 4217, money metrics only.

formulastring or null, max 200

Makes it a computed metric. Null or absent for a number you send.

Responses

Success· the request worked

Errors· the request failed

PUT/v1/ads/campaign-results/metrics/{key}
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.adcampaignresults.setCampaignResultMetric({  path: {    key: 'tok_abc123',  },  body: {    label: 'Qualified leads',    kind: 'count',  },});console.log(data);
{  "metric": {    "key": "string",    "label": "string",    "kind": "count",    "currency": "string",    "formula": "string",    "builtIn": true  }}
OpenAPI specification
Was this page helpful?