{"schemaVersion":"2.0.0","defaultLanguage":"en","languages":["en"],"launchScreenId":"article_screen_7fT1WnM4yBtrcYQazNhz","screens":{"article_screen_7fT1WnM4yBtrcYQazNhz":{"id":"article_screen_7fT1WnM4yBtrcYQazNhz","name":"Set up the TikTok Pixel and Events API","tags":["article"],"screenType":"FlexibleLayout","position":{"x":0,"y":0},"content":{"canvas":{"background":{"kind":"solid","content":{"color":"#F7F8FA"}},"insets":{"top":0,"end":0,"bottom":0,"start":0},"webViewBackgroundColor":"#F7F8FA"},"animated":false,"offlineFirst":true,"flexibleLayout":{"scrollable":true,"insets":{"top":48,"end":32,"bottom":56,"start":32},"sections":[{"id":"intro","order":0,"kind":"Text","label":"Set up the TikTok Pixel and Events API","layout":{"heightKind":"auto"},"textContent":{"title":{"translations":{"en":"Set up the TikTok Pixel and Events API"},"kind":"static","appearance":{"align":"start","fontSize":30,"fontWeight":800,"lineHeight":36,"color":"#101828"}},"subtitle":{"translations":{"en":"Connect both TikTok tracking pieces so TikTok Ads can optimize on real conversions from your funnel."},"kind":"static","appearance":{"align":"start","fontSize":17,"fontWeight":400,"lineHeight":26,"color":"#475467"}}}},{"id":"tiktok-pixel-events-api-setup-where-this-fits","order":1,"kind":"Text","label":"Where this fits in launch","layout":{"heightKind":"auto","margin":{"top":28}},"textContent":{"title":{"translations":{"en":"Where this fits in launch"},"kind":"static","appearance":{"align":"start","fontSize":21,"fontWeight":750,"lineHeight":28,"color":"#101828"}},"subtitle":{"translations":{"en":"This is step 4 of getting your funnel ready for ads, and it is optional — it is the TikTok version of the Facebook Pixel setup. Do it only if you plan to run TikTok ads. Before this, you should already have Stripe connected, a paywall product attached, and email passing set up (step 3). After this, you will choose which conversion events to send (see Send the right TikTok events), then publish and run a test purchase (step 5). If you are advertising on Meta instead, set up the Facebook Pixel and Conversions API instead."},"kind":"static","appearance":{"align":"start","fontSize":16,"fontWeight":400,"lineHeight":25,"color":"#344054"}}}},{"id":"tiktok-pixel-events-api-setup-two-integrations","order":2,"kind":"Text","label":"TikTok needs two integrations, not one","layout":{"heightKind":"auto","margin":{"top":20}},"textContent":{"title":{"translations":{"en":"TikTok needs two integrations, not one"},"kind":"static","appearance":{"align":"start","fontSize":21,"fontWeight":750,"lineHeight":28,"color":"#101828"}},"subtitle":{"translations":{"en":"TikTok tracking comes in two parts, and you need both for ads to optimize well. The TikTok Pixel runs in the visitor's browser and reports activity as people move through your funnel. The TikTok Events API runs on Segmently's servers and reports confirmed purchases straight from Stripe, so a sale is still counted even if the browser blocks the pixel. Both are required to reliably optimize TikTok ads on conversions. You will add each one separately in Segmently's analytics settings."},"kind":"static","appearance":{"align":"start","fontSize":16,"fontWeight":400,"lineHeight":25,"color":"#344054"}}}},{"id":"tiktok-pixel-events-api-setup-get-credentials","order":3,"kind":"Text","label":"Get your credentials from TikTok","layout":{"heightKind":"auto","margin":{"top":20}},"textContent":{"title":{"translations":{"en":"Get your credentials from TikTok"},"kind":"static","appearance":{"align":"start","fontSize":21,"fontWeight":750,"lineHeight":28,"color":"#101828"}},"subtitle":{"translations":{"en":"You collect both values in TikTok Events Manager (in your TikTok Ads account), not in Segmently. Required: your pixel's identifier — the value for the pixel you created in Events Manager. (Segmently shows this same value under two labels: 'Pixel ID' in the browser-side Pixel editor and 'Pixel Code' in the Events API editor.) Required for the server side: an Access Token, which you generate in Events Manager for the same pixel. Keep both handy — you will paste them into Segmently in the next two steps. Treat the Access Token like a password and do not share it."},"kind":"static","appearance":{"align":"start","fontSize":16,"fontWeight":400,"lineHeight":25,"color":"#344054"}}}},{"id":"tiktok-pixel-events-api-setup-add-pixel","order":4,"kind":"Text","label":"Add the TikTok Pixel (browser side)","layout":{"heightKind":"auto","margin":{"top":20}},"textContent":{"title":{"translations":{"en":"Add the TikTok Pixel (browser side)"},"kind":"static","appearance":{"align":"start","fontSize":21,"fontWeight":750,"lineHeight":28,"color":"#101828"}},"subtitle":{"translations":{"en":"In Segmently, open Settings, go to Analytics, and add the TikTok Pixel integration. This one is required. Paste your Pixel ID — that is the field's exact label in the Pixel editor, and it is the only required value here (there is also an optional Advanced Matching block; see below). Note the wording carefully: the browser-side editor labels this field 'Pixel ID', while the Events API editor in the next step labels the same value 'Pixel Code'. Both must hold the same TikTok pixel value so the two halves point at the same pixel. The Pixel editor also offers an optional Advanced Matching block — toggles for Match by email and Match by phone — that you can enable to improve attribution; leave it off if you are not sure. Save when you are done."},"kind":"static","appearance":{"align":"start","fontSize":16,"fontWeight":400,"lineHeight":25,"color":"#344054"}}}},{"id":"tiktok-pixel-events-api-setup-add-pixel-image","order":5,"kind":"Media","label":"The TikTok Pixel editor: the field is labeled \"Pixel ID\" (+ optional Advanced Matching)","layout":{"heightKind":"fixed","heightValue":360,"padding":{"top":8,"end":0,"bottom":8,"start":0},"cornerRadius":{"uniform":12}},"mediaContent":{"kind":"Image","content":{"image":{"translations":{"en":{"original":"https://api.segmently.ai/assets/projects/arswew63RwQr6V4Ekb1Z/cli-assets/images/20260630173113_tiktok-pixel-editor/origin.png","name":"The TikTok Pixel editor: the field is labeled \"Pixel ID\" (+ optional Advanced Matching)"}},"appearance":{}}},"appearance":{"scaleMode":"scaleAspectFit","cornerRadii":{"uniform":12}}}},{"id":"tiktok-pixel-events-api-setup-add-events-api","order":6,"kind":"Text","label":"Add the TikTok Events API (server side)","layout":{"heightKind":"auto","margin":{"top":20}},"textContent":{"title":{"translations":{"en":"Add the TikTok Events API (server side)"},"kind":"static","appearance":{"align":"start","fontSize":21,"fontWeight":750,"lineHeight":28,"color":"#101828"}},"subtitle":{"translations":{"en":"Still under Settings, Analytics, add the TikTok Events API integration. This one is also required to optimize on conversions. In this editor the field is labeled Pixel Code — enter the same value you pasted as the Pixel ID for the browser-side Pixel, plus the Access Token you generated in Events Manager. There is also an optional Test Event Code field and a Send Test button: enter a test code and click Send Test to confirm the server connection works from inside Segmently, then watch the events arrive in TikTok Events Manager. You do not need to manually clear the Test Event Code before going live — Segmently automatically strips it from live webhook traffic, so your real conversions are never tagged as test data. Save when you are done."},"kind":"static","appearance":{"align":"start","fontSize":16,"fontWeight":400,"lineHeight":25,"color":"#344054"}}}},{"id":"tiktok-pixel-events-api-setup-add-events-api-image","order":7,"kind":"Media","label":"The TikTok Events API editor: the field is labeled \"Pixel Code\" + Access Token + Test Event Code + Send Test","layout":{"heightKind":"fixed","heightValue":360,"padding":{"top":8,"end":0,"bottom":8,"start":0},"cornerRadius":{"uniform":12}},"mediaContent":{"kind":"Image","content":{"image":{"translations":{"en":{"original":"https://api.segmently.ai/assets/projects/arswew63RwQr6V4Ekb1Z/cli-assets/images/20260630173115_tiktok-events-api-editor/origin.png","name":"The TikTok Events API editor: the field is labeled \"Pixel Code\" + Access Token + Test Event Code + Send Test"}},"appearance":{}}},"appearance":{"scaleMode":"scaleAspectFit","cornerRadii":{"uniform":12}}}},{"id":"tiktok-pixel-events-api-setup-match-credentials","order":8,"kind":"Text","label":"Make sure both halves match","layout":{"heightKind":"auto","margin":{"top":20}},"textContent":{"title":{"translations":{"en":"Make sure both halves match"},"kind":"static","appearance":{"align":"start","fontSize":21,"fontWeight":750,"lineHeight":28,"color":"#101828"}},"subtitle":{"translations":{"en":"The same TikTok pixel value must be entered in both integrations, even though the two editors label the field differently: 'Pixel ID' in the browser-side Pixel integration and 'Pixel Code' in the Events API integration. Both fields take the identical value — if you go looking for a 'Pixel Code' field in the Pixel editor you will not find one, because there it is called 'Pixel ID'. Matching the value is what routes the browser event and the server event to the same pixel, so they land in one place. Deduplication itself is not done by comparing pixel values: each browser and server pair carries a shared event_id, and TikTok merges the two into one conversion within a 48-hour window (events that arrive close together are merged within about 5 minutes). Double-check both fields hold the same value before moving on."},"kind":"static","appearance":{"align":"start","fontSize":16,"fontWeight":400,"lineHeight":25,"color":"#344054"}}}},{"id":"tiktok-pixel-events-api-setup-identifiers","order":9,"kind":"Text","label":"How TikTok matches sales to ad clicks","layout":{"heightKind":"auto","margin":{"top":20}},"textContent":{"title":{"translations":{"en":"How TikTok matches sales to ad clicks"},"kind":"static","appearance":{"align":"start","fontSize":21,"fontWeight":750,"lineHeight":28,"color":"#101828"}},"subtitle":{"translations":{"en":"To credit a sale to the right ad, TikTok relies on two identifiers: ttp, the TikTok Browser ID read from the _ttp cookie, and ttclid, the TikTok Click ID carried in the ttclid URL parameter of the ad link people tapped. Segmently captures both and forwards them with your conversion events (as user.ttp and user.ttclid), so a server-confirmed purchase can be matched back to the campaign that drove it. For this to work, those identifiers need to travel from your funnel into Stripe. You set that up in the Web Placement metadata mapping (see Pass funnel values into Stripe via metadata), where the two source keys to map are 'tiktok.ttp' and 'tiktok.ttclid'. This is what makes the optional Events API connection actually improve your TikTok ad results."},"kind":"static","appearance":{"align":"start","fontSize":16,"fontWeight":400,"lineHeight":25,"color":"#344054"}}}},{"id":"tiktok-pixel-events-api-setup-identifiers-image","order":10,"kind":"Media","label":"Forward TikTok identifiers (ttp / ttclid) through Stripe metadata","layout":{"heightKind":"fixed","heightValue":360,"padding":{"top":8,"end":0,"bottom":8,"start":0},"cornerRadius":{"uniform":12}},"mediaContent":{"kind":"Image","content":{"image":{"translations":{"en":{"original":"https://api.segmently.ai/assets/projects/eEZgfU4hvE9WtLkU30Dg/cli-assets/guide-images/20260601151506_open-stripe-metadata-stripe-metadata/origin.png","name":"Forward TikTok identifiers (ttp / ttclid) through Stripe metadata"}},"appearance":{}}},"appearance":{"scaleMode":"scaleAspectFit","cornerRadii":{"uniform":12}}}},{"id":"tiktok-pixel-events-api-setup-verify","order":11,"kind":"Text","label":"Verify in TikTok Events Manager","layout":{"heightKind":"auto","margin":{"top":20}},"textContent":{"title":{"translations":{"en":"Verify in TikTok Events Manager"},"kind":"static","appearance":{"align":"start","fontSize":21,"fontWeight":750,"lineHeight":28,"color":"#101828"}},"subtitle":{"translations":{"en":"There are two ways to confirm the connection. From inside Segmently, the Events API editor has a Send Test button: enter a Test Event Code and click it to fire a server event and verify the Events API connection without leaving the app. To confirm end to end on TikTok's side, open TikTok Events Manager and watch your pixel's activity while you walk through your funnel and run a test purchase — if you set a Test Event Code, your test events appear under that code so they stay separate from real traffic. Seeing both browser and server events arrive means the connection is working. You do not have to remove the Test Event Code afterward: Segmently strips it from live webhook traffic automatically, so live conversions are never sent as test data."},"kind":"static","appearance":{"align":"start","fontSize":16,"fontWeight":400,"lineHeight":25,"color":"#344054"}}}},{"id":"tiktok-pixel-events-api-setup-next","order":12,"kind":"Text","label":"Next","layout":{"heightKind":"auto","margin":{"top":20}},"textContent":{"title":{"translations":{"en":"Next"},"kind":"static","appearance":{"align":"start","fontSize":21,"fontWeight":750,"lineHeight":28,"color":"#101828"}},"subtitle":{"translations":{"en":"With both integrations connected, decide which actions TikTok should count as conversions — for example, completed purchases and subscriptions — in Send the right TikTok events. Segmently sends these under TikTok's remapped event names (a purchase becomes CompletePayment and a subscription becomes Subscribe); the full list lives in the TikTok events catalog. After that, publish your funnel and run a test purchase (step 5) to confirm a real conversion reaches TikTok end to end. Note that publishing a funnel requires an active custom domain — if you have not connected one yet, set up your custom domain first (see Connect a custom domain), since publishing is blocked without it."},"kind":"static","appearance":{"align":"start","fontSize":16,"fontWeight":400,"lineHeight":25,"color":"#344054"}}}}]}}}},"metadata":{"kind":"article","projectId":"arswew63RwQr6V4Ekb1Z","articleId":"7fT1WnM4yBtrcYQazNhz","alias":"tiktok-pixel-events-api-setup","articlePresentation":{"version":1,"profiles":{"standard":{"containerMaxWidth":1120,"contentInsets":{"top":48,"end":32,"bottom":56,"start":32},"sectionPaddingScale":1,"textScale":1},"laptop":{"containerMaxWidth":960,"contentInsets":{"top":44,"end":40,"bottom":52,"start":40},"sectionPaddingScale":0.96,"textScale":0.96},"tablet":{"containerMaxWidth":760,"contentInsets":{"top":36,"end":28,"bottom":44,"start":28},"sectionPaddingScale":0.9,"textScale":0.92,"titleTextScale":0.9},"phone":{"containerMaxWidth":"100%","contentInsets":{"top":28,"end":16,"bottom":36,"start":16},"sectionPaddingScale":0.82,"textScale":0.88,"titleTextScale":0.82}}}},"webViewDefaultBackgroundColor":"#F7F8FA","projectAnalytics":{"consentManagement":{"enabled":true,"bannerText":"We use cookies to improve your experience and analyze site usage.","privacyPolicyUrl":"","defaultConsent":"denied"},"integrations":[{"platform":"segmently_internal","name":"Segmently Analytics","enabled":true,"config":{"mode":"http"},"createdAt":"2026-05-26T13:53:00.398Z","updatedAt":"2026-05-26T13:53:00.398Z","id":"int_mpmp3jsm_aij2kz"}]}}