Connecting Magento to AppsFlyer
Magento is self-hosted and endlessly customisable, which means every installation is different and full-page caching is always in the way. AppsFlyer exists because mobile app attribution is a different problem from web attribution, and on iOS a large share of it is now aggregated and delayed by design rather than by accident. The join between them succeeds or fails on one thing: whether the AppsFlyer device identifier, appsflyer_id reaches the Magento order before the conversion happens, because AppsFlyer can only match a conversion it can tie back to a click it recognizes.
Free30 minutesNo obligation
Specific to this pair
Magento to AppsFlyer: send only app-channel orders
On headless Magento, have the app pass its appsflyer_id with the GraphQL place-order call, store it as order data in the observer, and post to AppsFlyer's server-to-server events API only when it's present, with the increment ID as event identifier. Web orders stay out. Send subtotal after discount in order currency, avoid unpaired SDK duplicates, and post credit memo reversals.
A headless Magento with a native app means one order table holding web and app purchases together, and AppsFlyer should see only the second group. The usual mistake is a single server-to-server hook on order placement that posts everything, so web orders arrive with no appsflyer_id and pile up as organic revenue, or get matched to a stale device and inflate a network's ROAS.
Have the app pass its appsflyer_id with the GraphQL place-order call, store it as order data in the observer, and post to AppsFlyer's server-to-server events API only when that value is present. Use the order increment ID as the event identifier, and do not also fire the purchase from the app SDK unless both share it. AppsFlyer forwards to ad networks, so a duplicate becomes duplicate revenue in Meta and Google as well.
Revenue needs a decision. Magento's grand total includes tax and shipping, and networks optimizing on it will chase high-shipping baskets; send subtotal after discount in the order currency and keep it consistent. Credit memos should post a reversal where AppsFlyer supports one for your setup; confirm the event it expects. Full-page cache is not the issue on this pair, since app checkout never touches it; the device identifier is.
Magento → AppsFlyer · what breaks
Why this join usually fails — Magento → AppsFlyer
- 01
The AppsFlyer device identifier, appsflyer_id 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
Web conversions sent to a mobile attribution platform
This is the common error and it produces confident nonsense. A purchase made on your website has no device identifier and no install behind it. AppsFlyer will either discard it or attribute it to nothing, and the revenue disappears somewhere between the two systems without anyone noticing it went.
- 04
Nothing reconciles afterwards
AppsFlyer shows the event on the raw data export with its attributed media source. Check the raw export, not the aggregate dashboard, and confirm the event carries a device identifier rather than landing as organic.
Magento → AppsFlyer · the fix
What working looks like — Magento → AppsFlyer
The AppsFlyer device identifier, appsflyer_id on every order
Conversions arriving in AppsFlyer
The event is attributed to the install source, forwarded to whichever networks are configured, and appears in the cohort reporting.
Reconciled against the source
Magento → AppsFlyer · architecture
How Magento and AppsFlyer 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
AppsFlyer needs a click to match
AppsFlyer needs the device identifier and an event name it recognizes, plus the revenue value for in-app purchases. A server event about a user with no linked device cannot be attributed to an install.
- 3
The identifier is the bridge
The AppsFlyer device identifier, appsflyer_id, 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
AppsFlyer deduplicates in-app events by its own event identifier. Sending the same purchase from both the SDK and your server produces two events and double-counts revenue in every dashboard downstream, including the ad networks AppsFlyer forwards to.
Magento → AppsFlyer · normal or broken
Working vs. broken, side by side — Magento → AppsFlyer
Normal, not a fault
The AppsFlyer device identifier, appsflyer_id present on the order
Sent from the Magento order placement observer
Deduplicated correctly
AppsFlyer deduplicates in-app events by its own event identifier. Sending the same purchase from both the SDK and your server produces two events and double-counts revenue in every dashboard downstream, including the ad networks AppsFlyer forwards to.
Reconciles with the source
Actually broken
The AppsFlyer device identifier, appsflyer_id 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
This is the common error and it produces confident nonsense. A purchase made on your website has no device identifier and no install behind it. AppsFlyer will either discard it or attribute it to nothing, and the revenue disappears somewhere between the two systems without anyone noticing it went.
Nobody has reconciled it
Magento → AppsFlyer · diagnose
Diagnostic order — Magento → AppsFlyer
- 01
Count orders carrying the AppsFlyer device identifier, appsflyer_id
- 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 what share of your revenue happens in the app at all
If most purchases are on the web, AppsFlyer is not your conversion destination and the work belongs somewhere else entirely.
- 05
Read the match rate, not the success message
AppsFlyer shows the event on the raw data export with its attributed media source. Check the raw export, not the aggregate dashboard, and confirm the event carries a device identifier rather than landing as organic.
Magento → AppsFlyer · prove
How it gets proven — Magento → AppsFlyer
Source of truth
Magento's sales order records in your own database, for the same window and order status set.
- The AppsFlyer device identifier, appsflyer_id confirmed present on a live order.
- In-app revenue events reconciled per transaction against your billing system, with the organic share stated rather than assumed away.
- Order data confirmed populated on an order placed through a fully warmed cache.
Magento → AppsFlyer · free audit
What we check in the free audit
- Count orders carrying the AppsFlyer device identifier, appsflyer_id
- Follow one real conversion end to end
- Place a test order as an anonymous visitor through cache
- Check what share of your revenue happens in the app at all
- 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 → AppsFlyer · when not to buy
When you don't need this — Magento → AppsFlyer
- Measure identifier coverage yourself first — pull your last hundred orders and count how many carry the AppsFlyer device identifier, appsflyer_id.
- If your Magento build has heavy customisation by another team, scope their availability first — the build is usually blocked there.
- If you have no mobile app, this is not a destination for you. If you have one but sell mostly on the web, send web conversions to your ad platforms directly and use AppsFlyer only for install and in-app events.
Magento → AppsFlyer · what we deliver
What gets built — Magento → AppsFlyer
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 AppsFlyer
The AppsFlyer server-to-server events API, posted from your billing system with the device identifier and revenue.
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 → AppsFlyer questions, answered
Web orders without an appsflyer_id are being posted, or the app is not passing its ID at checkout. Send only orders that carry the app's identifier.
Pick one definition, usually subtotal after discounts without tax and shipping, and use it everywhere so networks optimize on the same number.
Almost always because the AppsFlyer device identifier, appsflyer_id 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.
AppsFlyer assigns its own device ID and matches installs to clicks through referrer data on Android and Apple's frameworks on iOS. There is no durable cross-device identifier. On iOS without ATT consent, attribution falls back to SKAdNetwork, which returns aggregated conversion values on a delay with no user-level detail at all — so a share of your installs will be attributable only in aggregate, permanently.
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.
AppsFlyer shows the event on the raw data export with its attributed media source. Check the raw export, not the aggregate dashboard, and confirm the event carries a device identifier rather than landing as organic.
More on Magento → AppsFlyer
- Magento → Google AdsConnecting Magento to Google Ads
- Magento → MetaConnecting Magento to Meta Conversions API
- Magento → GA4Connecting Magento to GA4
RELATED GUIDES
Where Magento → AppsFlyer fits in the rest of your tracking
- Shopify → AppsFlyerConnecting Shopify to AppsFlyer
- Shopify POS → AppsFlyerConnecting Shopify POS to AppsFlyer
- BigCommerce → AppsFlyerConnecting BigCommerce to AppsFlyer
- FashionConversion tracking for fashion brands, reported net of returns
- Gumroad → AppsFlyerConnecting Gumroad to AppsFlyer
- EDD → AppsFlyerConnecting Easy Digital Downloads to AppsFlyer
- Squarespace → AppsFlyerConnecting Squarespace Commerce to AppsFlyer
- Braintree → AppsFlyerConnecting Braintree to AppsFlyer
Free · 30 min
Get Magento and AppsFlyer joined properly
Free30 minutesNo obligation
