Regular Click Flow
AppsFlyer relies on clicks for its attribution flow. This means that AppsFlyer must log clicks on ads to attribute an install.
When a user clicks on a banner or an ad, the following steps take place:
- The user is redirected to AppsFlyer
- AppsFlyer logs the click
- AppsFlyer redirects the user to the app store
- The user installs the app
- AppsFlyer attributes the install
Sending S2S Clicks to AppsFlyer
If a partner wishes to send the user directly to the store, the partner should also send a Server-to-Server (S2S) click to AppsFlyer.
Redirecting the user to the store makes for better user experience by reducing the number of redirections.
The S2S click URL is similar to the regular click URL. The only difference is that the S2S URL should include the parameter
&redirect=false. This parameter lets AppsFlyer know that this is an S2S click and that no redirect should take place.
S2S Clicks with Referrer or Device ID
The best way to attribute an install is via device ID or referrer.
In cases where a partner redirects the user to the store, the partner can append the Google Play Referrer to the link that they send to the store and also on the S2S click that they send to AppsFlyer.
This allows AppsFlyer to use the referrer as the attribution method for S2S clicks.
The ID (referrer) that the partner generates MUST be unique and should follow these guidelines:
- The prefix should be the name of the partner
- The ID must include the unique transaction ID per click
The store URL should contain the transaction ID under the referrer parameter.
The partner should append the referrer on the S2S click that it sends to AppsFlyer. The referrer is appended to the
af_ref parameter. See examples below.
The device ID can be added to the click URL in any of the following methods:
It is recommended to always send the Android advertising ID.
If you cannot send the Android advertising ID use the Android ID instead. The Android ID must be hashed using SHA1.
If a partner cannot append an advertising ID or a referrer to the click URL, AppsFlyer falls back to its fingerprinting method for attribution.
In such cases, the partner must append the following parameters to the S2S Click URL:
&af_ua- Device User Agent
&af_ipThe IP of the Device
&af_lang- Device Language
Device User Agent
The device user agent includes common identifiers such as device model, operating system and more.
Dalvik/2.1.0 (Linux; U; Android 8.1.0; SM-J730G Build/M1AJQ)
<App or Browser>/<version> CFNetwork/<version> Darwin/<version>
The value for the
af_lang parameter should be formatted according to the ISO 639-1 standard. For example:
- English - en
- Russian - ru
- Spanish - es
If you wish to localize, follow the Language Localisation standard. For example:
- American English - en-US
- British English - en-GB
- Mainland Chinese - zh-CN
- Mexican Spanish - es-MX
It is important that the user's IP is sent on the click rather than IP of the server that sends the click. There are 2 ways of doing this:
- Send it using the HTTP header X-Forwarded-For
- To append it on the click using the parameter
In cases where both of the above are appended to the click URL, the
af_ip on the click prevails.
To send S2S clicks for AppsFlyer to attribute using fingerprinting, the partner must be whitelisted.
To be whitelisted please reach out to your dedicated Partner Development Manager or to email@example.com.
S2S Click URL Examples
The URL examples below are decoded for readability.
When you send S2S clicks, make sure the URL is encoded.
With Device ID
With Google Play Referrer
https://app.appsflyer.com/com.appsflyer.sampleapp?pid=media_source&c=campaign_name &af_ua=Dalvik/2.1.0 (Linux; U; Android 8.1.0; SM-J730G Build/M1AJQ)&af_lang=en-us &af_ip=192.168.0.1&redirect=false
With Device ID
With Google Play Referrer
https://app.appsflyer.com/id32********?pid=media_source&c=campaign_name &af_ua=SampleApp/1 CFNetwork/902.2 Darwin/17.7.0&af_lang=en-us&af_ip=192.168.0.1&redirect=false
Timing S2S Clicks
S2S click should be sent in real-time. This means that the partner sends the S2S clicks immediately after it sends the user to the relevant app store.
If the S2S click is not sent in real-time AppsFlyer might not attribute the install.
Do not accumulate S2S clicks and send them in bulk. Send the S2S clicks immediately after the user clicks an ad or a banner.
Otherwise, AppsFlyer might not attribute the install which could result in revenue loss for the partner.