TikTok Events API Server-Side: Making Your TikTok Ads Conversions Reliable

Published by Thomas dans la catégorie Tracking on 25.02.2026 Last update : 05.10.2026 à 21h40


Table of content

Your TikTok campaigns drive visits, stock is going down, yet Ads Manager shows few sales? Many advertisers then cut campaigns too early. The problem often lies in measurement: a Pixel running inside an in-app browser on mobile loses part of its signals. Here is how we deploy the TikTok Events API server-side with Google Tag Manager and Stape, without ever overriding the visitor's choice.

In short

  • The TikTok Events API sends your conversions from a server. TikTok recommends using it with the Pixel.

  • A shared event_id prevents duplicates: TikTok keeps the first event received within a 48-hour window.

  • The ttclid parameter and customer data hashed with SHA-256 improve attribution.

  • Without consent, nothing goes to TikTok. And data transfers to China call for particular care.

Why the TikTok Pixel alone is no longer enough

Comparison of the TikTok Pixel alone and the Pixel with the server-side TikTok Events API: in-app browser and capped cookies on one side, server events deduplicated by event_id and subject to consent on the other.

TikTok is used mainly on mobile. To understand signal loss, look at where your website actually opens.

The in-app browser and iOS trap

When a user taps your ad, your site usually opens inside the TikTok app, in its in-app browser, rather than in Safari or Chrome.

  1. App Tracking Transparency (iOS 14.5, April 2021): on iPhone, apps must ask permission to track users across apps. Every refusal reduces the signals available for attribution.

  2. A broken journey: the user adds to cart in TikTok's browser, closes the app, then comes back later through Safari to pay. Cookies are not shared between these two browsers, so the Pixel cannot link the two sessions.

  3. Browser restrictions: Safari caps cookies set by JavaScript at 7 days (24 hours in some link-tracking cases), and according to GWI (Q2 2025), 30.9% of Swiss internet users run an ad blocker.

The impact on the TikTok Ads algorithm

TikTok's algorithm needs conversions to learn. When part of your sales slips past it:

  • your ad groups stay longer in the learning phase;

  • the reported CPA looks higher than reality, and you may cut profitable ads;

  • your retargeting and lookalike audiences are built on an incomplete base.

The solution: TikTok Events API server-side with Stape

TikTok Pixel and Events API diagram: after consent, the Pixel and your server send the same purchase with a shared event_id and TikTok keeps the first one received within 48 hours; a refusal blocks all sending.

TikTok describes the Events API as a secure server-to-server interface that lets advertisers share the actions customers take on their websites directly (TikTok Help). The principle is the same as for server-side Meta CAPI: your server passes the information on, alongside the browser.

How A-Track orchestrates the data

We set up a server-side Google Tag Manager container (sGTM) hosted with Stape, with a server in Europe. It becomes your central hub:

  1. The browser sends actions (ViewContent, AddToCart, CompletePayment) to your subdomain, which points to the server container.

  2. The container checks consent, cleans the data and formats it the way TikTok expects.

  3. It sends it to the Events API over HTTPS, with only the parameters needed.

Pixel + Events API: deduplication

For websites, TikTok recommends combining the Events API with your existing Pixel. To avoid counting a purchase twice, we generate a unique event_id, passed to both the Pixel and the server with the same event name. According to TikTok's deduplication documentation, identical events received within a 48-hour window are deduplicated: TikTok keeps the first event received and enriches it with information from the second.

Setup by CMS

Table of TikTok Events API setup by CMS: Shopify, WooCommerce, PrestaShop and Magento, custom site, with the purchase source and the point to check (consent, ttclid, hashing, event_id).

The Events API requires structured data and hashed customer information. Here is how we integrate it on the main platforms.

1. Shopify

  • Shopify is widely used by brands active on TikTok. The native TikTok app, however, offers little control.

  • We use the Stape app for Shopify or order webhooks: as soon as an order is confirmed in the back office, the purchase is sent to the server container, even if the user closes the app during payment.

  • The condition: the consent state must travel with the order, so the server knows whether it may send it to TikTok.

2. WooCommerce and WordPress

  • We structure the e-commerce flow in the dataLayer (Stape plugin or GTM4WP).

  • Web GTM captures the ttclid parameter, the click ID TikTok appends to your ad URLs, and passes it to the server.

  • The server container converts the e-commerce event into the TikTok API format, with value and currency (CHF).

3. PrestaShop, Magento and custom sites

For more complex architectures, we work with your developers. The goal: expose the email and phone entered at checkout cleanly, then hash them before they are sent to TikTok. This is at the heart of well-managed data governance.

The Stape levers we enable for TikTok

Advanced Matching

To tie a server-side sale to the person who saw your ad, TikTok uses matching keys: email, phone, external ID, ttclid, IP address and user agent. According to TikTok's Advanced Matching help, email and phone are hashed with SHA-256 before reaching TikTok. Hashing is not encryption: the data remains personal, pseudonymised data. The better these keys are filled in, the more TikTok can attribute sales that previously showed up as direct or organic.

The custom subdomain

With a subdomain such as data.your-brand.ch, requests to the server container stay first-party. Collection becomes more resilient to technical restrictions, and cookies set by your server can escape the 7-day cap on JavaScript cookies, provided the server shares the website's IP address (WebKit, 2023). You keep track of longer journeys, from a click on Monday to a purchase the following week. A subdomain never legitimises a call the visitor has refused.

Since 1 September 2023, the revised FADP requires transparency and proportionality; in the EU, the GDPR and the ePrivacy Directive require prior consent for advertising tracking. TikTok calls for particular care: in May 2025, the Irish Data Protection Commission fined TikTok EUR 530 million over transfers of European users' data to China (DPC, 2025).

Server-side does not make you compliant on its own, but it gives you control over what leaves:

  1. Consent enforced on the server: the TikTok tag in the container only fires with the visitor's marketing consent. On refusal, no event goes to TikTok, whether personal or "anonymised".

  2. Data minimisation: even with consent, the container only sends useful parameters and strips personal data from URLs.

  3. Transparency: name TikTok, the server-side transfer and the destination countries in your privacy policy.

A-Track tip

Test from TikTok's in-app browser, not just on desktop: open your ad preview on an iPhone, refuse cookies and check in the server container preview that nothing is sent. Then accept and make sure the test purchase appears only once.

What you can measure after go-live

We do not promise a percentage of "recovered" conversions: it depends on your audience, consent rate and CMS. We compare two to four weeks before and after deployment:

  • The gap between back office and TikTok Ads Manager on purchases.

  • Match quality as shown in TikTok's events manager.

  • The learning phase: with more complete conversions, ad groups reach the required volume faster.

  • Scalability: once the container is in place, adding Meta, Google Ads or GA4 takes little extra effort.

Conclusion: where to start

  1. Compare back-office sales with those attributed by TikTok over 30 days.

  2. Deploy the Events API with a shared event_id, a preserved ttclid and Advanced Matching.

  3. Enforce consent on the server and document transfers in your privacy policy.

How many of your sales is TikTok Ads not seeing?

A-Track compares your orders with purchases attributed by TikTok, tests the journey from the in-app browser and checks event_id, ttclid and server-side consent.

Get a free tracking and compliance audit, delivered within 48 hours.

Audit my TikTok tracking

Questions fréquemment posées

Do I need the Events API if I only use TikTok for awareness?

▾
Not necessarily, but it is still useful. For traffic or awareness campaigns, the Events API makes reporting of events such as page views more robust against browser restrictions and ad blockers, which better feeds your retargeting audiences.

It always respects the visitor's choice: without consent, no event and no audience. If you do no retargeting at all, the Pixel alone may be enough.

Is the TikTok Pixel removed with this method?

▾
No. We use a hybrid setup: the Pixel collects events in the browser and the Events API also sends them from the server, which makes measurement more robust. A shared identifier (event_id) lets TikTok deduplicate events and avoid double counting. Both channels follow the same consent choice.

Does Server-Side slow down my e-commerce site?

▾
No, and it can even make it lighter, under one condition. The server-side container runs on a separate server, with no load on your website. The speed gain only appears if scripts are removed from the browser, for example advertising pixels replaced by server-side sends.

A lighter site benefits user experience and, indirectly, SEO.

Is the data sent via the TikTok API secure?

▾
Yes, if the architecture is well designed. Personal data such as email or phone number is normalised then hashed with SHA-256 on your server before being sent to TikTok, and you choose exactly which fields are transmitted.

Be careful: hashing is not encryption. Hashed data remains pseudonymised personal data under the FADP and the GDPR, since the platform can match it with its own users. It should therefore only be sent with the visitor's consent.

How to keep this infrastructure up to date?

▾
TikTok's APIs, GTM templates and Stape's recommendations change regularly. You therefore need to monitor the data flow (alerts on event volumes, conversion checks) and apply updates.

That is the purpose of A-Track's annual maintenance: monitoring, updates and quick fixes when something breaks, to keep data loss to a minimum.