Documentation sections

S2S postback to the source

How to send conversions back to the ad network: one URL for all statuses or a separate URL for each, macros and sending rules.

A postback to the source is a request the tracker uses to tell the ad network about a conversion. It's set up in the source card, in the S2S postback to source («S2S-постбэк в источник») block. You'll need the postback URL from your ad network account. The owner and admin can change the settings. For everyone else, the fields are locked, and only the domain of the URLs is visible.

Choose a mode

  1. Open Sources («Источники») and select a source in the list.
  2. In the S2S postback to source block, click a mode button:
    • One URL for all statuses («Один URL на все статусы»): one URL receives every conversion. The default mode.
    • Separate URL for each status («Отдельный URL на каждый статус»): for networks that take leads and deposits at different URLs.

The mode takes effect after you click Save («Сохранить»). Switching doesn't erase either the shared URL or the per-status rows. Only the set of the selected mode is sent.

One URL for all statuses

  1. Enter the ad network's URL with macros in the URL for all conversion statuses («URL на все статусы конверсий») field.
  2. Click Save.

Example URL:

text
https://ads.example.com/postback?click_id={external_id}&status={status}&payout={payout}

If the source was created from a catalog template that has a postback URL, there's an Insert postback from template («Вставить постбек из шаблона») button above the field. It replaces the field's contents with the URL from the template.

If the button is called Insert postback from template · replace REPLACE and your parameters («Вставить постбек из шаблона · замените REPLACE и свои параметры»), the template needs your ID or key in the ad network. Such a source is created with an empty URL. Insert the URL with the button, replace REPLACE and the other values with your account's, and click Save.

Separate URL for each status

  1. Click Separate URL for each status. If there are no rows yet, two appear: Lead (lead) («Лид (lead)») and Sale · dep (sale) («Продажа · деп (sale)»).
  2. Select the Status («Статус») in each row.
  3. Enter the URL in the Postback URL («URL постбэка») field.
  4. Click + Add postback («+ Добавить постбэк») if you need another row. Up to 20 rows per source in total.
  5. Click Save. Rows without a URL aren't saved.

On a conversion, all rows whose status matches are sent. Identical URLs are sent once.

Row statusWhen it fires
Lead (lead), Sale · dep (sale), Rejected (rejected) («Отклонён (rejected)»)By the conversion status after mapping in conversion types. If the network sent status=lead and the conversion type mapped it to sale, only the Sale · dep (sale) row fires
Custom status… («Свой статус…»)By the status= value of the incoming postback, as the affiliate network sent it. Enter it in the field below the list, for example dep. Up to 32 characters, case-insensitive

A conversion without a status counts as a lead. There's no hold in the list: select Custom status… and enter hold.

Macros

MacroValue
{external_id}The ad network's click ID, the value of the source token with the external_id slot
{subid}, {click_id}The click ID in the tracker
{sub_id_1} … {sub_id_30}The click's Sub IDs
{status}The conversion status after conversion types: lead, sale, rejected, hold or a network status that has no type
{raw_status}The status as the affiliate network sent it
{payout}, {revenue}, {conversion_revenue}The payout in USD, the same value
{currency}Always USD
{tid}, {txid}The transaction ID
{campaign_id}, {offer_id}, {ts_id}Campaign, offer and source IDs
{country}The click's country, a two-letter code
{country_name}The name of the click's country in English
{region}, {city}The click's region and city
{ip}The click's IP address
{user_agent}The click's User-Agent

A source token value is available under three names from its row: Slot («Слот»), Name («Название») and Parameter («Параметр»). A token named site is substituted as {site}.

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: {_external_id}. For {country_name}, {region}, {city}, {ip} and {user_agent}, the value taken from the click is encoded even with the prefix.
  • A macro the tracker has no value for stays in the URL as is: an unknown name, or a token that didn't arrive with the click.

Status mapping

If the network expects its own status names, list the pairs separated by spaces inside the {status} macro:

text
https://ads.example.com/postback?click={external_id}&status={status:lead=0 sale=1}

For a lead, status=0 is sent; for a sale, status=1. A status without a pair is substituted unchanged. Pairs work only in {status}.

How sending works

  • The request is always GET. The URL must lead to a public server.
  • The URL with substituted values is saved when the conversion is received. Settings changes apply to new conversions.
  • Success is a 2xx response.
  • On a 5xx or 429 response, and when the connection wasn't established, the tracker retries the send by itself.
  • Other responses aren't retried. If no response arrives in time, the send gets the result “Receipt not confirmed” («Получение не подтверждено») and isn't retried either: the request may have arrived.

States, results and manual retry are described on the Event delivery log page.

Warning.

Before a manual retry, check the data in the ad network. If it has already accepted the event, a retry will create a duplicate.

When the postback isn't sent

  • The campaign has no source selected, or the source has no URL for this status.
  • The conversion type has the send postback to source («слать постбэк в источник») checkbox cleared.
  • The affiliate network sent a postback with a transaction ID it had already sent: an exact repeat, a payout correction without a status change, a lead or hold after a sale, see Transaction ID, duplicates and corrections.
  • Conversions were loaded through CSV import without the Send outgoing S2S and CAPI («Отправлять исходящие S2S и CAPI») checkbox.
  • The license isn't active. Events wait for the renewal and go out by themselves after it, see License expiry.

If the source's final URL matches a URL from the campaign postbacks, the recipient gets one request.

Check

  1. Open Campaigns («Кампании») → the campaign → the S2S postbacks («S2S-постбеки») tab.
  2. Expand the Source postbacks («Постбеки источника») block at the bottom of the tab.

The block shows the shared URL or the per-status rows; you can't change them here. The text “Shared S2S URL not set” («Общий S2S URL не задан») or “Per-status templates not set.” («Шаблоны по статусам не заданы.») means the URL isn't saved in the source. “Source S2S not configured.” («S2S источника не настроен.») means the campaign has no source selected.

After the first conversion, open Logs → Event delivery («Логи → Доставка событий»). The send with the “S2S · source” («S2S · источник») type should have the “Done” («Выполнено») state.

If it isn't saved

The message appears at the top of the page. The text about the URL or status is preceded by the field: “Shared postback URL:” («Общий URL постбэка:») or “Postback #2:” («Постбэк №2:») with the row number. Per-status rows are checked in the One URL for all statuses mode too. In that case the number is followed by “(mode ‘Separate URL for each status’)” («(режим «Отдельный URL на каждый статус»)»): switch the mode and fix the row.

The URL must be a full http:// or https:// address with a valid host.

This message («URL должен быть полным адресом http:// или https:// с корректным хостом.») means the URL doesn't start with http:// or https://. The detail after this text names the part of the URL with the error: the characters before @, the IPv6 address, the host, the port, or a % sign not followed by two hexadecimal digits.

The URL must not contain spaces or line breaks.

This message («URL не должен содержать пробелов и переносов строк.») means you need to remove the spaces and line breaks. A space is allowed only between pairs inside {status:lead=0 sale=1}.

URL longer than 2048 characters.

This message («URL длиннее 2048 символов.») means you need to shorten the URL: the limit counts the macros too.

Postback #2: no status set — select one or enter your own.

This message («Постбэк №2: не указан статус — выберите его или введите свой.») means the row with this number has a URL, but the status is empty. Select a status from the list or fill in the field below the Custom status… item.

Enter a URL for at least one status or switch to “One URL for all statuses”.

This message («Укажите URL хотя бы для одного статуса или переключитесь на «Один URL на все статусы».») means the per-status mode is selected, but no row has a URL.

Event time

The {date:U} macro substitutes the time the conversion was received in Unix seconds. The {_date:U} form gives the same number. The URL is saved in the queue with this time already in it: a delivery retry or waiting for a license renewal doesn't change it. Other date formats aren't supported.

Extra parameters from the affiliate network

If the network passes data in sub_id_1–sub_id_30, you can use it in the outgoing postback of the source and the campaign. To do so, add the corresponding keys to the postback template of the affiliate network linked to the offer. The tracker accepts only the listed keys and only for slots that don't have a saved non-empty click value.

The data is substituted into the send URL and isn't added to the click or to reports by its parameters. It's always URL-encoded, including when the macro is written with a leading underscore. Changing the network template doesn't change send jobs that have already been created. Repeated keys, values longer than 2048 bytes and control characters aren't carried over.

Updated Need help? ↗