Article

S2S – Server-to-Server

Server-to-Server (S2S) is a click and conversion tracking method that works differently from C2S: the Affilae JavaScript tag is not required. It relies on a unique click identifier, the clickID, which you store on your side and send back to Affilae when the conversion happens.

This clickID is unique and travels as a variable throughout the whole conversion funnel. It is what identifies the partner to be compensated.

Prerequisites: your program’s URL format must be set to Server-to-Server (S2S). This setting switches tracking links to redirect mode and validates conversions server-side. CMP implementation remains mandatory.

Set your program to Server-to-Server

  1. In the sidebar, click Programs, then click your program name.
  2. Click Configuration.
  3. Open the Global Settings section.
  4. On the URL format field, select Server-to-Server (S2S).
Affilae
MANAGE MY PROGRAMS
My program
Configuration
My affiliates
Medias
Clicks
Conversions
The « Configuration » item in the program menu, advertiser side.

Why use S2S

  • Tracking does not depend on a script loaded on your website: it is more resilient to ad blockers.
  • Affilae records the click during the redirect, without depending on a script loaded on your website.
  • You keep full control over the clickID, since you are the one storing it.
  • Tracking works on mobile, where cookies are often blocked.
  • It is the ideal approach for mobile attribution with a solution such as Branch or Appsflyer.

How it works, from click to conversion

The click

  1. A user clicks on an affiliate link.
  2. Affilae generates a unique clickID, for example 603ed1800000000000000000.
  3. The clickID is automatically appended to your landing page: https://yoursite.com/?aecid=603ed1800000000000000000
Warning: the clickID is not appended when the click is not recorded, for example if the partnership is not approved or if a « Stop tracking » capping is reached. A click from a country outside Geo Targeting gets a clickID, but it cannot generate any conversion.

Storage

You must store this clickID in a secure cookie, set on the user’s browser when the landing page loads. This cookie must carry the HttpOnly and Secure flags.

The conversion

On the advertiser side, you then send this information back to Affilae. Two options are available.

1. The postback URL. Configure its trigger so that it fires after the conversion is validated by the customer, and populate the cids variable with the collected clickID or clickIDs, separated by a hyphen.

https://lb.affilae.com/?key=603ed1800000000000000000-603ed1800000000000000001&id={{UNIQUE_ID}}&amount={{AMOUNT}}&payment={{PAYMENT}}&customer={{CUSTOMER_ID}}&cv={{SUB_ID}}&voucher={{VOUCHER_CODE}}&currency=EUR&cids={{CLICK_IDS}}

The cv parameter is a free reference of your choice, reported with the conversion. Not to be confused with the SubIDs that affiliates add to their links.

2. The API. Call POST /advertiser/conversions.add: the fields and an example are in Automating conversion tracking via API. The full reference is available on rest.affilae.com/reference.

Upon receipt, Affilae links the conversion to the click carrying that clickID. A clickID that is unknown, belongs to another program or is older than the rule’s Tracking duration (in days) cannot be linked. An order is recorded only once per rule: a second call with the same order identifier is ignored. Two different orders placed after the same click both count.

Headers to send

HEADER EXPECTED CONTENT
x-ae-d-ip The client IP v4 or v6, for example 203.0.113.10.
x-ae-d-ua The client user agent, for example Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36. Optional, but strongly recommended.
Referer The referrer, for example https://www.site.fr.
Diagram of the S2S journey, from the click to clickID storage and then the conversion
The journey of a clickID, from click generation to conversion recording.

Implementation checklist

  1. Program configured as S2S in Affilae.
  2. The aecid parameter is received on your landing page.
  3. A cookie stores the clickID or clickIDs, with the HttpOnly and Secure flags.
  4. The cookie is read to transmit the clickIDs on conversion, by postback or by API.
  5. Testing.

Key considerations

Tip: test several user journeys before opening your program, and check every time that the conversion reaches Affilae. A clickID sent incorrectly triggers no visible error, conversions are simply missing.
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.
  • The clickID is always 24 characters long, for example 603ed1800000000000000000.
  • Cookies must be HttpOnly and Secure.
  • Test with multiple user journeys.
  • Verify that conversions are properly recorded in Affilae.

Related articles

Frequently asked
questions

See more questions

S2S does not rely on the Affilae JavaScript tag. Tracking goes through a unique click identifier, the clickID, which you store server-side and send back to Affilae at conversion time. S2S therefore does not depend on a script loaded on your website: it is more resilient to ad blockers, and keeps working on a mobile device that blocks cookies.

In the sidebar, click Programs, open your program, then Configuration and the Global Settings section. On the URL format field, select Server-to-Server (S2S). This setting switches tracking links to redirect mode.

A clickID is always 24 characters long, for example 603ed1800000000000000000. It reaches your landing page in the aecid parameter of the URL.

The clickID is not appended when the click is not recorded, for example if the partnership is not approved or if a « Stop tracking » capping is reached. A click from a country outside Geo Targeting gets a clickID, but it cannot generate any conversion.

In a cookie set on the user’s browser when the landing page loads. This cookie must carry the HttpOnly and Secure flags. At conversion time, you read the cookie back to transmit the clickID or clickIDs.

Both options are valid. The postback URL fires after the conversion is validated by the customer, with the clickIDs in the cids variable separated by a hyphen. The API gives you more control, its reference is published on rest.affilae.com/reference.

The second call is ignored: Affilae records only one conversion per order identifier and per rule. Two different orders placed after the same click both count, each with its own identifier.

No. S2S does not depend on browser cookies, but CMP implementation remains mandatory.

Need help?

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

Contact Us