S2S – Branch
Discover the most-read articles
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.
How it works
- The visitor clicks an Affilae tracking link.
- Affilae records the click and sends the visitor to your Branch link, with the click ID.
- Branch does the attribution, not Affilae.
- For every event attributed to Affilae, Branch sends a postback to Affilae with the click ID.
- 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).
- In Branch, open Configuration > Ad Partners (legacy dashboard: Ads > Partner Management).
- Search for Affilae and open its page.
- Click Enable, and accept the terms if Branch asks you to.
Step 2, create the Branch link
- In Branch, create an advertising link: Create Link > Ad Link, then select the Affilae partner.
- Set the $fallback_url web fallback to an address of your website, your homepage for instance.
- Check that the link carries the parameters below, then copy it.
The link looks like this:
The parameters to keep
| Parameter | What it does |
|---|---|
| $3p | Identifies Affilae as the advertising partner. Branch adds it when the link is created for Affilae. |
| ~click_id | Receives the Affilae click ID. Keep the {ClickID} value as is: Affilae fills it in on every click. |
| $fallback_url | Web page for visitors who do not have the app. Affilae puts the page chosen by the affiliate there. |
| ~campaign | Optional. Names the campaign in Branch, which passes it as utm_campaign on web redirects. |
Step 3, send the conversions to Affilae
Branch passes conversions to Affilae through a postback, one per event you want to reward.
- 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.
- In Branch, on the Affilae partner page, open Postback Config and click Add New Postback.
- Pick the event, PURCHASE for instance.
- 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.
- Leave Send all events off: Branch then only sends the events attributed to Affilae.
| Parameter | What it does |
|---|---|
| key | The key of the Affilae commission rule |
| cids | The Affilae click ID, sent back by Branch |
| id | The order number |
| amount | The sale amount, in the order’s currency |
| currency | The order’s currency, as an ISO code (EUR, for instance) |
| voucher | The voucher code used, optional |
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.
Step 4, configure Affilae
- In Affilae, open Configuration.
- Global settings section: check that the program’s URL format is set to Server-to-Server (S2S).
- Then, URL tracking management section: turn on Redirect clicks through an attribution partner (advanced). The next two fields only appear once it is on.
- Paste your Branch link into Partner redirection URL.
- Enter $fallback_url in Landing page query parameter.
- Click Save.
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 |
|---|---|---|
| 1 | In 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. |
| 2 | Send 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. |
| 3 | The 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. |
| 4 | Make 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. |
| 5 | In 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. |
| 6 | Refuse 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. |
If something does not come through
| What you see | What to check |
|---|---|
| No click in Clicks | The 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 store | You 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 Affilae | The 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 Liveview | The 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 Records | No 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 Affilae | The 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 €0 | The 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 dollars | The postback pairs revenue_in_usd with the order’s currency (see step 3). |
| No order number, or a second purchase is missing | The app does not send transaction_id, or sends the same one for every purchase. |
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
- S2S, Server-to-Server
- S2S – AppsFlyer
- S2S – Adjust
- Affilae tracking fundamentals
- Testing click and conversion tracking
- All available integrations
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.
