Article

S2S – Branch

Branch is a mobile attribution platform. Combined with Affilae’s Server-to-Server tracking, it lets you track the installs and in-app events your affiliates generate. Affilae records the click, Branch 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. Your app must embed the Branch SDK, and you need admin access to your Branch account.

How it works

  1. The visitor clicks an Affilae tracking link.
  2. Affilae records the click and sends the visitor to your Branch link, with the click ID.
  3. Branch does the attribution, not Affilae.
  4. For every event attributed to Affilae, Branch sends a postback to Affilae with the click ID.
  5. Affilae matches the conversion to the click and computes the commission.

Step 1, enable Affilae in Branch

Affilae is one of Branch’s advertising partners (Ad Partners).

  1. In Branch, open Configuration > Ad Partners (legacy dashboard: Ads > Partner Management).
  2. Search for Affilae and open its page.
  3. Click Enable, and accept the terms if Branch asks you to.

Step 2, create the Branch link

  1. In Branch, create an advertising link: Create Link > Ad Link, then select the Affilae partner.
  2. Set the $fallback_url web fallback to an address of your website, your homepage for instance.
  3. Check that the link carries the parameters below, then copy it.

The link looks like this:

https://your-app.app.link/XXXXXX?$3p=a_affilae&~click_id={ClickID}&~campaign=Affilae&$fallback_url=https://www.your-website.com/

The parameters to keep

Parameter What it does
$3pIdentifies Affilae as the advertising partner. Branch adds it when the link is created for Affilae.
~click_idReceives the Affilae click ID. Keep the {ClickID} value as is: Affilae fills it in on every click.
$fallback_urlWeb page for visitors who do not have the app. Affilae puts the page chosen by the affiliate there.
~campaignOptional. Names the campaign in Branch, which passes it as utm_campaign on web redirects.
Tip You can also use the {affiliateTrackingId}, {affiliateName}, {affiliateGroup}, {programName}, {programId}, {month}, {year} and {adId} tokens in the link, for instance ~secondary_publisher={affiliateTrackingId} to see the affiliate in Branch. Affilae fills in {affiliateName}, {affiliateTrackingId} and {ClickID} on every click, and the other tokens when the link is created ({month} and {year}: the link’s creation date).

Step 3, send the conversions to Affilae

Branch passes conversions to Affilae through a postback, one per event you want to reward.

  1. In Affilae, pick the commission rule for app sales and note its Key. We recommend a rule dedicated to the app, separate from your website rules.
  2. In Branch, on the Affilae partner page, open Postback Config and click Add New Postback.
  3. Pick the event, PURCHASE for instance.
  4. If Branch asks for a postback URL, or to check the one it suggests, use the address below and replace YOUR_AFFILAE_KEY with the rule’s key.
  5. Leave Send all events off: Branch then only sends the events attributed to Affilae.
https://lb.affilae.com/?key=YOUR_AFFILAE_KEY&cids=${(last_attributed_touch_data.~click_id)!}&id=${(event_data.transaction_id)!}&amount=${(event_data.revenue)!}&currency=${(event_data.currency)!}&voucher=${(event_data.coupon)!}
Parameter What it does
keyThe key of the Affilae commission rule
cidsThe Affilae click ID, sent back by Branch
idThe order number
amountThe sale amount, in the order’s currency
currencyThe order’s currency, as an ISO code (EUR, for instance)
voucherThe voucher code used, optional
The amount and its currency go together Use event_data.revenue with event_data.currency. Do not pair revenue_in_usd with the order’s currency: amounts would be wrong for every sale that is not in dollars.
A unique order number Branch may send the same postback twice. Affilae counts one conversion per order number and per rule: always send the real order number in id.

To reward installs as well, add a postback on the INSTALL event the same way, with the key of a rule dedicated to installs. An install has no order number: put Branch’s event ID, ${(id)!}, in id.

What your app must send

For each purchase, the event your app sends to Branch (PURCHASE) must carry these three values:

  • revenue: the order amount.
  • currency: the currency, as a three-letter code (EUR, USD…).
  • transaction_id: the order number, different for every 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 every purchase by the same user is recorded as a separate conversion.

The attribution windows

Branch uses two windows, in the Attribution windows tab of the Affilae page: click to install (7 days by default), the longest time between the click and the install, and click to conversion (30 days by default), the longest time between the click and the purchase. To set them for Affilae only, turn on the override of the global settings in that tab.

On the Affilae side, a postback is credited to the affiliate’s click only if that click is less than the rule’s Tracking duration (in days) old when the postback arrives. Set click to conversion to that duration, and click to install to that duration at most: if Branch attributes a sale to an older click, Affilae cannot credit it to the affiliate.

iOS users who decline tracking On a journey that starts on a website, which is the case for affiliate links, Branch does not attribute to a partner the install of an iOS user who declined tracking: no postback is sent to Affilae for that user. This is the user’s choice, under Apple’s tracking rules (App Tracking Transparency).

Step 4, configure Affilae

  1. In Affilae, open Configuration.
  2. Global settings section: check that the program’s URL format is set to Server-to-Server (S2S).
  3. Then, URL tracking management section: turn on Redirect clicks through an attribution partner (advanced). The next two fields only appear once it is on.
  4. Paste your Branch link into Partner redirection URL.
  5. Enter $fallback_url in Landing page query parameter.
  6. Click Save.
Both fields are required The first says where to go through, the second which parameter Affilae puts the real landing page in. With only one of them, links do not go through Branch, and in-app sales are not attributed to your affiliates.
Your affiliates only use Affilae links Never give your Branch link to your affiliates: paste it into your program configuration, and the Link builder adds it automatically to their tracked links. Your affiliates create their links in Affilae with the address of a page of your website, never with a Branch link.

Step 5, 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 Branch link 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 registered as a test device in Branch (Test Devices), with its advertising ID (IDFA on iPhone, GAID on Android), which the Branch Metrics DeviceID Finder app shows. Branch counts one install per device: before each test, uninstall the app and reset the device in Branch (Refresh, or Reset Device Data on the legacy dashboard). Otherwise the install is counted as a reinstall.
  • On iPhone, open Settings > Privacy & Security > Tracking, turn on Allow Apps to Request to Track, then accept your app’s tracking request.
  • A build of the app without debug mode in the Branch SDK (setDebug): in debug mode, events do not show up in Liveview and trigger no postback.
  • 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 Branch link 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 Branch, Liveview, filter on the partner (ad partner (3p) = a_affilae): the install shows up, attributed to Affilae. Allow up to 30 minutes.
4Make a purchase in the app and write down its order number.In Liveview, Webhook Records tab, filtered on Affilae: the purchase postback 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: it is the purchase postback, with the rule’s 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 Branch link’s redirects do not send to the store. To see where the link sends each platform, open the Branch link without its parameters, followed by ?debug=1 (Branch’s Link Debugger).
The install is not attributed to AffilaeThe device was not reset in Branch before the test, tracking is not allowed on the iPhone, the install happened after the click to install window, or the Branch link no longer carries $3p=a_affilae and ~click_id={ClickID}.
Your test events do not show up in LiveviewThe app is in debug mode (setDebug), or the phone is not registered as a test device for this app.
Install attributed, but no postback in Webhook RecordsNo postback is configured for this event in Postback Config, or the event the app sends is not the postback’s event (PURCHASE, for instance).
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 €0The app does not send revenue with the purchase, or the postback does not use event_data.revenue.
Wrong amount for sales that are not in dollarsThe postback pairs revenue_in_usd with the order’s currency (see step 3).
No order number, or a second purchase is missingThe app does not send transaction_id, or sends the same one for every purchase.
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 Branch shows for this test (the install’s attribution in Liveview, the postback’s response code in Webhook Records). With this, we can find your test on our side.

Key points

  • The Affilae program must be in S2S.
  • Affilae is enabled in Branch, under Ad Partners.
  • The Branch link carries $3p=a_affilae, ~click_id={ClickID} and $fallback_url.
  • One postback per rewarded event, with cids, the order number, and the amount in the order’s currency.
  • Every purchase sends revenue, currency and transaction_id.
  • Branch’s click to install and click to conversion windows do not exceed the rule’s Tracking duration.
  • The Branch link is pasted into the program configuration, never given to affiliates.
  • Testing is done on a reset Branch test device, with an app build without debug mode, and on iPhone with tracking allowed.

Related articles

Frequently asked
questions

Voir plus de questions reponses

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

In Affilae, open Configuration, Tracking tab, expand Integration via an Affilae plugin and pick the rule in Rules and currencies: its Key appears.

$3p=a_affilae, ~click_id={ClickID} and $fallback_url. Without ~click_id, Branch cannot send the click ID back, and the conversion cannot be credited to the affiliate.

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

In this order: that the click comes from a link generated by Affilae, that the postback does carry cids, that the sale happens within the rule’s Tracking duration, and that the app rule is assigned to the affiliate’s group.

No. Affilae counts one conversion per order number and per rule. Always send the real order number in id.

The sale amount in the order’s currency, with a dot as decimal separator (26.10, for instance): event_data.revenue with event_data.currency.

Check that the app is not in debug mode (setDebug): in that mode, Branch does not show events in Liveview and sends no postback. Also check that the phone is registered as a test device for this app.

No. On a journey that starts on a website, Branch does not attribute to a partner an iOS user who declined tracking: no postback is sent to Affilae for that user.

Need help?

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

Contact Us