Create a tracking tag (Meta Pixel)
Creates a Meta Pixel on the given ad account (POST /act_{id}/adspixels
— name is the only input). Returns the created tag including its
install code. The pixel is owned by the Business Manager that owns the
ad account; a pixel created on a personal (non-BM) ad account ends up
with ownerBusinessId: null and can't be shared with other ad accounts.
Creating a pixel does NOT install it — install the returned code
snippet on the site, or send events server-side via
POST /v1/ads/conversions. The check installed is derived from
lastFiredTime.
NOT idempotent: each call creates a new pixel. Do not retry blindly on
timeout. Meta only (platform metaads); other platforms return 405.
API key authentication - use your Zernio API key as a Bearer token
In: header
Path Parameters
Meta ads SocialAccount id (platform metaads).
Meta ad account id, e.g. act_123456789.
1 <= length <= 200Response Body
application/json
application/json
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.trackingtags.createTrackingTag({ path: { accountId: 'account_abc123', }, body: { adAccountId: 'adaccount_abc123', name: 'Example', },});console.log(data);{
"platform": "metaads",
"tag": {
"id": "string",
"name": "string",
"platform": "metaads",
"kind": "pixel",
"status": "active",
"code": "string",
"lastFiredTime": 0,
"isUnavailable": true,
"installed": true,
"creationTime": 0,
"ownerBusinessId": "string",
"ownerAdAccountId": "string"
}
}{
"error": "Unauthorized"
}List tracking tags (Meta Pixels) GET
Returns the tracking tags (Meta Pixels) the connected ads account can see. Pass `?adAccountId=act_...` to scope the list to a single ad account; omit it to list every pixel reachable by the token (the name is then suffixed with the ad account it was discovered on, for disambiguation). The list view omits `code` — call `getTrackingTag` for the install snippet and full detail. Meta only today (platform `metaads`); other platforms return 405. The `accountId` must be the Meta *ads* SocialAccount created by the Ads add-on connect flow, not a Facebook/Instagram posting account. Get your `act_...` ids from `GET /v1/ads/accounts`.
Aggregated event stats for a tracking tag (Meta Pixel) GET
Returns aggregated event counts for the pixel (`GET /{pixel_id}/stats`). Rows are passed through from Meta as-is — their shape depends on the `aggregation` requested. Meta only (platform `metaads`); other platforms return 405.