Zernio
APIFor you
Zernio
APIFor you
Platforms

TikTok Ads

Overview

Build

Create Ads

Target

Audiences & Targeting

Measure

Analytics & InsightsPixels

Operate

Manage Ads

Reference

Limits & Errors
Dashboard
OverviewPlatformsAPI ReferenceResources
TikTok Ads

Pixels

Create, configure and share TikTok Pixels, manage their events, read event counts and install them on Shopify or WordPress through the tracking tags API.


Manage TikTok Pixels through the platform-neutral tracking tags API on your tiktokads connection. You can:

  • list, read, create, rename and configure a pixel
  • manage its events
  • share it through Business Center
  • read its event counts
  • install it on a connected Shopify store or WordPress site
FieldValue
tagIdThe numeric pixel_id: what promotedObject.pixelId takes on conversion campaigns
siteTagIdThe alphanumeric pixel_code (for example D00IKHRC77UE0J0RTNHG) that ttq.load() and Events Manager use
adAccountIdThe advertiser id. Optional on per-pixel calls: without it Zernio searches every advertiser on the connection, and a pixel shared into several advertisers resolves to its owner's copy
eventsOn GET .../tracking-tags/{tagId} and GET .../events: the pixel's events with TikTok's type (SHOPPING, ON_WEB_CART, ...), the matching siteEvent, and siteEventId, the name ttq.track() fires (Purchase, AddToCart, ...)
const { data } = await zernio.trackingtags.createTrackingTag({
  path: { accountId: '66b2e19d8c3f5a7e9d0b1c2d' },
  body: { adAccountId: '7301234567890123456', name: 'Storefront pixel' }
});

Response (201):

{
  "platform": "tiktokads",
  "tag": {
    "id": "7412345678901234567",
    "siteTagId": "D00IKHRC77UE0J0RTNHG",
    "name": "Storefront pixel",
    "platform": "tiktokads",
    "kind": "pixel",
    "status": "active",
    "creationTime": 1804064400,
    "ownerAdAccountId": "7301234567890123456",
    "code": "<script>!function (w, d, t) {...}</script>",
    "events": []
  }
}

Pixel names are at most 40 characters, with no emojis.

The create is not idempotent and TikTok has no pixel delete, so never retry it blindly. List the pixels after a timeout.

Creating an event is not idempotent either. TikTok returns no id for it, and refreshes a pixel's event list only every few hours.

When the new event is not listed yet, the response carries id: "" and status: "pending". Read the events again later for its id.

OperationBehavior
Update (PATCH .../tracking-tags/{tagId})name, enableAutomaticMatching, automaticMatchingFields (Meta's codes folded onto TikTok's email, phone, name, address and external id switches; gender and date of birth answer 400), and first-party cookies as enableFirstPartyCookies (boolean) or firstPartyCookieStatus. Other fields answer 400.
Stats (GET .../stats)Per-event counts from TikTok's /pixel/event/stats, 7 days by default and at most 30 per request, bucketed by whole UTC days. TikTok reports no last-fired time.
Share (.../shared-accounts)Business Center pixel links: list, link and unlink advertisers. The pixel must be an asset of a Business Center the connection manages (its owner Business Center, or one of the connection's); otherwise 400 asking you to transfer it into Business Center (Assets, Events). sharedAccounts[].businessId is the Business Center.
Conversion events (.../events)List, create and update the pixel's events. Create takes type (TikTok's event type) or siteEvent, plus optional name, defaultValue and currency (USD, JPY or INR). Update changes name, defaultValue and currency only: TikTok cannot change an event's type, so create a new event instead. DELETE answers 501 platform_not_supported: TikTok's delete call reports success without removing the event, so delete events in TikTok Events Manager.
Diagnostics501: TikTok has no pixel diagnostics endpoint (/pixel/diagnostic/, /pixel/diagnostics/ and /pixel/health/ answer 404). Use the stats or Events Manager.
Users and partners501.
DeleteNot offered: TikTok has no pixel delete endpoint (/pixel/delete/ answers 404, and it is not in TikTok's SDK specs).
InstallShopify and WordPress. WordPress gets TikTok's base code (ttq.load plus ttq.page); Shopify sends each storefront event to analytics.tiktok.com/api/v2/pixel, the endpoint TikTok's own pixel script calls (undocumented), with the ttclid click id kept first-party, the _ttp browser id reused and an event id for dedup with the Events API.

A connection authorized before TikTok's Pixel Management permission answers every pixel call with 403. Reconnect TikTok Ads to grant it.

Was this page helpful?

Analytics & Insights

Read spend, views and CTR for a TikTok ad with breakdowns, and run live TikTok reports for de-duplicated reach.

Manage Ads

Add ads to an existing TikTok ad group, moderate ad comments, swap creatives, update targeting, duplicate campaigns and list agency Business Centers.