TikTok Pixel and Events API Setup
The TikTok Pixel tells TikTok what people do on your website after they see or click an ad. This guide covers creating a pixel, choosing standard and custom events, adding the Events API without counting sales twice, how the Pixel's cookies work, and how to check the whole setup before a campaign depends on it.
This guide is built from TikTok's Business Help Center, checked on 10 November 2026: About TikTok Pixel, How to set up and verify TikTok web data connection, About standard events, About Events API and About using cookies with TikTok Pixel, plus the other pages linked below. Where the Pixel fits in an account, next to campaigns, objectives and ad review, is in our TikTok ads basics guide.
- What the Pixel sends to TikTok
- Creating a pixel in Events Manager
- Standard events and their parameters
- Custom events and their naming rules
- Adding the Events API
- Deduplication windows
- First-party and third-party cookies
- Consent and sensitive data
- Checking the setup
- How we set up TikTok tracking
- Frequently asked questions
What the Pixel sends to TikTok
TikTok describes the Pixel as "a piece of code that you can place on your website that allows you to share website events with TikTok". It says the Pixel can be used to measure traffic on your site, measure campaign performance, and optimise campaigns and find new customers. A pixel or Events API connection is also a prerequisite for the Web Conversions objective, so it comes before any campaign that optimises for sales or leads on your site.
The About TikTok Pixel page lists what the Pixel collects from a normal browser:
- Ad and event information: the ad a person clicked, or the event that happened.
- Timestamp: when a page was viewed or a product bought.
- IP address: used for the geographic location of an event.
- User agent: device make, model, operating system and browser.
- Cookies: used for measurement, optimisation and targeting (more below).
- Metadata and button clicks: page metadata, structured microdata, page performance data and button clicks. TikTok says this can be used to personalise campaigns and improve its ad delivery systems.
That last item matters for privacy reviews: the Pixel can send more than the events you set up. TikTok recommends using Pixel Helper to view the data being sent, to make sure it "does not include data that may be deemed sensitive".
Creating a pixel in Events Manager
Pixels live in TikTok Events Manager, which TikTok calls "a workspace to create and manage data connections" for websites, apps and CRMs. TikTok's setup page gives these steps:
- In TikTok Ads Manager, go to Tools and click Events Manager.
- Click Connect Data Source and select Web.
- Enter your website URL.
- Choose Partner Integration or Manual Setup.
- Create and name the pixel. TikTok suggests a name that matches your website or domain; the limit is 128 characters including spaces.
- For a partner, follow that partner's steps. For manual setup, install the base code on your site, then configure events with the setup guide or Event Builder.
Partner Integration covers platforms such as Shopify and Google Tag Manager. Every event sent with that pixel's code shows up under that pixel in Events Manager.
Inside Events Manager, the pages you will use most are Overview (event funnel and an events table), Test Events, the Diagnostics cards, a Change log, and Settings, where you review permissions, the data connection and privacy settings.
Standard events and their parameters
Standard events are actions with names TikTok has already defined "to be used for reporting, optimizing conversions, and building audiences". They work through both the Pixel and the Events API. TikTok's current list, with the web objective each event supports:
| Event (code) | When it fires | Objective |
|---|---|---|
| ViewContent | A visitor views a specific page, such as a product page | Sales, Lead |
| Search | A visitor searches | Sales, Lead |
| AddToWishlist | An item is added to a wishlist | Sales, Lead |
| AddToCart | An item is added to the cart | Sales |
| InitiateCheckout | A visitor proceeds to checkout | Sales |
| AddPaymentInfo | Payment information is added at checkout | Sales |
| Purchase | A visitor makes a purchase | Sales |
| Download | A visitor downloads something from your site | Sales |
| Subscribe | A subscription, including follows and paid subscriptions | Sales, Lead |
| Contact | A visitor contacts you | Lead |
| SubmitForm | A visitor submits a form | Lead |
| CompleteRegistration | A visitor signs up, for example for an account | Lead |
| Schedule | A visitor schedules an appointment | Lead |
| FindLocation | A visitor looks for a location | Lead |
| CustomizeProduct | A visitor customises a product | Lead |
| StartTrial | A free trial begins | Lead |
| SubmitApplication | An application is submitted, such as for a loan or a job | Lead |
| ApplicationApproval | A submitted application is approved in your own process | Lead |
For ViewContent, AddToCart and Purchase, TikTok recommends sending content_type, quantity, description, content_ids, currency and value. For StartTrial it recommends content_ids, currency and value, and for Search the search_string. TikTok recommends setting up events "throughout the user journey", from a product page to the cart to the purchase, rather than the final conversion alone.
Custom events and their naming rules
A custom event is an action you name yourself, set up in Event Builder, through the Events API, or in code with ttq.track('YourEventName'). TikTok says custom events are useful "for detailed reporting and audience creation, although they are not applicable for campaign optimization". If you want a campaign to optimise for an action, map it to a standard event instead.
TikTok's naming rules for custom web events:
- No more than 50 characters.
- Only letters, numerals, underscores and dashes.
- It must start with a letter and cannot end with a space.
- Do not use a reserved event name: TikTok maps those to a standard event automatically, so your data would not appear under the custom name.
- No names that suggest sensitive information or illicit activity.
Adding the Events API
The Pixel runs in the visitor's browser. The Events API sends events from your own server, and can also carry app and offline events such as store and CRM data. TikTok's reason for adding it: "Connectivity issues and browser inconsistency can impact conversions reported via Pixel. With Events API, more conversions are reported". It also gives you control over exactly which fields you share.
For all web conversion advertisers, TikTok recommends three things:
- Connection type: the Pixel and the Events API together, with event deduplication.
- Events and parameters: the same events across the journey sent consistently through both.
- Match keys: all relevant match keys sent, to raise match rates for measurement and audiences.
The Events API needs a server-side setup: a developer, a platform with a built-in connection, or a server container such as the one in our GTM server-side tagging guide. It works the same way as Meta's Conversions API, explained in our Meta Pixel and Conversions API guide, so a site that already sends server events to Meta can reuse the same event list.
Deduplication windows
When the Pixel and the Events API both report the same purchase, TikTok must know it is one sale. Its event deduplication page says you must send the same event_id "through both Pixel and Events API", along with the same event name. TikTok then keeps the first event it receives and enriches it. The page gives three cases:
- Pixel with Pixel: identical event and event_id arriving within 48 hours of the first are deduplicated.
- Events API with Events API: the same 48-hour rule.
- Pixel with Events API: identical events arriving "after 5 minutes and within a 48-hour window from the first event" are merged or deduplicated.
Deduplication is not needed if each channel sends different events, for example AddToCart from the Pixel and Purchase from the Events API. In practice the order ID is a good event_id for a purchase, since both the browser and the server know it.
First-party and third-party cookies
TikTok's cookie page says cookies "help match events with people who engage with your content on TikTok". Both kinds are on by default with the Pixel, and first-party cookies can be turned off in the pixel's settings. All of them expire 13 months after they were set or last used.
| Cookie | Set on | Type |
|---|---|---|
| _ttp | Your website domain | First party |
| _ttp | .tiktok.com | Third party |
| ttcsid, ttcsid_<pixel code> | Your website domain | First party |
| ttclid | Your website domain | First party |
| _pangle | analytics.pangle-ads.com | Third party |
TikTok lists all five as advertising cookies. A first-party cookie is created by your site and recognises a person on your domain only; a third-party cookie is owned by TikTok and matches events across sites. TikTok notes that turning off first-party cookies "will not maximize your pixel's full matching and attribution capabilities", and that after you switch them off, existing cookies keep working until they expire. Allowing cookies does not change your conversion windows.
Citing "the impending deprecation of third-party cookies", TikTok recommends also switching on its Advanced Matching feature for event matching; it says performance is boosted when both kinds of cookie are paired with Advanced Matching. With the Events API you can pass the third-party cookie as the external_id parameter.
Consent and sensitive data
TikTok's how to use cookies page says TikTok requires advertisers "to provide notices and obtain consents, as required by applicable laws". Where consent is needed, your site must stop the Pixel setting and using cookies when a person declines. TikTok names three ways: a tag manager, a third-party consent management platform, or TikTok's pixel consent mode. If a tag manager or consent platform controls when the base code fires, TikTok says the older Enable/Disable functions in your code are redundant. Our cookie consent banners guide covers the banner side.
Event names and data have their own rules. TikTok asks you not to send sensitive data about visitors, and says event names must follow its Advertising Policies, Anti-Discrimination Policy and Housing, Employment and Credit Policy: "Non-compliant event names may be removed."
Checking the setup
TikTok lists three ways to verify a pixel:
- TikTok Pixel Helper: a Chrome extension; TikTok says to install it and check for any errors. TikTok also recommends it for viewing the data the Pixel sends.
- Test Events in Events Manager: test browser events (Pixel) and server events (Events API) and watch them arrive, with a filter to switch between the two. TikTok's Events Manager page says Test Events now includes a Payload Helper for checking a server payload's structure.
- Diagnostics: cards for issues such as missing parameter data or content IDs. TikTok's Web Diagnostics page says each card shows the issue, its severity, the affected dataset and the ads affected, with a fix button where one exists, such as "Enable first-party cookies". A number next to a pixel's Diagnostics tab means an active issue.
Test with a real journey: view a product, add it to the cart and finish a test order, then confirm each event arrives once, with value and currency, and that the Pixel and Events API copies share an event_id.
How we set up TikTok tracking
This is our own working practice, not TikTok's wording.
- We write the event list first: which standard event each important action maps to, and which parameters it carries.
- On a hand-built site we install the Pixel through Google Tag Manager behind the consent banner, so it follows the same consent rules as the other tags, and check in Pixel Helper that nothing fires before consent and no personal data leaks into URLs or button text.
- We add the Events API for purchases and leads, with the order or lead ID as event_id.
- We check Test Events and the Diagnostics tab before launch, and again a few days after real traffic arrives.
- For lead campaigns we choose between a TikTok instant form and the site's own form first, as in our TikTok lead generation guide, because only the website-form route requires the Pixel.
Frequently asked questions
Do I need both the TikTok Pixel and the Events API?
TikTok recommends both for websites, with event deduplication, because browser issues can stop the Pixel reporting some conversions. TikTok says a Pixel or Events API setup is a prerequisite for the Web Conversions objective.
Can a campaign optimise for a custom event?
No. TikTok says custom events are for reporting and audience creation and are not applicable for campaign optimisation. Use the closest standard event, such as SubmitForm or Purchase, for the action you want to optimise for.
How long do TikTok Pixel cookies last?
TikTok says its Pixel cookies expire 13 months after they were set or last used. They include the first-party _ttp, ttcsid and ttclid cookies on your domain, and the third-party _ttp cookie on .tiktok.com.
How do I stop TikTok counting a purchase twice?
Send the same event name and event_id from the Pixel and the Events API. TikTok keeps the first event and deduplicates matching ones that arrive within 48 hours; between the Pixel and the Events API, the window starts 5 minutes after the first event.
How do I check that my TikTok Pixel works?
TikTok lists three ways: the TikTok Pixel Helper Chrome extension, the Test Events feature in Events Manager, and the Diagnostics tab in Events Manager.
For more on ad tracking, see our guides to TikTok ads basics, TikTok lead generation, the Meta Pixel and Conversions API, GTM server-side tagging and cookie consent banners.