Skip to main content
AfterSell → TikTokIntegration guide

Connecting AfterSell to TikTok Events API

AfterSell works through checkout extensions and post-purchase pages, which puts its offers inside Shopify's sandboxed surfaces where your own scripts cannot reach. 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 AfterSell upsell 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

AfterSell to TikTok Events API: CompletePayment at the final total

Read ttclid the instant a TikTok shopper lands and write it to a cart attribute, since the in-app browser may lose it before checkout ends. Send CompletePayment from the Shopify order webhook once AfterSell's post-purchase step settles, with the final total, upsell items in contents, hashed email and phone, and an event_id shared with any browser event.

Shoppers from TikTok ads often go through checkout and AfterSell's post-purchase offer inside TikTok's in-app browser, then close it the moment the order is placed. A browser CompletePayment that depends on a later page loading misses those orders entirely, and one fired at checkout_completed, which with AfterSell runs on the first offer page, misses the upsell value.

Send CompletePayment from the Shopify order webhook once the post-purchase step has settled, with value as the final order total and contents listing the upsell items. The ttclid has to be read on the storefront the instant the visitor lands and written to a cart attribute, since the webview's storage may not hold it to the end of checkout and nothing in the extension can recover it. Add hashed email and phone from the order as the fallback match for orders where the ttclid is missing.

If the TikTok channel app is already sending a browser CompletePayment, either give your server event the same event_id, which means generating it on the storefront and storing it as a cart attribute too, or turn the app's purchase event off. Then measure ttclid presence on orders from TikTok traffic alone, and compare upsell take rate on those orders with the rest.

AfterSell → TikTok · what breaks

Why this join usually fails — AfterSell → TikTok

  1. 01

    The ttclid never reaches AfterSell

    Extension surfaces are isolated by design. Attempting to instrument them client-side does not work and is not supported.

  2. 02

    Trying to instrument a sandbox

    Time gets spent attempting to observe checkout extension behaviour from the storefront. It cannot be done, by design, and every hour spent on it is an hour not spent on the server-side path that works.

  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.

AfterSell → TikTok · the fix

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

AfterSell → TikTok · architecture

How AfterSell and TikTok actually connect

  1. 1

    AfterSell holds the truth

    Checkout UI extensions run sandboxed. Nothing you write can observe them, so the only reliable view of what the customer accepted is the order itself.

  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 AfterSell upsell order.

  4. 4

    The event source decides reliability

    Send the final order total from the webhook, with upsell line items identified.

  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.

AfterSell → TikTok · normal or broken

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

Normal, not a fault

  • The ttclid present on the order

  • Sent from the Shopify order webhook

  • 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

    Extension surfaces are isolated by design. Attempting to instrument them client-side does not work and is not supported.

  • Sent from the browser

    Time gets spent attempting to observe checkout extension behaviour from the storefront. It cannot be done, by design, and every hour spent on it is an hour not spent on the server-side path that works.

  • 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

AfterSell → TikTok · diagnose

Diagnostic order — AfterSell → TikTok

  1. 01

    Count orders carrying the ttclid

  2. 02

    Follow one real conversion end to end

  3. 03

    Confirm the conversion is sourced from the order, not from a page

    On modern Shopify checkout there is no supported page-based option left, so this is the only correct architecture.

  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.

AfterSell → TikTok · prove

How it gets proven — AfterSell → TikTok

Source of truth

The final Shopify order total, read from the order record.

  • The ttclid confirmed present on a live order.
  • Deduplication confirmed in Events Manager, and ttclid capture rate measured on TikTok traffic specifically.
  • Final order totals reconciled from the webhook against imported conversions.

AfterSell → TikTok · free audit

What we check in the free audit

  • Count orders carrying the ttclid
  • Follow one real conversion end to end
  • Confirm the conversion is sourced from the order, not from a page
  • Measure ttclid capture rate on TikTok traffic specifically
  • Read the match rate, not the success message

Checked against

The final Shopify order total, read from the order record.

Get my free conversion tracking audit

Free30 minutesNo obligation

AfterSell → TikTok · when not to buy

When you don't need this — AfterSell → TikTok

  • Measure identifier coverage yourself first — pull your last hundred orders and count how many carry the ttclid.
  • If your conversions already come from the order webhook, checkout extensions change nothing for you.
  • 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.

AfterSell → TikTok · what we deliver

What gets built — AfterSell → TikTok

  • Identifier capture into AfterSell

    Do not try to instrument the checkout surface. Read the order server-side, which is the supported and more reliable path anyway.

  • Event source: the Shopify order webhook

    Send the final order total from the webhook, with upsell line items identified.

  • 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 reverse.

Written guarantee

95%+ tracking accuracy

Measured against The final Shopify order total, read from the order record.. Miss it and we keep working at no cost.

Get my free conversion tracking audit

From $400 · See packages

FAQ

AfterSell → TikTok questions, answered

The in-app browser often closes before a thank-you-page pixel loads, and the ttclid may not survive its storage. Sending CompletePayment from the order webhook, with the ttclid stored on the order, avoids both.

Free · 30 min

Get AfterSell and TikTok joined properly

Free30 minutesNo obligation