Article

S2S – AppsFlyer

AppsFlyer is a mobile attribution platform. Paired with Affilae Server-to-Server tracking, it lets you track installs and in-app events generated by your affiliates. Affilae collects the click, AppsFlyer does the attribution, then sends the conversions back to Affilae.

Requirements Your program’s URL format must be set to Server-to-Server (S2S), under Configuration then Global Settings. That setting switches tracking links to redirection and validates the conversion server side. You also need administrator access to your AppsFlyer account.

How it works

  1. The visitor clicks an Affilae tracking link.
  2. The click is passed to AppsFlyer through the attribution link.
  3. AppsFlyer performs the attribution, not Affilae.
  4. AppsFlyer automatically sends the configured conversions and events to Affilae.
  5. Affilae picks up the data it needs to compute commissions.

Step 1, configure AppsFlyer

Start by adding Affilae as a partner.

  1. In AppsFlyer, open Collaborate > Partner Integrations, Marketplace tab.
  2. Search for Affilae, then click its card or Integrate.
  3. In the Integration tab, turn on Activate partner.
  4. Do this for each app concerned. Affilae then shows up in the Active integrations tab.
Searching for Affilae in the AppsFlyer partner list
Affilae in the AppsFlyer integrated partner list.

Configure each app, iOS and Android

The setup is done app by app, iOS and Android: each one has its own settings and its own events.

Prepare your rules in Affilae first: a rule dedicated to app sales, and a rule dedicated to installs if you reward them. Check that they apply to the relevant affiliate groups. Each rule’s Key is in Configuration, Tracking tab: expand Integration via an Affilae plugin and pick the rule in Rules and currencies.

The General settings Key field is for installs Under General settings, the Key field sets the Key sent with each install. Enter your install rule’s Key, or leave it empty (or enter none) if you do not reward installs. Never enter your purchase rule’s Key there: every install would be counted as a sale.

Set up the events

  1. List the events you want to track: install, purchase, or any other useful event.
  2. Map each event to the right Affilae Key.
  3. Only enable for Affilae the events mapped to an Affilae Key. Browsing events (af_content_view, af_list_view, af_add_to_cart…) play no part in commissions: Affilae does not use them.
  4. Check that those events are enabled for the Affilae partner, and that In-app event postbacks is turned on.
  5. For each purchase event, set Send revenue to Values & revenue. Otherwise AppsFlyer does not send the amount or the order number to Affilae.
Do not narrow the postback source On postbacks, the for users from menu should stay on the widest option, All media sources, including organic. Affilae then also receives the events of users who did not come from an affiliate, which makes it possible to check, from setup and before the first affiliate click, that your app sends its events correctly, with their amount and order number. Narrowing it to this partner only removes that check.
Advanced Privacy (for iOS 14.5+) This setting only affects iOS users who declined tracking. Off, AppsFlyer sends Affilae the usual postback, with the click ID: the conversion is credited to the affiliate. On, AppsFlyer only sends aggregated data for these users, without the click ID: Affilae cannot credit the conversion to an affiliate. This setting depends on your privacy policy and on Apple’s tracking rules (App Tracking Transparency): the choice is yours.
Integration tab of the Affilae partner in AppsFlyer
The Affilae partner Integration tab: partner activated, Key field empty (no paid installs), postbacks on All media sources, including organic, and the purchase event mapped to its Key with Values & revenue. Advanced Privacy is on here: see the box above.

What your app must send

For each purchase, the event your app sends to AppsFlyer (for instance af_purchase) must carry these three parameters:

  • af_revenue: the order amount.
  • af_currency: the currency, as a three-letter code (EUR, USD…).
  • af_order_id: the order number, different for each purchase.

The order number becomes the conversion’s identifier in Affilae (ID column). You can then find the matching order when you validate the conversion, and each purchase by the same user is recorded as a separate conversion.

Step 2, get the OneLink

  1. In AppsFlyer, open Attribution link.
  2. Select or create the OneLink matching your app.
  3. Check its configuration.
  4. Copy the attribution link it generates.

The link looks like this:

pid=affilae2_int&af_siteid={affiliateId}&af_c_id={programId}&af_click_lookback=7d&clickid={ClickID}

The parameters to keep

Parameter What it does
pidIdentifies the AppsFlyer media source
af_siteidIdentifies the affiliate
af_c_idIdentifies the program
clickidIdentifies the click uniquely
af_click_lookbackSets the post-click attribution window
AppsFlyer Attribution link screen, OneLink type selected
The Attribution link screen: the OneLink type selected, and the link parameters below.

The af_click_lookback window

This parameter sets how long after the click AppsFlyer can still credit an install to it. The default is 7 days, and it is configurable in AppsFlyer: accepted values currently range from 1 to 30 days.

Pick a duration that matches your attribution strategy: a long window credits more conversions to your affiliates, a short one limits them to quick installs.

On the Affilae side, the rule’s Tracking duration (in days) counts too: an event is only matched to the affiliate’s click if that click is more recent than this duration when the event reaches Affilae. A later purchase is not matched to the click, even if AppsFlyer still attributes it to Affilae. Set it at least as long as af_click_lookback, and long enough to cover the purchases you want to reward after the install.

OneLink and deep linking

If your program has no mobile app, none of this concerns you. As soon as an app is involved, AppsFlyer requires a universal link, the OneLink, able to handle iOS, Android and a web fallback on its own.

The OneLink adapts the journey to the visitor’s situation:

  • on desktop: off to your website;
  • on mobile without the app installed: off to the store, or to your website, depending on the template chosen;
  • on mobile with the app installed: it can open straight away, depending on your OneLink and on the app the link is opened in. Some apps, Instagram for instance, open links in their own browser, without opening your app. After a tracking link’s redirect, iOS does not always open the app: see “If something does not come through”.

Deep linking goes further: instead of simply opening the app, it sends the visitor to a specific page or piece of content inside it. The parameters driving this are deep_link_value, af_ios_url, af_android_url and af_web_dp, and they are declared in the Landing page query parameter, in step 3.

To check in AppsFlyer The OneLink Template must be properly configured for the iOS, Android and web destinations matching the journey you want. An incomplete template gives you a link that works on one platform and not the other.

The is_retargeting=true parameter, recommended

We recommend adding this parameter to your OneLink:

is_retargeting=true

With it, AppsFlyer credits your affiliates for:

  • new installs, exactly as without the parameter;
  • reinstalls by users who had the app before;
  • users who already have the app and open it from an affiliate link, for their events during the re-engagement window set in AppsFlyer (30 days by default).

Without it, the last two cases do not appear in Affilae. If you only want to reward new users, do not add it, or map the Affilae Key only to events specific to new users.

Step 3, configure Affilae

  1. In Affilae, open Configuration.
  2. Global Settings section: check that the program’s URL format is indeed Server-to-Server (S2S).
  3. Then, URL tracking management section: turn on Redirect clicks through an attribution partner (advanced). The two fields below only appear afterwards.
  4. Paste the AppsFlyer OneLink into Partner redirection URL.
  5. Fill in the Landing page query parameter with the destination parameters, separated by commas. Each parameter you list must already be in your OneLink with a full address (https://…); otherwise it is ignored and the visitor lands on the OneLink’s default destination.
  6. Click Save.
Both fields are required, not just the first one The application says so in the option’s own hint: both fields below are required for this to work. The first one says which way to go, the second says which keys Affilae must inject the real destination into. With only one of the two, links do not go through AppsFlyer, and in-app sales are not credited to your affiliates.

This option exists for exactly this case: the application’s hint names mobile attribution platforms, AppsFlyer among them.

Always create your tracked links with Affilae: the Link builder, the Chrome extension, or the API for tools that generate links automatically. This applies whatever the program’s tracking mode: C2S, S2S or mobile attribution partner (AppsFlyer…). Do not edit a generated link: to change the destination page or add a SubID, generate a new link. A link edited by hand or assembled outside Affilae may not record your clicks and sales. Never give your OneLink to your affiliates: paste it into your program configuration, and the Link builder uses it automatically.
Tip In the OneLink, replace hard-coded values with tokens: Affilae fills in {affiliateId}, {affiliateName}, {affiliateTrackingId} and {ClickID} on every click, and the other tokens when the link is created ({month} and {year}: the link’s creation date). The accepted tokens are {affiliateName}, {affiliateGroup}, {affiliateTrackingId}, {programName}, {programId}, {month}, {year} and {adId}. Without them, every click comes back with the same value, and per-affiliate attribution becomes impossible. The {affiliateId} and {ClickID} tokens, already in the link AppsFlyer provides, are also filled in on every click: do not change them.

Step 4, the final test

The test replays a customer’s journey: a click on an affiliate link, the app install, then a purchase. Run it on a phone, never on a computer: on a computer, the OneLink sends visitors to your website, and no install is possible.

Prepare the test

  • A test partnership in Affilae, to generate the link. Your app rules must apply to its group.
  • A phone that never had the app, or registered in AppsFlyer as a test device (Test devices). Otherwise AppsFlyer counts a reinstall, which is not attributed to your click.
  • On iPhone, open Settings > Privacy & Security > Tracking, turn on Allow Apps to Request to Track, then accept your app’s tracking request. Also turn off iCloud Private Relay for the test.
  • In AppsFlyer: re-engagement on, deep link configured, postbacks on All media sources, including organic.
  • One person, one phone at a time, from the country your program targets. Write down the time of each action.

The test, step by step

# Do Check
1In Affilae, open the Link builder, pick the test partnership and a page of your website, then copy the Tracked link.The link starts with https://lb.affilae.com/r/ and contains your OneLink in encoded form: that is normal, do not edit it.
2Send the link to yourself by text message or email, and tap it on the phone.In Affilae, program menu, Clicks: a new row shows up within seconds, with your test partnership.
3The store opens: install the app, then open it.In AppsFlyer, the install is attributed to the affilae2_int media source, for instance in Raw data export > Installs, if your AppsFlyer plan includes it. Allow up to 30 minutes.
4Make a purchase in the app and write down its order number.In AppsFlyer, Raw data export > Postbacks: the postback to Affilae shows up, with response code 200.
5In Affilae, open Conversions and paste the order number into the ID search.The conversion shows up with its amount and your test partnership. Its Conversion funnel shows the click from step 2.
6Refuse the test conversion: tick it, click Refuse, choose the Test order or tracking error reason, then click Confirm. If it is locked, refusing is no longer offered: on 2026 plans, select it and click Contest; otherwise, contact support.A test conversion is still a real conversion, with a commission to pay. Details in Testing click and conversion tracking.
Tip Do not test the install only. Trigger at least one purchase event, because it is the match between the event and the Affilae Key that decides the commission.

If something does not come through

What you see What to check
No click in ClicksThe link comes from the Link builder and was not edited. The program is in S2S, with Redirect clicks through an attribution partner (advanced) on and both its fields filled in.
The link opens your website instead of the storeYou are testing on a computer, or the OneLink Template does not send to the store.
The link opens the store although the app is installedSend yourself the OneLink alone by text message and tap it: a link pasted into Safari’s address bar never opens the app. If it opens the store, your app does not recognize this OneLink’s domain. If you set up a custom domain in AppsFlyer (Branded Links, for instance onelink.your-brand.com), test the same link with that domain: if it opens the app, replace only the domain at the start of the link in Partner redirection URL. For instance: https://your-app.onelink.me/AbCd?pid=affilae2_int&… becomes https://onelink.your-brand.com/AbCd?pid=affilae2_int&…. Otherwise, your developers must add the OneLink domain to the app’s associated domains (Associated Domains on iOS).
The OneLink alone opens the app, but the Affilae link does notAfter a redirect from another domain, iOS does not always open the app, and AppsFlyer then sends to the store. In Partner redirection URL, add to the OneLink your app’s URI scheme in af_dp (for instance af_dp=your-app://) and af_force_deeplink=true: Safari then asks the user whether to open the app. In other browsers, and in in-app browsers, the result is not guaranteed. Also test on a phone without the app: it must land on the store.
The install is not attributed to affilae2_intThe phone had the app before, tracking is not allowed on the iPhone, iCloud Private Relay is on, or the install happened after the af_click_lookback window.
Some iOS conversions are missing, while Android worksAdvanced Privacy is on: for iOS users who declined tracking, AppsFlyer does not send the click ID (see step 1).
Install attributed, but no postback to AffilaeActivate partner or In-app event postbacks is off, or the event is not mapped to an Affilae Key.
Postback sent (code 200), but no conversion in AffilaeThe Key belongs to another program’s rule, the rule does not apply to the test partnership’s group, the currency sent is not one of the rule’s Currencies, or the test was run outside the targeted country. Otherwise, contact us (below).
Conversion at €0Send revenue is not on Values & revenue, or the app does not send af_revenue.
No order number, or a second purchase is missingThe app does not send af_order_id, or sends the same one for every purchase.
Every install creates a saleThe General settings Key field holds your purchase rule’s Key (see step 1).
Still nothing after 30 minutes? Write to your Affilae contact with: the time of the click and of the purchase, with the time zone; the phone’s system (iOS or Android); the order number of the test purchase; what AppsFlyer shows for this install (media source, new install or reinstall, postback status). With this, we can find your test on our side.

Key points

  • The Affilae program must be in S2S, therefore on redirection links.
  • AppsFlyer does the attribution and sends the conversions back to Affilae.
  • The setup is done for each app, iOS and Android.
  • The Affilae Key must be mapped to the events you track.
  • The General settings Key field holds the install rule’s Key, or stays empty.
  • Each purchase sends af_revenue, af_currency and af_order_id, with Send revenue set to Values & revenue.
  • The OneLink must be configured before being pasted into Affilae.
  • Never give your OneLink to your affiliates: paste it into your program configuration, and the Link builder uses it automatically.
  • The pid, af_siteid, af_c_id and clickid parameters must stay in the link.
  • af_click_lookback ranges from 1 to 30 days, 7 by default.
  • The rule’s Tracking duration covers af_click_lookback and the purchases to reward after the install.
  • Deep linking is set in the OneLink Template, and its parameters are declared in step 3.
  • is_retargeting=true is recommended: it also credits your affiliates for reinstalls and existing users.
  • The test must cover the click, the install and an in-app event.

Related articles

Frequently asked
questions

See more questions

S2S switches your links to redirection and validates the conversion server side. That is what lets AppsFlyer send conversions to Affilae automatically. Without that setting, the integration cannot work.

In AppsFlyer, open Attribution link, then take the link matching the OneLink or Template used for your app.

No. Paste it into your program configuration: the Link builder adds it automatically to your affiliates’ tracked links. A OneLink shared as is, or inserted by hand into an Affilae link, may not record clicks and conversions.

Check the ones identifying the source, the affiliate, the program and the click: pid, af_siteid, af_c_id and clickid. The af_click_lookback parameter also sets the post-click attribution window.

It depends on af_click_lookback. The window is 7 days by default, and it is configurable in AppsFlyer between 1 and 30 days. Past that duration, the install is no longer tied to the click. After that, a purchase is only matched to the click within the Affilae rule’s Tracking duration, counted from the click.

An Affilae rule’s Key is mapped to an AppsFlyer event: it tells which rule rewards that event. The Key field under General settings is for installs: your install rule’s Key, or empty (none) if you do not reward them.

Yes. The setup is done app by app: each one has its own configuration and its own events.

Check that you filled in both fields, not just the first one. The application’s hint is explicit: the partner redirection URL and the landing page query parameter are both required. Also check that Redirect clicks through an attribution partner (advanced) is actually turned on.

In this order: that the Affilae program is in S2S, that the OneLink used is the one for the app being tested, that the link carries the expected parameters, that the click shows up in Clicks, on the Affilae side, and finally that the OneLink Template and redirections are properly configured.

The link probably carries a hard-coded value where a token belongs. Replace it with {affiliateTrackingId}, which Affilae fills in on every click. The other available tokens are {affiliateName}, {affiliateGroup}, {programName}, {programId}, {month}, {year} and {adId}.

Yes, it is recommended. New installs are still attributed as usual, and your affiliates are also credited for reinstalls and for existing users who open the app from their link. If you only want to reward new users, do not add it.

Your phone most likely had the app before: AppsFlyer then counts a reinstall, which is not attributed to the new click. Test again on a device that never had the app, or register it as a test device in AppsFlyer.

Yes. Once the integration is correctly configured, AppsFlyer passes the configured conversions and events to Affilae automatically.

Need help?

Stay up to date with the latest trends in affiliate marketing and never miss any of our articles.

Contact Us