Installation
- Bundle
- CDN
Attribution Variables
Three variables are injected automatically:On the very first launch of a fresh install,
appsFlyerAttribution is null until AppsFlyer responds (typically within a few seconds, and on iOS after the App Tracking Transparency prompt is answered, which the SDK waits up to 60 seconds for). Once resolved, the data is persisted natively and is available immediately on every future cold start, even offline.appsFlyerReferrer
The fastest way to branch on acquisition source. A single lowercase string resolved in this order:deep_link_valuefrom the attributed link, if presentdeep_link_sub1, if present- A known ad network with an organic or paid suffix, one of:
utm_source, if present- The raw
media_source, if present "organic", the default when nothing else matched
appsFlyerAttribution
The full attribution object. All fields are optional strings unless noted.string
The attributed network, e.g.
"tiktok", "facebook", "google".string
Campaign name. Also mirrored to
c for affiliate-style reads.string
Full campaign hierarchy for granular reporting.
string
Additional network metadata when the partner provides it.
string
Mapped from
af_sub1. Use for affiliate and creator payout tracking.string
UTM parameters from the link. When absent, they fall back to
af_sub1 through af_sub5 respectively.string
Affiliate-style aliases:
pid falls back to media_source, c falls back to campaign.string
Deep link routing values from the OneLink.
deep_link_value plus deep_link_sub1 through deep_link_sub10 are the fields AppsFlyer guarantees on a deferred first-launch resolution. See Deep Linking.string
Normalized to a top-level field on both platforms.
page_id is the one custom OneLink param Despia lifts out of the raw payload for you. Any other custom key lives only under raw.boolean
true when AppsFlyer classified the install as organic (af_status).string
"install", "re-engagement", or "re-attribution".boolean
true only on the very first launch after install.string
Same value as
despia.appsFlyerUID.string
Campaign cost data when available (
cost_value falls back to af_cost_value, cost_currency to af_cost_currency).string
Timestamps of the attributed click and the install.
object
Every raw key and value AppsFlyer returned, as strings. Custom parameters you add to a OneLink (e.g.
creator_code, episode_id) appear here. page_id appears here too but is also normalized to a top-level field.Example object
Example object
appsFlyerUID
The AppsFlyer device identifier. Send it to your backend to run server-to-server events or to join AppsFlyer raw-data exports with your own database.Request Attribution On Demand
The injected variables are refreshed automatically, but you can also request them explicitly and await the result:Personalize Onboarding by Source
Branch on the referrer for a quick check, and drop into the full attribution object when you need campaign or deep link detail.Resources
NPM Package
despia-native