How to send S2S clicks to AppsFlyer?

  • Ad Networks

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:

  1. The user is redirected to AppsFlyer
  2. AppsFlyer logs the click
  3. AppsFlyer redirects the user to the app store
  4. The user installs the app
  5. 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.

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:

  1. The prefix should be the name of the partner
  2. The ID must include the unique transaction ID per click

Example: NetworkA_1234567

The store URL should contain the transaction ID under the referrer parameter.

Example:

https://play.google.com/store/apps/details?id=app_name&hl=en&referrer=NetworkA_1234567

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.

Device ID

The device ID can be added to the click URL in any of the following methods:

Android iOS

Android

  • &android_id={android_id}
  • &sha1_android_id={sha1_android_id}
  • &advertising_id={advertising_id}
  • &sha1_advertising_id={sha1_advertising_id}

 Note

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.

Fingerprinting Support

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_ip The 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.

Examples:

Android

Dalvik/2.1.0 (Linux; U; Android 8.1.0; SM-J730G Build/M1AJQ)

iOS

<App or Browser>/<version> CFNetwork/<version> Darwin/<version>

Device Language

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

Device IP

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:

  1. Send it using the HTTP header X-Forwarded-For
  2. To append it on the click using the parameter af_ip

In cases where both of the above are appended to the click URL, the af_ip on the click prevails.

 Important!

Sending S2S clicks with any of the 3 above parameters tells AppsFlyer to attribute the install using fingerprinting.

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 partners@appsflyer.com.

S2S Click URL Examples

 Note

The URL examples below are decoded for readability.

When you send S2S clicks, make sure the URL is encoded.

Android

With Device ID

https://app.appsflyer.com/com.appsflyer.sampleapp?pid=media_source&c=campaign_name
&advertising_id=f506****-****-****-****-***********&redirect=false

With Google Play Referrer

https://app.appsflyer.com/com.appsflyer.sampleapp?pid=media_source&c=campaign_name
&af_ref=NetworkA_1234567&redirect=false

Fingerprinting

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

iOS

With Device ID

https://app.appsflyer.com/id32********?pid=media_source&c=campaign_name
&idfa=f506****-****-****-****-***********&redirect=false

With Google Play Referrer

https://app.appsflyer.com/id32********?pid=media_source&c=campaign_name
&af_ref=NetworkA_1234567&redirect=false

Fingerprinting

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.

 Warning

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.

Was this article helpful?
1 out of 1 found this helpful