TikTok Pixel and Events API setup

Analytics & measurement
Selective

This is a measurement page, not a media page. If TikTok is in your mix, these numbers decide how TikTok sees your sales. Where this sits in the ecommerce marketing technology stack is on the technologies index.

What does it do?

The Pixel runs in the visitor's browser. It shares website events with TikTok, such as viewing a product page, adding to cart and buying1.

The Events API works from your side. TikTok's help centre describes it as a connection between TikTok and your marketing data across web, app and offline channels, such as stores and CRM2. Because it does not depend on the visitor's browser, it is usually set up as server-side tracking: data is collected on a server you control and passed to the platform. It does a similar job to Meta's Conversions API (CAPI).

Running both gives TikTok two routes for the same event. That is why deduplication matters.

Why do e-commerce brands use it?

Because TikTok ads can only optimise on what TikTok is told. If purchases arrive late, in part or not at all, the platform learns from a thin picture.

TikTok says connectivity issues and browser inconsistency can affect what the Pixel reports, and that the Events API helps capture missing conversions2. That is the vendor's own claim about its product. TikTok recommends the Pixel and the Events API together, with deduplication2.

What is event deduplication?

Event deduplication is counting an event once when it arrives twice. TikTok's help centre says you must send the same event_id through both the Pixel and the Events API, and that TikTok then keeps the first event it receives3.

You only need it when the same event goes both ways, for example Purchase from the Pixel and from the Events API. If the Pixel sends AddToCart and the server sends only Purchase, there is nothing to deduplicate3.

In plain terms: each purchase gets one ID. The browser sends it. The server sends it. TikTok sees the same ID twice and counts one purchase.

The same idea exists on Meta. See Meta pixel and Conversions API deduplication.

How do we implement it?

1

Confirm TikTok matters

Set this up only if you run TikTok ads or plan to. Otherwise it is upkeep with no purpose.

2

Install and route

Install the Pixel and confirm the right events fire. Choose the server route and who maintains it. Ask any app what it sends.

3

Share one event ID

Generate one ID per event and send it on both routes. Separate IDs set up two events, not deduplication.

4

Check against the shop

Compare TikTok's purchase count with your orders. Choose attribution settings before launch, as they cannot change later.

When should you not use it?

Do not set it up if you do not run TikTok ads and have no plan to. Tracking with no purpose is just upkeep.

Do not treat it as a fix for weak creative or a thin offer. It improves what TikTok sees. It does not improve what you sell.

If you are unsure, our tracking audit is free.

What does it cost in effort?

No figures. The effort is:

  • Pixel. Install it and confirm the right events fire.
  • Server route. Choose how events leave your shop or server, and who maintains that connection.
  • Event IDs. Generate one ID per event and send it on both routes.
  • Checks. Compare TikTok's purchase count with your shop's orders.
  • Upkeep. Theme changes, app installs and shop updates can break any of the above.

Pitfalls

  • Double counting

    Without the same event ID on both routes, one purchase can show up twice3.

  • Copying timing rules from blog posts

    TikTok's help centre gives different timing rules for different kinds of overlap3, and descriptions elsewhere vary. Do not build a set-up that depends on a specific window. Send one ID per event on both routes and check the counts.

  • IDs that do not match

    Our view: if the browser and the server generate separate IDs, you have not set up deduplication. You have set up two events.

  • Attribution windows fixed too early

    TikTok's help centre says attribution settings are chosen at ad group level and cannot be changed after the ad group is published4. Decide before you launch.

  • Consent

    Whether and when events may be sent, relative to a visitor's consent choice, is a decision for your lawyer and your consent platform. We do not give legal advice.

  • Tools that hide the set-up

    Apps can connect the Events API for you. Our view: ask what they send, with which ID, and check it.

Our take: Selective

In our view, TikTok Pixel and Events API is Selective. That is our rating, not a market fact.

Our reasoning: it is essential if you run TikTok ads, and a waste of effort if you do not. It earns its place for brands that run TikTok Ads or TikTok Shop, not for everyone.

For ZFD: If TikTok is in the plan, we check the Pixel, the server events and the shared ID before we read a single result.

FAQ

A rider in a red cape and bicorne hat on a rearing yellow plush horse, after David's Napoleon Crossing the Alps

What is the TikTok Events API?

It is a direct connection for sharing marketing data with TikTok. TikTok's help centre says it covers web, app and offline channels2.

Do I need both the Pixel and the Events API?

For websites, TikTok recommends using them together, with deduplication2. With both sending the same events, you need a shared event ID.

How does TikTok deduplicate events?

By matching the same event and event_id sent from the Pixel and the Events API, then keeping the first one received3.

Is this the same as Meta's Conversions API?

No. They do the same kind of job on different platforms. The set-up, the names and the rules are each platform's own.

Can I change attribution windows after launch?

No. TikTok's help centre says attribution settings are chosen at ad group level and cannot be changed once the ad group is published. You need a new ad group4.

Let’s find what’s actually working.

Next step. Want a check of your TikTok tracking before you spend on it? Talk to us about your setup. If you plan to run the channel, see our TikTok Ads service.