Skip to main content
Medusa → TikTokIntegration guide

Connecting Medusa to TikTok Events API

Medusa is a Node commerce engine you extend in your own codebase, which makes the conversion event a piece of application code — and therefore something that can be tested rather than hoped for. 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 Medusa 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

Medusa to TikTok: PlaceAnOrder at checkout, CompletePayment at capture

Send PlaceAnOrder at order creation and CompletePayment from the payment-captured subscriber, with the order ID as event_id on server and pixel. Read ttclid on landing server-side into a cookie and Medusa cart metadata with _ttp, and always include hashed email and phone as fallback. Judge on refund-adjusted revenue.

Medusa gives you two clean moments TikTok has standard events for: the order being placed and the payment being captured. Send PlaceAnOrder when the order is created and CompletePayment from the payment-captured subscriber, so TikTok optimizes on money while you can still see the drop between the two. Use the Medusa order ID as event_id on both the server and pixel versions of each event.

TikTok clicks arrive in an in-app browser whose storage is inconsistent, so the storefront should read the ttclid from the landing URL on the server, write it to a first-party cookie, and copy it into cart metadata as soon as a cart exists, along with the _ttp value. A cart created later, after the shopper returns from a normal browser, will not have the ttclid; the hashed email and phone from the Medusa order become the fallback there, so send them with every event.

Send value and currency from the captured total and the order's line items as contents for catalog campaigns. Confirm in TikTok's documentation how old an event timestamp may be before relying on a delayed capture or any backfill. Refunds emitted by Medusa have no reversal event in TikTok; record them in your own reporting, and if refund rates differ by campaign, judge TikTok on refund-adjusted revenue rather than on Events Manager totals.

Medusa → TikTok · what breaks

Why this join usually fails — Medusa → TikTok

  1. 01

    The ttclid never reaches Medusa

    The storefront is separate from the backend, and the identifier must be attached to the cart before the order is created.

  2. 02

    Firing on order placed rather than payment captured

    They are different events and the gap between them contains every failed and pending payment. Order-placed is the easier hook and the wrong one.

  3. 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.

  4. 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.

Medusa → TikTok · the fix

What working looks like — Medusa → 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

Medusa → TikTok · architecture

How Medusa and TikTok actually connect

  1. 1

    Medusa holds the truth

    Because you own the event handlers, the conversion can fire from the payment-captured event specifically rather than from whatever the frontend happened to render.

  2. 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. 3

    The identifier is the bridge

    The ttclid, captured at the visit and carried into the Medusa order.

  4. 4

    The event source decides reliability

    Send orders at payment capture, at the paid total.

  5. 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.

Medusa → TikTok · normal or broken

Working vs. broken, side by side — Medusa → TikTok

Normal, not a fault

  • The ttclid present on the order

  • Sent from a Medusa subscriber on order payment capture

  • 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

    The storefront is separate from the backend, and the identifier must be attached to the cart before the order is created.

  • Sent from the browser

    They are different events and the gap between them contains every failed and pending payment. Order-placed is the easier hook and the wrong one.

  • 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

Medusa → TikTok · diagnose

Diagnostic order — Medusa → TikTok

  1. 01

    Count orders carrying the ttclid

  2. 02

    Follow one real conversion end to end

  3. 03

    Check which event your subscriber listens to

    One line of code, and it decides whether you are counting orders or counting money.

  4. 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.

  5. 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.

Medusa → TikTok · prove

How it gets proven — Medusa → TikTok

Source of truth

Medusa orders by payment status, emitted from your own subscriber code.

  • The ttclid confirmed present on a live order.
  • Deduplication confirmed in Events Manager, and ttclid capture rate measured on TikTok traffic specifically.
  • Payment-captured orders reconciled against imported conversions.

Medusa → TikTok · free audit

What we check in the free audit

  • Count orders carrying the ttclid
  • Follow one real conversion end to end
  • Check which event your subscriber listens to
  • Measure ttclid capture rate on TikTok traffic specifically
  • Read the match rate, not the success message

Checked against

Medusa orders by payment status, emitted from your own subscriber code.

Get my free conversion tracking audit

Free30 minutesNo obligation

Medusa → TikTok · when not to buy

When you don't need this — Medusa → TikTok

  • Measure identifier coverage yourself first — pull your last hundred orders and count how many carry the ttclid.
  • If every payment method you accept is instant, the two events nearly coincide and the distinction costs more than it returns.
  • 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.

Medusa → TikTok · what we deliver

What gets built — Medusa → TikTok

  • Identifier capture into Medusa

    Write the identifier into cart metadata at first touch so it is carried onto the order automatically at completion.

  • Event source: a Medusa subscriber on order payment capture

    Send orders at payment capture, at the paid total.

  • 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

    Refunds emit their own event and should reverse.

Written guarantee

95%+ tracking accuracy

Measured against Medusa orders by payment status, emitted from your own subscriber code.. Miss it and we keep working at no cost.

Get my free conversion tracking audit

From $400 · See packages

FAQ

Medusa → TikTok questions, answered

At minimum PlaceAnOrder when the order is created and CompletePayment on payment capture, each with the order ID as event_id shared with the pixel. Optimize on CompletePayment.

Free · 30 min

Get Medusa and TikTok joined properly

Free30 minutesNo obligation