Connecting Magento to TikTok Events API
Magento is self-hosted and endlessly customisable, which means every installation is different and full-page caching is always in the way. TikTok's audience skews to exactly the browsers and app contexts where browser-side tracking performs worst. The join between them succeeds or fails on one thing: whether the ttclid reaches the Magento order before the conversion happens, because TikTok can only match a conversion it can tie back to a click it recognizes.
Free30 minutesNo obligation
Specific to this pair
Magento and TikTok: ttclid, cache keys and CompletePayment
Check whether your Varnish VCL strips ttclid or adds it to the cache key, then capture it in the browser into a first-party cookie and copy it onto the quote. Send CompletePayment from the Magento order observer with increment_id as event_id, matching the success-page pixel, plus hashed email and phone. Compare TikTok ROAS with revenue net of credit memos.
Unlike gclid, ttclid is not in every Magento VCL's strip list, so depending on your configuration it either reaches PHP or splits the full-page cache into one entry per click. Check your VCL: if ttclid ends up in the cache key, TikTok traffic quietly lowers your cache hit rate as well as complicating tracking. Either way, capture it in the browser, write it to a first-party cookie, and copy it onto the quote.
Send CompletePayment from the order observer with the increment_id as event_id, the same value the TikTok pixel uses on the success page, plus hashed email and phone from the order. Magento's default checkout requires a phone number on the address, which helps here, because the in-app browser often loses the ttclid between product page and checkout.
Check whether a TikTok extension for Adobe Commerce is installed and what it sends server-side before adding your own. Credit memos have no reversal route into TikTok worth relying on, so confirm in your account and reconcile TikTok ROAS against Magento revenue net of credit memos rather than gross.
Magento → TikTok · what breaks
Why this join usually fails — Magento → TikTok
- 01
The ttclid never reaches Magento
Magento's full-page cache serves a stored render to the visitor, which means anything relying on dynamically rendered values can silently fail — and in Magento this has historically included serving one customer's cached block to another, which is a data problem as well as a tracking one.
- 02
Full-page cache between the visitor and your code
The page the customer saw is not the page your code assumed. This is the defining Magento tracking failure and it produces intermittent, hard-to-reproduce loss.
- 03
The ttclid is lost in the in-app browser
TikTok traffic arrives through an in-app webview whose storage behavior is inconsistent. An identifier captured but not immediately persisted server-side often is not there by the time the conversion happens.
- 04
Nothing reconciles afterwards
TikTok Events Manager shows received events and their match status. As with Meta, arriving is not the test — deduplicated and matched is. Reconcile TikTok's reported conversions against the source system for the same window.
Magento → TikTok · the fix
What working looks like — Magento → TikTok
The ttclid on every order
Conversions arriving in TikTok
Events appear in TikTok Events Manager, deduplicated against the pixel, and become usable for optimization.
Reconciled against the source
Magento → TikTok · architecture
How Magento and TikTok actually connect
- 1
Magento holds the truth
You own the database, so the truth is as good as the query. Pin down which order statuses count as revenue — processing, complete, or both — because that choice moves the number substantially.
- 2
TikTok Events API needs a click to match
TikTok matches server events using ttclid where available, falling back to hashed contact information. Both should be sent — the fallback is what carries the events where the click ID did not survive.
- 3
The identifier is the bridge
The ttclid, captured at the visit and carried into the Magento order.
- 4
The event source decides reliability
Fire server-side from the observer rather than from the success page template, which is cached and may not execute anything.
- 5
Deduplication at the destination
TikTok deduplicates on event_id, the same pattern as Meta: the pixel and the Events API must send the same event_id for the same conversion. Mismatched IDs mean double counting.
Magento → TikTok · normal or broken
Working vs. broken, side by side — Magento → TikTok
Normal, not a fault
The ttclid present on the order
Sent from the Magento order placement observer
Deduplicated correctly
TikTok deduplicates on event_id, the same pattern as Meta: the pixel and the Events API must send the same event_id for the same conversion. Mismatched IDs mean double counting.
Reconciles with the source
Actually broken
The ttclid missing on most records
Magento's full-page cache serves a stored render to the visitor, which means anything relying on dynamically rendered values can silently fail — and in Magento this has historically included serving one customer's cached block to another, which is a data problem as well as a tracking one.
Sent from the browser
The page the customer saw is not the page your code assumed. This is the defining Magento tracking failure and it produces intermittent, hard-to-reproduce loss.
Counted twice, or not at all
TikTok traffic arrives through an in-app webview whose storage behavior is inconsistent. An identifier captured but not immediately persisted server-side often is not there by the time the conversion happens.
Nobody has reconciled it
Magento → TikTok · diagnose
Diagnostic order — Magento → TikTok
- 01
Count orders carrying the ttclid
- 02
Follow one real conversion end to end
- 03
Place a test order as an anonymous visitor through cache
Not as an admin, which bypasses it. If the order data is missing on the cached path, caching is your cause.
- 04
Measure ttclid capture rate on TikTok traffic specifically
Not on all traffic. TikTok's in-app browser is the failure case, so a healthy overall capture rate can hide a poor one on exactly the traffic that matters.
- 05
Read the match rate, not the success message
TikTok Events Manager shows received events and their match status. As with Meta, arriving is not the test — deduplicated and matched is. Reconcile TikTok's reported conversions against the source system for the same window.
Magento → TikTok · prove
How it gets proven — Magento → TikTok
Source of truth
Magento's sales order records in your own database, for the same window and order status set.
- The ttclid confirmed present on a live order.
- Deduplication confirmed in Events Manager, and ttclid capture rate measured on TikTok traffic specifically.
- Order data confirmed populated on an order placed through a fully warmed cache.
Magento → TikTok · free audit
What we check in the free audit
- Count orders carrying the ttclid
- Follow one real conversion end to end
- Place a test order as an anonymous visitor through cache
- Measure ttclid capture rate on TikTok traffic specifically
- Read the match rate, not the success message
Checked against
Magento's sales order records in your own database, for the same window and order status set.
Free30 minutesNo obligation
Magento → TikTok · when not to buy
When you don't need this — Magento → TikTok
- Measure identifier coverage yourself first — pull your last hundred orders and count how many carry the ttclid.
- If your Magento build has heavy customisation by another team, scope their availability first — the build is usually blocked there.
- If TikTok is a small share of spend, the effort is hard to justify. It pays when TikTok is a channel you are actively scaling.
Magento → TikTok · what we deliver
What gets built — Magento → TikTok
Identifier capture into Magento
Capture the identifier and persist it as order data through an observer on order placement, server-side, so it never depends on what the cache served.
Event source: the Magento order placement observer
Fire server-side from the observer rather than from the success page template, which is cached and may not execute anything.
Dispatch to TikTok
Server events to the TikTok Events API with the ttclid, hashed contact information and a matching event_id.
Reversals where they exist
Credit memos are recorded against the original order and should reduce the reported figure.
Written guarantee
95%+ tracking accuracy
Measured against Magento's sales order records in your own database, for the same window and order status set.. Miss it and we keep working at no cost.
From $400 · See packages
FAQ
Magento → TikTok questions, answered
Check the Adobe Commerce Marketplace for a current one and confirm whether it sends Events API calls or only the pixel. If it does both, check that they share event_id.
Often the ttclid did not survive the in-app browser or the cache, and the event went without hashed email and phone. Send both from the order record.
Almost always because the ttclid never reached the Magento order. Magento's full-page cache serves a stored render to the visitor, which means anything relying on dynamically rendered values can silently fail — and in Magento this has historically included serving one customer's cached block to another, which is a data problem as well as a tracking one. Measure coverage before debugging the dispatch.
The ttclid — TikTok's click identifier, appended to your landing page URL and also stored in the _ttp cookie. TikTok additionally matches on hashed email and phone. In-app browser behavior makes ttclid capture more fragile than the equivalents on other platforms, so persisting it server-side as soon as it is seen matters more here than elsewhere.
The Magento order placement observer. Fire server-side from the observer rather than from the success page template, which is cached and may not execute anything.
TikTok Events Manager shows received events and their match status. As with Meta, arriving is not the test — deduplicated and matched is. Reconcile TikTok's reported conversions against the source system for the same window.
More on Magento → TikTok
- TikTok · Lead → booked callHow to track lead to booked call for TikTok Ads
- TikTok · Booked call → closed wonHow to track booked call to closed won for TikTok Ads
- TikTok · Free trial → paidHow to track free trial to paid for TikTok Ads
RELATED GUIDES
Where Magento → TikTok fits in the rest of your tracking
- TikTok · BeautyTikTok Ads conversion tracking for beauty brands
- TikTok · Furniture ecommerceTikTok Ads conversion tracking for furniture ecommerce brands
- TikTok × Ecommerce OrdersHow to reconcile TikTok Ads against your store's order table
- TikTok · Add to cart → purchaseHow to track add to cart to purchase for TikTok Ads
- Shopify POS → TikTokConnecting Shopify POS to TikTok Events API
- Magento → RedditConnecting Magento to Reddit
- Jewelry ecommerceConversion tracking for jewelry ecommerce, measured in settled orders
- Braintree → TikTokConnecting Braintree to TikTok Events API
Free · 30 min
Get Magento and TikTok joined properly
Free30 minutesNo obligation
