Sending server-to-server clicks to AppsFlyer

At a glance: Provide attribution link clicks via S2S for users that are sent directly to the app stores.

Attribution link flow

 Caution

Don't accumulate S2S clicks and send them in bulk. Send 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. AppsFlyer relies on clicks for the attribution flow. This means AppsFlyer must log clicks on ads to attribute an install.

When a user clicks on a banner or an ad, the following takes 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 wants to send the user directly to the store, the partner must send the click to AppsFlyer using server-to-server (S2S). Redirecting the user to the store makes for a 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 the partner is responsible for redirecting the user that clicked. See attribution link parameter dictionary

S2S clicks with referrer or device ID

Attribution of installs based on S2S clicks relies on the same matching methods described in the AppsFlyer attribution model.

The recommended and most accurate methods are Install referrer (Android only) or device ID matching. Aggregated Advanced Privacy and Probabilistic modeling are supported but should be used if other methods are unavailable.

Attribution methods available

Referrer

In cases where a partner redirects the user to the store, the partner can append the Google Play as well as other third-party store's 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 must adhere to the following:

  • The prefix should be the name of the partner
  • 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 that follow.

Device ID

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

Android

  • It is best to give priority to the Android advertising ID (GAID). 
  • If you can't send GAID, use the Android ID instead. Hash the Android ID using SHA1.

Android Identifiers

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

 iOS identifiers.

  • &idfa={idfa}
  • &sha1_idfa={sha1_idfa}

Probabilistic modeling

To implement Probabilistic modeling attribution, you must send the following parameters via parameters in the attribution link or via HTTP request headers. See the attribution link parameter dictionary for full details on how these parameters should be used.

  • af_ua
  • af_os_version
  • af_model
  • af_ip

S2S click URL examples

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

The URL examples below are decoded for readability.

Android

With device ID

https://app.appsflyer.com/com.appsflyer.sampleapp?pid=media_source&af_ua=Mozilla%2F5.0%20(Linux%3B%20Android%2012%3B%20Pixel%205)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F95.0.4638.16%20Mobile%20Safari%2F537.36
&af_ip=192.158.1.38&c=campaign_name&advertising_id=f506****-****-****-****-***********&redirect=false

With Google play referrer

https://app.appsflyer.com/com.appsflyer.sampleapp?pid=media_source&af_ua=Mozilla%2F5.0%20(Linux%3B%20Android%2012%3B%20Pixel%205)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F95.0.4638.16%20Mobile%20Safari%2F537.36
&af_ip=192.158.1.38&c=campaign_name&af_ref=NetworkA_1234567&redirect=false

iOS

With device ID

https://app.appsflyer.com/id32********?pid=media_source&af_ua=Mozilla%2F5.0%20(Linux%3B%20Android%2012%3B%20Pixel%205)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F95.0.4638.16%20Mobile%20Safari%2F537.36
&af_ip=192.158.1.38&c=campaign_name&idfa=f506****-****-****-****-***********&redirect=false

S2S configuration for OneLink

When using OneLink links, make sure the following is included in the API call:

  • The GET method with the OneLink link
  • Headers: accept, content-type, and User-Agent

Timing S2S clicks

S2S clicks 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.