← All articles
8 min read

How to Connect TikTok Events API to AffPixel (Step-by-Step, 2026)

A practical walkthrough for connecting TikTok Events API to AffPixel — create a pixel, generate an Access Token, capture ttclid through your SubID, and send a safe test event.

This guide shows you how to connect your TikTok Ads account to AffPixel so confirmed affiliate conversions are pushed back to TikTok through the Events API (server-to-server). You only need two values, entered on /settings → TikTok Events API: Pixel Code and Access Token. The whole setup takes about 10 minutes.

What you need before starting

  • A TikTok Ads Manager account with an active (or planned) campaign.
  • An AffPixel account with your postback URL (find it on /settings).
  • Access to your landing page so you can capture the ttclid click parameter.

1. Create a TikTok Pixel (Events Manager)

  1. Log in to TikTok Ads ManagerAssets EventsWeb EventsManage.
  2. Click Create Pixel, name it (e.g. AffPixel S2S), and choose Manually install pixel code.
  3. Finish the wizard — you do not need to paste the browser snippet if you only send server events, but installing it on your landing page improves match quality.
  4. Copy the Pixel ID / Pixel Code shown at the top of the pixel's settings page (a long alphanumeric string).

2. Generate the Events API Access Token

  1. Still inside your pixel in Events Manager, open the Settings tab.
  2. Scroll to Events API and click Generate Access Token.
  3. Copy the token immediately and store it somewhere safe — TikTok shows it only once. If you lose it, generate a new one (the old one keeps working until revoked).

Keep this token secret. In AffPixel it is stored server-side only and is never sent back to the browser or written to logs.

3. Save the credentials in AffPixel

  1. Go to /settings and find the TikTok Events API card.
  2. Paste the Pixel Code and the Access Token.
  3. Turn on Enabled and click Save.

4. Capture ttclid so TikTok can match the click

TikTok appends a ttclid parameter to your landing page URL when someone clicks your ad. AffPixel sends it back with the conversion so TikTok can attribute the event to the original click. If the ttclid is missing, TikTok falls back to weaker matching and your reported conversions drop.

Two ways to carry it through your affiliate flow:

  • Recommended: use AffPixel short links for your TikTok ads — they capture click IDs automatically.
  • Manual: read ttclid on your landing page and pass it as the network's SubID (see the SubID format in Pass _fbc / _fbp through SubId). The combined format is {fbc}_{ttclid}_{gclid}_{fbp} — ttclid is slot 2.

5. Give AffPixel's postback URL to your network

  1. Copy your postback URL from /settings → Postback URLs.
  2. Paste it into your affiliate network's postback/S2S settings, mapping the network's macros for order id, payout and your SubID.
  3. When the network fires the postback, AffPixel records the conversion and forwards a server event to TikTok with the ttclid.

6. Send a test event

  1. In TikTok Events Manager, open your pixel → Test Events tab and keep it open.
  2. In AffPixel, trigger a test conversion (Settings → Test postback or a real test order through your network).
  3. Within a minute you should see the event appear under Test Events in TikTok. If it shows up there, your pipeline is live — future events appear under the pixel's Overview.

Common errors and fixes

  • 401 / "Access token is invalid" — the token was copied with a stray space, or was revoked. Generate a new token in step 2.
  • "Pixel code is incorrect" — you pasted the pixel name instead of the ID. Copy the alphanumeric Pixel Code from the pixel settings page.
  • Events arrive but never attribute — the ttclid is missing or truncated. Check your SubID mapping and make sure the parameter survives URL encoding.
  • Nothing in Test Events — confirm the TikTok card in AffPixel is Enabled and the conversion you fired actually reached AffPixel (check the conversions list on your dashboard first).
  • Duplicate events — if you also fire a browser pixelCompletePayment event, add a shared event_id so TikTok deduplicates browser and server events.

What's next

New to postbacks? Start with What Is a Postback URL? and Server-to-Server vs Pixel Tracking. Running Meta too? See Facebook Conversions API for Affiliates.