Connecting AfterSell to Amplitude
AfterSell works through checkout extensions and post-purchase pages, which puts its offers inside Shopify's sandboxed surfaces where your own scripts cannot reach. Amplitude is built around behavioural cohorts, which makes the identity resolution and the event taxonomy load-bearing in a way they never are for an ad pixel. The join between them succeeds or fails on one thing: whether the user ID and device ID pair reaches the AfterSell upsell order before the conversion happens, because Amplitude can only match a conversion it can tie back to a click it recognizes.
Free30 minutesNo obligation
Specific to this pair
AfterSell to Amplitude: upsell revenue on the right user
Read Amplitude's device ID in the storefront, write it into a cart attribute before checkout, and send the Shopify order from the server as revenue events with price, quantity and productId per line, marking AfterSell offer lines. Upsell edits resend the order, so build insert_id from order ID plus line-item ID. Refunds go as negative revenue.
Amplitude's browser SDK cannot see an AfterSell offer being accepted, because the post-purchase page and checkout extensions run in Shopify's sandbox. The upsell has to enter Amplitude from the server, built from the Shopify order, and it has to land on the same person the storefront SDK has been tracking. That means reading Amplitude's device ID in the storefront and writing it into a cart attribute before checkout, so it comes back on the order webhook alongside the customer ID you use as user_id.
Send the order as revenue events with price, quantity and productId per line, and mark the accepted offer lines so take-rate can be cut by cohort. Check how AfterSell identifies offer lines in your store, whether by line-item properties, tags or a discount, before keying anything on it. Without price and quantity the event count looks right and the revenue charts stay empty.
The pair's particular trap is double revenue. If the upsell is applied as an edit to the original order, the order arrives again with a higher total, and sending both versions as revenue counts the original items twice. Build insert_id from the order ID plus line-item ID, so a re-fired webhook is dropped and a genuinely new upsell line is not. Refunds go in as negative revenue against the same productId and user.
AfterSell → Amplitude · what breaks
Why this join usually fails — AfterSell → Amplitude
- 01
The user ID and device ID pair never reaches AfterSell
Extension surfaces are isolated by design. Attempting to instrument them client-side does not work and is not supported.
- 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.
- 03
Revenue events that carry no revenue
Amplitude will happily accept a purchase event with no price field. The event count looks correct, the funnel looks correct, and the revenue reporting stays at zero — which people usually discover a quarter later when someone asks what a cohort is worth.
- 04
Nothing reconciles afterwards
Amplitude shows the event in the user's activity stream with its properties expanded. Read the properties, because an event that arrives without its revenue fields still looks like a success.
AfterSell → Amplitude · the fix
What working looks like — AfterSell → Amplitude
The user ID and device ID pair on every order
Conversions arriving in Amplitude
The event lands on the user, joins their behavioural history, and becomes available for cohorts, funnels and retention.
Reconciled against the source
AfterSell → Amplitude · architecture
How AfterSell and Amplitude actually connect
- 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
Amplitude needs a click to match
Amplitude needs a device or user identifier, an event type and its properties. Revenue events need the price and quantity fields specifically, or the revenue reporting stays empty while events flow normally.
- 3
The identifier is the bridge
The user ID and device ID pair, captured at the visit and carried into the AfterSell upsell order.
- 4
The event source decides reliability
Send the final order total from the webhook, with upsell line items identified.
- 5
Deduplication at the destination
Amplitude deduplicates on insert_id. Omit it and a retried batch is counted twice, which shows up as a phantom spike that someone will eventually build a hypothesis on.
AfterSell → Amplitude · normal or broken
Working vs. broken, side by side — AfterSell → Amplitude
Normal, not a fault
The user ID and device ID pair present on the order
Sent from the Shopify order webhook
Deduplicated correctly
Amplitude deduplicates on insert_id. Omit it and a retried batch is counted twice, which shows up as a phantom spike that someone will eventually build a hypothesis on.
Reconciles with the source
Actually broken
The user ID and device ID pair 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
Amplitude will happily accept a purchase event with no price field. The event count looks correct, the funnel looks correct, and the revenue reporting stays at zero — which people usually discover a quarter later when someone asks what a cohort is worth.
Nobody has reconciled it
AfterSell → Amplitude · diagnose
Diagnostic order — AfterSell → Amplitude
- 01
Count orders carrying the user ID and device ID pair
- 02
Follow one real conversion end to end
- 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.
- 04
Check a purchase event for the price and quantity fields specifically
Not whether the event arrived — whether the revenue fields are populated, in the exact names Amplitude expects.
- 05
Read the match rate, not the success message
Amplitude shows the event in the user's activity stream with its properties expanded. Read the properties, because an event that arrives without its revenue fields still looks like a success.
AfterSell → Amplitude · prove
How it gets proven — AfterSell → Amplitude
Source of truth
The final Shopify order total, read from the order record.
- The user ID and device ID pair confirmed present on a live order.
- Revenue reconciled per transaction against your billing system, with identity merge behaviour verified across signup.
- Final order totals reconciled from the webhook against imported conversions.
AfterSell → Amplitude · free audit
What we check in the free audit
- Count orders carrying the user ID and device ID pair
- Follow one real conversion end to end
- Confirm the conversion is sourced from the order, not from a page
- Check a purchase event for the price and quantity fields specifically
- Read the match rate, not the success message
Checked against
The final Shopify order total, read from the order record.
Free30 minutesNo obligation
AfterSell → Amplitude · when not to buy
When you don't need this — AfterSell → Amplitude
- Measure identifier coverage yourself first — pull your last hundred orders and count how many carry the user ID and device ID pair.
- If your conversions already come from the order webhook, checkout extensions change nothing for you.
- If nobody is building cohorts or retention analysis, this is a large amount of instrumentation for reporting a dashboard already gives you.
AfterSell → Amplitude · what we deliver
What gets built — AfterSell → Amplitude
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 Amplitude
The Amplitude HTTP V2 API, posted server-side with the identity, event type and properties.
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.
From $400 · See packages
FAQ
AfterSell → Amplitude questions, answered
Shopify runs post-purchase and checkout extension pages in a sandbox your Amplitude snippet cannot reach. Generate the event server-side from the Shopify order instead.
Write the Amplitude device ID into a cart attribute before checkout and send it with the customer ID from the order webhook. Without it, the order lands on a new anonymous user and funnels split at checkout.
Almost always because the user ID and device ID pair never reached the AfterSell upsell order. Extension surfaces are isolated by design. Attempting to instrument them client-side does not work and is not supported. Measure coverage before debugging the dispatch.
Amplitude tracks both a device ID and a user ID and merges them when a user identifies. The merge rules decide who counts as one person, so a mistake here does not produce a small error — it changes every retention curve and cohort size in the account.
The Shopify order webhook. Send the final order total from the webhook, with upsell line items identified.
Amplitude shows the event in the user's activity stream with its properties expanded. Read the properties, because an event that arrives without its revenue fields still looks like a success.
More on AfterSell → Amplitude
- Stripe → AmplitudeConnecting Stripe to Amplitude
- PayPal → AmplitudeConnecting PayPal to Amplitude
- Shopify → AmplitudeConnecting Shopify to Amplitude
RELATED GUIDES
Where AfterSell → Amplitude fits in the rest of your tracking
- Checkout Champ → AmplitudeConnecting Checkout Champ to Amplitude
- Rebuy → AmplitudeConnecting Rebuy to Amplitude
- CartHook → AmplitudeConnecting CartHook to Amplitude
- AfterSell → MixpanelConnecting AfterSell to Mixpanel
- AfterSell → PostHogConnecting AfterSell to PostHog
- SupplementsConversion tracking for supplement brands, built around subscription value
- ReConvert → AmplitudeConnecting ReConvert to Amplitude
- Zipify OCU → AmplitudeConnecting Zipify OneClickUpsell to Amplitude
Free · 30 min
Get AfterSell and Amplitude joined properly
Free30 minutesNo obligation
