Connecting Magento to Amplitude
Magento is self-hosted and endlessly customisable, which means every installation is different and full-page caching is always in the way. 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 Magento 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
Magento to Amplitude: one revenue event per line, from the observer
Send Magento orders to Amplitude from the order placement observer, using the customer ID as user_id and, for guests, the Amplitude device ID read at add-to-cart, stored on the quote and copied to the order. Choose per-item revenue events or one order event, not both, use increment_id in insert_id, and send negative revenue from credit memos.
Amplitude cares about who comes back, which in Magento means joining guest and registered orders to the same person. Use the Magento customer ID as user_id for logged-in buyers, and for guest checkout read the Amplitude device ID in the browser at add-to-cart, store it on the quote, and copy it to the order. Without that, guest orders arrive as new users with no browsing history and retention curves undercount repeat buyers who never made an account.
Fire from the order placement observer, not the success page, which full-page cache may serve without running anything. Amplitude's revenue reporting reads price and quantity, so either send one revenue event per order item with its SKU and row price, or one order event with an order total; decide which before data piles up, because mixing them double-counts. Use the order's increment_id in the insert_id so a retried call does not create a phantom spike.
Credit memos are Magento's refund record. Send a negative revenue event from the credit memo save step, tied to the same user, or Amplitude's lifetime value per cohort keeps every refunded order.
Magento → Amplitude · what breaks
Why this join usually fails — Magento → Amplitude
- 01
The user ID and device ID pair 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
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.
Magento → Amplitude · the fix
What working looks like — Magento → 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
Magento → Amplitude · architecture
How Magento and Amplitude 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
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 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
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.
Magento → Amplitude · normal or broken
Working vs. broken, side by side — Magento → Amplitude
Normal, not a fault
The user ID and device ID pair present on the order
Sent from the Magento order placement observer
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
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
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
Magento → Amplitude · diagnose
Diagnostic order — Magento → Amplitude
- 01
Count orders carrying the user ID and device ID pair
- 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
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.
Magento → Amplitude · prove
How it gets proven — Magento → Amplitude
Source of truth
Magento's sales order records in your own database, for the same window and order status set.
- 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.
- Order data confirmed populated on an order placed through a fully warmed cache.
Magento → 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
- Place a test order as an anonymous visitor through cache
- Check a purchase event for the price and quantity fields 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 → Amplitude · when not to buy
When you don't need this — Magento → 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 Magento build has heavy customisation by another team, scope their availability first — the build is usually blocked there.
- If nobody is building cohorts or retention analysis, this is a large amount of instrumentation for reporting a dashboard already gives you.
Magento → Amplitude · what we deliver
What gets built — Magento → Amplitude
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 Amplitude
The Amplitude HTTP V2 API, posted server-side with the identity, event type and properties.
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 → Amplitude questions, answered
Store the Amplitude device ID on the quote in the browser and copy it to the order, then send the event with that device ID. Guest orders have no customer ID to use as user_id.
Usually refunds via credit memos were never sent, or revenue was sent both per item and per order. Check one order's events against its credit memos.
Almost always because the user ID and device ID pair 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.
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 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.
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 Magento → Amplitude
- Magento → Google AdsConnecting Magento to Google Ads
- Magento → MetaConnecting Magento to Meta Conversions API
- Magento → GA4Connecting Magento to GA4
RELATED GUIDES
Where Magento → Amplitude fits in the rest of your tracking
- Wix → AmplitudeConnecting Wix Stores to Amplitude
- BigCommerce → AmplitudeConnecting BigCommerce to Amplitude
- EDD → AmplitudeConnecting Easy Digital Downloads to Amplitude
- Magento → PostHogConnecting Magento to PostHog
- Magento → MatomoConnecting Magento to Matomo
- FashionConversion tracking for fashion brands, reported net of returns
- Checkout Extensibility → AmplitudeConnecting Shopify Checkout Extensibility to Amplitude
- Swell → AmplitudeConnecting Swell to Amplitude
Free · 30 min
Get Magento and Amplitude joined properly
Free30 minutesNo obligation
