Documentation sections

Campaign and source S2S postbacks

How to set up outgoing conversion notifications: the source URL, up to 20 extra campaign URLs, statuses and macros.

When the tracker accepts a conversion, it sends GET requests to two lists of URLs: the source postbacks and the campaign postbacks. The lists work at the same time and are configured separately; a campaign without a source sends only its own URLs. Anyone who can edit a campaign can configure its URLs; owners and admins configure the source postback.

Source postback

The source postback applies to all campaigns with that source. It is set in the source card, in the S2S postback to source («S2S-постбэк в источник») block, in one of two modes:

  • One URL for all statuses («Один URL на все статусы») — one URL receives a conversion with any status.
  • Separate URL for each status («Отдельный URL на каждый статус») — up to 20 rows; all rows with a matching status are sent.

The setup steps are on the S2S postback to the source page.

Add a campaign postback

  1. Open the campaign and go to the S2S postbacks («S2S-постбеки») tab.
  2. In the Campaign postbacks («Постбеки кампании») block, click + Add postback («+ Добавить постбек»).
  3. Select a status in the list. The default is All statuses («Все статусы»).
  4. Enter the URL in the field below the status list.
  5. Click Save postbacks («Сохранить постбеки»). The message “Postbacks saved” («Постбеки сохранены») appears.

Example URL:

text
https://example.com/postback?subid={subid}&status={status}&payout={payout}

The counter next to the button shows the number of rows, for example 3 / 20. The list holds no more than 20 rows, including disabled ones: on the twentieth row, the + Add postback button is disabled.

The Save postbacks button is active when there are unsaved edits. Discard changes («Отменить изменения») returns the last saved state.

Below the list is the collapsible Source postbacks («Постбеки источника») block: this campaign's source URLs and the Facebook CAPI status. You can't change them here. Owners and admins see the full URLs; everyone else sees only the domain.

Disable or delete a URL

  • Clear the checkbox next to the row number, for example Postback 1 («Постбек 1»): the row stays in the list, but no requests are sent for it.
  • Click Delete («Удалить»): the row disappears from the list.

Both actions take effect after you click Save postbacks.

Statuses

Value in the listWhen the URL receives a request
All statusesOn every new conversion status
Lead («Лид»), Sale («Продажа»), Rejection («Отклонение»), Hold («Холд»)When the status after mapping by conversion types equals lead, sale, rejected or hold
Custom status («Свой статус»)When the status value from the affiliate network's postback matches the one you entered

When you select Custom status, a field with the hint “For example, approved” («Например, approved») appears next to it. The value is required, up to 32 characters, without spaces. Case is ignored.

Macros

MacroWhat is substituted
{subid}, {click_id}The click ID in the tracker
{external_id}The ad network's click ID from the source token
{sub_id_1}…{sub_id_30}The click's Sub IDs
{tid}, {txid}The transaction ID from the incoming postback
{status}The status after mapping by conversion types
{raw_status}The status as the affiliate network sent it
{payout}, {revenue}, {conversion_revenue}The payout in USD
{currency}Always USD
{campaign_id}, {offer_id}, {ts_id}The campaign, offer and source IDs
{country}The click's country code
{country_name}The click's country name in English
{region}, {city}The click's region and city
{ip}, {user_agent}The click's IP address and User-Agent

Macros based on source tokens also work: by the value of the Name («Название») column and by the link parameter name. The {country_name}, {region}, {city}, {ip} and {user_agent} macros take their value from the click; a link parameter with the same name doesn't replace it. A token value is substituted only when the source has a token with that name.

  • Values are URL-encoded. The _ prefix inserts a value without encoding: {_subid}. For {country_name}, {region}, {city}, {ip} and {user_agent}, the value taken from the click is encoded even with the prefix.
  • You can replace the status with the recipient's value: {status:lead=lead sale=dep rejected=cancel}. Pairs are separated by a space; a status without a pair is passed as is.
  • A macro stays in the URL unreplaced if the tracker doesn't know it or the click doesn't have such a parameter.

The Macro reference («Справочник макросов») link on the tab opens the panel's Macros («Макросы») section — a common list for links and pages, see Macros. Postback URLs support the macros from the table above.

When a request is not sent

  • The affiliate network repeated the postback with the same transaction ID and the same status. An exact repeat is skipped; a payout correction updates the conversion but isn't sent to recipients.
  • A lead or hold status arrived for a transaction that has already become a sale. Both cases are covered on the Transaction ID, duplicates and corrections page.
  • The conversion type has the send postback to source («слать постбэк в источник») checkbox cleared. The restriction applies to both the source URLs and the campaign URLs.
  • The conversions were uploaded by CSV import without the Send outgoing S2S and CAPI («Отправлять исходящие S2S и CAPI») checkbox.
  • The license isn't active. Events wait for renewal and are sent automatically after it — see License expiry.

If URLs match after macro substitution, the recipient gets one request. When a source URL and a campaign URL match, the delivery is labeled S2S · source + campaign («S2S · источник + кампания») in the log.

Tip.

The URL with substituted values is saved at the moment the conversion is accepted. New and changed rows apply only to future conversions; retries go to the saved URL.

URL requirements

  • A full URL that starts with http:// or https://.
  • Up to 2048 characters.
  • No spaces or line breaks. Spaces are allowed only between pairs inside {status:…}.
  • Curly braces only around macros; % must be followed by two hexadecimal digits.
  • The URL points to a public server. A request to a local or private address isn't sent; in the log, its result is “Address blocked” («Адрес заблокирован»).

Checking the result

  1. Send a test conversion for a click of this campaign through the incoming postback.
  2. Open Logs → Event delivery («Логи → Доставка событий»). Owners and admins can see this section.
  3. Enter the click's subid in the Subid field and click Find («Найти»).
  4. Find the S2S · campaign («S2S · кампания») row in the Type / recipient («Тип / получатель») column.

The Done («Выполнено») state means the recipient responded with a 2xx code. The other states, results and resending are covered on the Event delivery log page.

If something went wrong

The error message appears below the list after you click Save postbacks. The number in it is the row number.

Campaign postback #1: specify a status without spaces (up to 32 characters) or * for all statuses («Постбек кампании №1: укажите статус без пробелов (до 32 символов) или * для всех статусов»)

Your custom status contains a space. Enter a value without spaces.

Campaign postback #1: URL must not contain spaces or line breaks («Постбек кампании №1: URL не должен содержать пробелов и переносов строк»)

Remove the spaces from the URL.

Campaign postback #1: URL must be a full http:// or https:// address with a valid host (curly braces only around macros, two hexadecimal digits after %) («Постбек кампании №1: URL должен быть полным адресом http:// или https:// с корректным хостом (фигурные скобки — только у макросов, после % — две шестнадцатеричные цифры)»)

The URL doesn't start with http:// or https://, has no domain, has a curly brace outside a macro, or has a % that isn't followed by two hexadecimal digits.

Campaign postback #1: % in the query must be followed by two hexadecimal digits («Постбек кампании №1: после % в query должны идти две шестнадцатеричные цифры»)

In the URL parameters after ?, the % sign isn't followed by two hexadecimal digits. Fix or remove this sign.

Postback URLs and settings are available to users who can edit the campaign. («Адреса и настройка постбеков доступны пользователям с правом изменения кампании.»)

This text appears on the tab instead of the list when the campaign is open to you for viewing only. Who can edit a campaign is covered on the Campaign access and “Share” page.

Campaign copy and changes through the API

A copy of the campaign gets the same postback URLs — see Bulk actions and campaign cloning.

In a PUT /api/v1/campaigns/{id} request, the list is passed in the s2s_postbacks field — an array of objects with the status, url and disabled fields. “All statuses” is written as *. The array replaces the whole list; an empty array clears it. Without the field or with null, the list stays as it was. A list longer than 20 rows is rejected with the message “No more than 20 S2S postbacks per campaign” («Не больше 20 S2S-постбеков на кампанию»). Details: Admin API: campaigns.

Updated Need help? ↗