Measurement

TikTok Events API Setup: Pixel + Server Tracking Step by Step

  • By Marpany
  • Published:
  • Updated:
  • 10 min read
TikTok Events API Setup: Pixel + Server Tracking Step by Step

Short answer

The TikTok Events API is a server-to-server connection that sends conversion events such as Purchase and AddToCart from your server or store platform instead of the visitor's browser. TikTok recommends keeping the Pixel and adding the Events API as a second channel. Done right, both send the same event name and event_id, customer data is SHA-256 hashed, and you verify the result in Events Manager's Test Events tab.

Key takeaways

  • Don't remove the Pixel: TikTok's recommended setup is Pixel + Events API running together with deduplication.
  • Deduplication only works when the event name and event_id match exactly across both channels; TikTok keeps the first event it receives.
  • On Shopify, the Standard data sharing level is Pixel only; choose Enhanced or Maximum to turn on the Events API.
  • Use Purchase for new setups. TikTok renamed CompletePayment to Purchase and still converts legacy names on the backend.
  • The Events API does not add IP address and user agent automatically; you must send them, plus ttclid and the _ttp cookie, yourself.
Contents

What is the TikTok Events API and how is it different from the Pixel?

The TikTok Events API is a server-to-server connection that sends conversion events to TikTok from your own server or e-commerce platform rather than from the shopper's browser. The TikTok Pixel is JavaScript that runs in the browser. They aren't competing options; they are two channels that cover each other's blind spots.

The Pixel's weakness is its dependence on the browser. Ad blockers, cookie restrictions, a slow-loading thank-you page or a tab closed right after payment can all stop a purchase event from ever reaching TikTok. An order record created on your server isn't affected by any of that. That is why TikTok's own documentation doesn't tell you to replace the Pixel: for website connections it recommends adding an Events API integration alongside your existing Pixel and deduplicating the two. You will also see the Events API called the "TikTok Conversions API" or "TikTok CAPI" in third-party guides; it's the same thing.

TikTok Pixel (browser)

  • Runs from a code snippet on your site; quick to install
  • Exposed to ad blockers and cookie restrictions
  • Shares IP address and user agent by default
  • Sets the first-party _ttp cookie itself

Events API (server)

  • Sent from your server or store platform to TikTok
  • Not affected by browser-side blocking
  • Can carry back-end data such as order value and order ID
  • You must add IP, user agent, ttclid and _ttp yourself

Which setup method should you choose?

If you run on a platform like Shopify or WooCommerce, start with the platform's official TikTok integration; if you have a custom stack, use a tag manager or server-side tagging partner, or integrate the API directly. TikTok groups these as commerce partners, data partners and direct integration.

MethodBest forUpsideWatch out for
Commerce partner (TikTok app for Shopify, WooCommerce plugin)Stores on a hosted platformNo code; Pixel, Events API and deduplication come bundledYou only get the events and parameters the app sends
Data partner (server-side GTM, CDP, tracking app)Marketing teams with some technical helpOne data layer feeds TikTok, Meta and Google at onceHosting or subscription fees; you own the event_id matching
Direct API integrationBrands with in-house developersFull control over every event and fieldHighest load for development, error monitoring and token management

Shopify data sharing levels

The TikTok app on Shopify has three data sharing levels, and only two of them turn on the Events API:

  • Standard: TikTok Pixel only. Browser ad blockers may interfere with data collection.
  • Enhanced: TikTok Pixel + Events API + Advanced Matching.
  • Maximum: Everything in Enhanced plus Shopify APIs and In-App Shopify Checkout (which TikTok describes as in beta and not available to all advertisers).

Decision rule: if your store is on Shopify and the app shows "Standard", switch it to Enhanced first. For most stores that single setting is enough before you consider a separate server-side tool. Don't paste a second Pixel snippet into your theme next to the app; the same event would arrive from two sources with different event_ids and could not be deduplicated.

Some third-party guides claim the native Shopify integration only sends browser events. You don't have to take anyone's word for it: after switching levels, place a test order and open the Pixel's Overview tab in Events Manager. If Purchase shows "server & browser" as its connection method, the Events API is live; if it still says "browser only" after a day of orders, the server side isn't working and a dedicated tracking app or custom integration is worth considering.

How do you set up the TikTok Pixel and Events API step by step?

Setup starts with creating a Pixel in Events Manager; you then connect browser events through the Pixel code and server events through an access token. If you use a platform app, steps 1, 2 and 5 are usually all you need; with a direct integration every step is yours.

  1. Create the Pixel In TikTok Ads Manager go to Tools > Events Manager > Connect Data Source > Web (menu names as of September 2026), then enter your site URL. Name the Pixel after your domain.
  2. Choose a connection method Connect through a partner such as Shopify or Google Tag Manager, or install the base code manually.
  3. Generate an access token Open the Pixel's Settings tab and click Generate Access Token in the Events API section. Copy it immediately and store it as a server environment variable, never in browser code or a public repository.
  4. Send server events For each event, pass the event name, event_time as a Unix timestamp, event_id, the page URL and match keys (ttclid, _ttp, hashed email/phone, IP, user agent).
  5. Test, then go live Check browser and server events separately in the Test Events tab, then confirm on the Overview tab that the connection method reads "server & browser".

Which standard events should an online store send?

The minimum set for an e-commerce site is ViewContent, AddToCart, InitiateCheckout and Purchase, each with value and currency parameters. TikTok's standard events list, last updated in April 2026, names the purchase event Purchase.

EventFires whenParameters to send
ViewContentA product detail page loadscontent_ids, content_type, value, currency
AddToCartAdd to cart is clickedcontent_ids, content_type, quantity, value, currency
InitiateCheckoutCheckout startsNone listed; adding value and currency is still useful
AddPaymentInfoPayment details are enteredOptional
PurchaseThe order is confirmedcontent_ids, content_type, quantity, value, currency
SearchAn on-site search runssearch_string

CompletePayment vs Purchase

Older setups often send CompletePayment or PlaceAnOrder. TikTok renamed CompletePayment to Purchase (effective May 1, 2025) and says existing setups keep working because legacy names are converted on the backend, so you don't have to rewrite old code. PlaceAnOrder and ClickButton are soft-deprecated and scheduled to sunset in 2027. For any new implementation, use Purchase, and put migrating PlaceAnOrder on your roadmap before 2027.

If you run catalog ads, content_ids must match the product IDs in your catalog exactly; otherwise the event can match the ad but not the product. Also decide once whether value includes shipping and tax, and apply the same rule everywhere, because your ROAS depends on it (see what ROAS is and how to calculate it).

How does TikTok event deduplication with event_id work?

When the Pixel and the Events API send the same purchase with the same event name and the same event_id, TikTok counts one conversion and records the first event it received. If event_id is missing or differs between channels, the order is reported twice.

48 hoursDeduplication window from the first event
5 minutesThreshold TikTok cites for Pixel + Events API overlap
7 daysLast-received window for an event to show as Active

According to TikTok's help center, events from the same channel (Pixel to Pixel, or API to API) with identical event and event_id are deduplicated within 48 hours of the first event. For Pixel and Events API overlap, matching events arriving after 5 minutes and within 48 hours of the first event are merged or deduplicated. The article doesn't describe a separate rule for the first 5 minutes, so the practical rule is simple: send the server event promptly, and never later than 48 hours after the first event.

Worked example: order 10482

A customer places a $84.50 order. The Pixel event on the thank-you page and the event your server sends when the order record is created should line up like this:

  • Pixel: event = Purchase, event_id = order_10482, value = 84.50, currency = USD
  • Events API: event = Purchase, event_id = order_10482, value = 84.50, currency = USD

Building event_id from the order number is the safest choice because both the browser and the server already know it. If you generate a random ID instead, create it in one place and pass it to the other, for example through a data layer push before the Pixel fires. For events that happen before an order exists, such as AddToCart, combining the cart ID with a timestamp works well.

How do you improve Event Match Quality (EMQ)?

The Event Match Quality (EMQ) score in Events Manager is a weighted average of your match key coverage: the more events carry more match keys, the higher the score. It is TikTok's equivalent of Meta's EMQ and appears for each event on the Overview tab.

TikTok lists these match keys for the Events API: the TikTok click ID (ttclid), the _ttp first-party cookie, email and phone (Advanced Matching), external_id (your own customer or loyalty ID), IP address and user agent. The Pixel shares IP and user agent by default; with the Events API they require manual configuration.

  • Trim whitespace from email, lowercase it, then hash it with SHA-256.
  • Format phone numbers in E.164 with country code and no spaces or dashes ((415) 555-0132 becomes +14155550132), then hash.
  • Send your customer ID as a hashed external_id; on sites with logged-in customers it adds real match coverage.
  • Send ttclid and the _ttp cookie value raw; they are not hashed.
  • Pass the visitor's real IP address and user agent in the server event, not your server's own IP.
  • Consider turning on Automatic Advanced Matching for the Pixel, which hashes email and phone from form fields in the browser.

In sensitive categories such as health or finance, manual Advanced Matching is the safer choice because you control each field that gets shared. Check with your counsel that your privacy notice covers this data sharing under the rules that apply to you (for example GDPR/UK GDPR or US state privacy laws), and that the Pixel doesn't fire before consent where consent is required.

How do you test the setup, and what are the common errors?

Use the Test Events tab in Events Manager, the TikTok Pixel Helper Chrome extension and the Diagnostics tab together. Test Events gives you a live test environment and lets you filter browser and server events separately.

  1. Open Test Events and add its test code (test_event_code) to your server requests.
  2. Walk through a real journey on the site: product page, add to cart, checkout and a test order.
  3. Confirm each event arrives from both the browser and the server with the same event_id.
  4. After launch, watch the connection method on Overview ("browser only", "server only" or "server & browser"), the EMQ score and the last-received time.
  5. For anything flagged in Diagnostics, click Learn more to see the impact, fix steps and sample affected events.
SymptomLikely causeFix
Purchases are double countedevent_id missing or different across channelsUse the order number as event_id in both
Connection method shows "browser only"Server events not arriving, or token invalidRegenerate the token and log server response codes
Low EMQNo email/phone; IP and user agent missingAdd the keys from the checklist above
value is 0 or currency is wrongAmount sent as a string or in centsSend a numeric value and an ISO code such as USD
Event shows "No recent activity"No event received in the last 7 daysCheck the trigger and any recent theme changes

Even with a correct setup, TikTok's reported purchases won't match your store's order count one to one; attribution windows and view-through conversions explain the gap. To compare channels in one view, Marpany's conversion analysis puts TikTok, Meta and Google data next to your actual store orders.

What should you do in the first week after setup?

In week one, your job is to confirm the data flow and tie campaign optimization to the right event; change bids and budgets only after that.

  • Day 1: In Test Events, confirm core events arrive from both channels with matching event_ids.
  • Days 2–3: Compare TikTok's Purchase count with your orders for the same days and look for double counting.
  • Days 3–5: If EMQ is low, fill in the missing match keys.
  • Day 7: Confirm your web conversion campaigns optimize for Purchase.
  • Ongoing: Re-run the Test Events check after any theme, checkout or app update.

Once tracking is solid, review campaign structure, targeting and creative with our TikTok ads guide, and pick the metrics you'll judge results by using the ad performance KPI guide.

Frequently asked questions

Do I need to remove the TikTok Pixel to use the Events API?

No. TikTok recommends adding the Events API next to your existing Pixel. When both send the same event with the same event_id, TikTok deduplicates them and counts a single conversion.

How do I set up the TikTok Events API on Shopify?

In the official TikTok app on Shopify, set the data sharing level to Enhanced or Maximum. Standard uses the Pixel only. Don't add a second Pixel snippet to your theme, or events may be double counted.

What is event_id in TikTok tracking?

event_id is the unique ID that links the Pixel and Events API copies of the same event. Events with the same name and event_id are deduplicated within a 48-hour window and the first one received is kept. For purchases, the order number is the most practical source.

Should I use CompletePayment or Purchase?

Use Purchase for new setups. TikTok renamed CompletePayment to Purchase and says legacy names are still converted on the backend, so existing code keeps working. PlaceAnOrder is soft-deprecated and scheduled to sunset in 2027.

How do I improve my TikTok EMQ score?

EMQ reflects how well your events are covered by match keys. Sending hashed email, phone and external_id along with ttclid, the _ttp cookie, IP address and user agent raises it. Remember that the Events API needs IP and user agent added manually.

How can I check if my TikTok Pixel is working?

The TikTok Pixel Helper Chrome extension shows which events fire on a page. In Events Manager, the Test Events tab shows browser and server events live, and the Diagnostics tab lists errors with steps to fix them.

Sources

  1. TikTok Ads Manager – About Event Deduplication ads.tiktok.com
  2. TikTok Ads Manager – Standard Events and Parameters ads.tiktok.com
  3. TikTok Ads Manager – TikTok's Updated Standard Events ads.tiktok.com
  4. TikTok For Business – Data Sharing on TikTok App on Shopify ads.tiktok.com
  5. TikTok Ads Manager – How to set up matching events with Events API ads.tiktok.com
  6. TikTok Ads Manager – Diagnostic and monitoring tools in TikTok Events Manager ads.tiktok.com
Measurement

Meta Conversions API Setup: Deduplication, Hashing and EMQ Guide

Meta Conversions API (CAPI) sends conversion events from your server straight to Meta instead of relying on the visitor's browser. A correct setup runs the Pixel and CAPI together, sends the same event_name and event_id from both so Meta counts each conversion once, normalizes and SHA-256 hashes customer data such as email and phone, then verifies everything in Test Events and tracks Event Match Quality.

10 min read
TikTok

How Much Do TikTok Ads Cost in 2026? CPM, CPC and Minimum Budget

TikTok ads have no fixed price: impressions are priced in an auction, so you set the budget and the auction sets the cost. As of September 2026, TikTok requires more than $50 at campaign level and more than $20 per day at ad group level. For purchase campaigns, TikTok recommends a daily budget of at least 10 times your target cost per acquisition.

9 min read
Measurement

Shopify vs Meta vs GA4: Why Your Sales Numbers Don't Match

Shopify, Meta and GA4 count the same sales under different rules. Shopify records every order that happens; Meta Ads Manager only claims purchases that fall inside its attribution window; GA4 usually sees fewer because of cookie consent and ad blockers, and it never lets two channels claim the same sale. Use Shopify for revenue and profit, each ad platform for in-platform optimization, and GA4 for comparing channels.

10 min read

From the Knowledge Center

See all your numbers in one place

Google, Meta and TikTok data side by side, with fresh recommendations every week.