Skip to main content

Parameter passing and postback

A source connects the platform and Qubix in both directions:

  • From the link into Qubix — when a visitor clicks an ad, Qubix takes the needed parameters from the link (the ad identifier, the pixel, etc.) and attaches them to the visit.
  • From Qubix to the platform — when an event happens (registration, deposit), Qubix sends a postback to the platform so that it knows the result.

The link side is set up in the source — see Creating a source; where the postback is set up, the section below says.

Which values to take from the link is set by the source's Parameters table. For each parameter you specify:

  • URL key — under which key the value comes in the link;
  • Placeholder — what the platform substitutes into the value (its own macro or a fixed value).

Example of a link for a Facebook ad:

https://your-domain/?pixel=123456789&ad_id={{ad.id}}

Here {{ad.id}} is a Facebook macro: at the moment of the click, the platform replaces it with the real identifier itself. The ready-made link for your source is assembled by Qubix in the Example URL for an ad block on the source form — you can copy it and paste it into the ad's URL field on the platform.

Tip

The Ad ID parameter is needed to link clicks with ads and see statistics by them. Without it the source cannot be saved — see Creating a source.

About the parameters on the campaign-link side — Campaign link and parameters.

S2S postback: notifying the platform​

A postback (server-to-server, S2S) is a request Qubix sends to the platform when an event occurs. The request template is the postback address: in Conversions, in the cards of Registration and Deposit, the row of the source in the Where it goes section holds it — each of the two its own. A person to whom the Conversions section is not open sets the same addresses in the source card, in the S2S postback block — a row for Registration and a row for Deposit. Macros are inserted into the template — Qubix substitutes real values into them before sending:

MacroValue
{external_id}The click identifier on the platform's side: Qubix takes it from the source's Network click parameter, and for Facebook, Google and TikTok — from their own click ID.
{status}The event status (for example, registration or deposit).
{revenue}The revenue from the event.
{payout}The payout for the event.
{currency}The currency.
{sub_id_N}Extra tags (sub_id_1, sub_id_2 and so on).
{tid}The transaction identifier.

Example of a postback template:

https://source.com/postback?subid={external_id}&status={status}&payout={revenue}
Which events go out

The postback carries only Registration and Deposit, each switched on separately: in Conversions, the card of the conversion, the Where it goes section has the row of the source with its address and a switch — the Which events go out row of the source card leads there. A person to whom the Conversions section is not open switches them on in the S2S postback block of the source card: there, too, each has its row with the address and the switch, and they are the same address and switch as in Conversions. With nothing switched on, the source stores the address and sends nothing.

The panel assistant and the MCP/API method traffic_source_save set the same: the destination of one conversion or the destinations of several, with postback and postback_url. The source's older fields postback_url and postback_statuses (a JSON array of strings such as ["reg", "dep"]; the platform's own event names lead and sale are the same marks) are still taken: postback_statuses turns registration and deposit on or off whatever address they carry, and postback_url changes the address of the conversions that followed the source's address or had none — an address a conversion was given of its own stays. A write of options without the postback_map key keeps the addresses as they are.

The postback goes to the source of the campaign of the visitor's last visit from an ad before the conversion — whether that campaign leads to a PWA, an offer, a landing or an address; a visit through a campaign link without an ad does not count. If there is no such visit, the visit has no campaign, or the campaign or its source is deleted, no postback is sent. A pause does not stop it: a paused campaign takes no new visitors, but the conversions of visits made before the pause still go out. To stop the postback of a conversion, turn off the switch in the row of the source — in Conversions, in the card of that conversion, in the Where it goes section. A person to whom the Conversions section is not open turns it off in the row of that conversion in the S2S postback block of the source card. A deposit whose revenue does not exceed the Minimum revenue of a real deposit setting is not sent: it is the same threshold the reports and the sending to the ad platforms use — see Reports.

The postback does not depend on an ad platform's event map: a source whose template has such a map and that has a postback address sends the conversion both ways. Only a source on the own template of an ad platform that takes conversions by an event map has no postback address and never sends a postback.

Facebook: Conversions API instead of a postback​

For a source based on the facebook template, the ordinary postback is not used. Instead, Qubix sends events directly to the Facebook Conversions API. You set up only the event mapping: which Qubix event corresponds to which Facebook event (for example, deposit → Purchase) — to whom the Conversions section is open, in Conversions, in the Where it goes section of each conversion's card. Qubix finds the pixel identifier by the ad number, or takes it from the click link when the source's link carries the pixel; the access token — from the pixel registry.

The mapping is taken from the source of the tracker campaign of the visitor's click. A conversion whose click has no tracker campaign with a source is not sent; such conversions are counted in the Not sent to Facebook: N line of the source list.

More — Facebook Conversions API and Pixels.

Conversions from your own server​

The postback address you give the affiliate network is an ordinary HTTP address. It is understood not only by the network: any code of yours can call it — a CRM, your site on your own hosting, a server handler of a landing uploaded to Qubix. This is the standard way to bring into the statistics the events the network knows nothing about: "a registration came in", "a payment came in".

The address is taken from the card of a domain with the Postback role — the ready-made link block (see Domain settings); the block is shown only to those who see all domains. The request shape:

https://pb.your-domain.com/<code>/postback?subid=CLICK&status=lead&payout=25&currency=USD&from=mycrm
ParameterWhat to pass
subidthe visitor identifier — the value of sdk.getPiuid() on your page; to an affiliate network it is the click ID
statusthe event type: lead, sale, rejected; install (also installed, app_install, install_app) — an app install, written as the Install event and counted in the installs
payoutthe payout amount (when there is one)
currencythe currency: USD, EUR…
fromthe source — any name of your own, for example mycrm

The parameter names are understood in synonyms too (click_id, sub_id, tid for subid; event, goal, action for status; revenue, amount for payout) — the full list is in Domain settings.

Where to get the click identifier​

Everything hinges on subid: pass it — and the conversion lands on its click, campaign and ad; don't — and the event has nothing to attach to.

  • On the landing page the SDK gives it: sdk.getPiuid(). Pass it to your side together with the lead — a hidden form field, for example. Take it when the lead is sent: with the script from a Qubix domain the value appears once Qubix has answered the page's first event.
  • The page itself needs no identifier: it reports the conversion with sdk.sendEvent('reg'), see Report a registration or a deposit.
  • A server handler of an uploaded website needs none either: Qubix.conversion(...) takes the visitor of the request itself — see the example below.

Example: from your own server​

The lead reached your CRM — the CRM reports it to Qubix:

Bash
curl "https://pb.your-domain.com/<code>/postback?subid=CLICK_ID&status=lead&from=mycrm"

CLICK_ID here is the visitor identifier your page got from sdk.getPiuid().

The payment is confirmed:

Bash
curl "https://pb.your-domain.com/<code>/postback?subid=CLICK_ID&status=sale&payout=50&currency=USD&from=mycrm"

Example: from a landing's server handler​

The landing is uploaded to Qubix and takes the lead with its own server handler — which also reports it to the statistics:

JavaScript
function handle(req, res) {
if (!req.body || !req.body.email) {
res.status(400).json({ error: 'email required' })
return
}

// the lead is accepted — report it to Qubix
Qubix.conversion('reg', { from: 'landing' })

res.json({ ok: true })
}

The call goes through the same processing as the postback — no address and no outbound request are needed; see Report a conversion: Qubix.conversion.

Check that the conversion arrived​

AI mode — open the assistant in any window and ask: "Did the conversion for click abc123 arrive?" or "Show the registrations of the last hour from the mycrm source". It looks into the data and answers at once.

Manual mode — the conversion is visible in the Audience section on the registrations and deposits tabs, as a row on its click.

From here the conversion lives like any other: it takes part in the funnel and the metrics, and goes on where the traffic source Qubix attributes the click to sends it: to the ad platform, by postback to the source or both ways. Which source that is — usually the source of the visit's campaign, and where a platform's campaigns are attached to tracker campaigns, the source of the attached campaign — see The path of a visitor and a conversion.

What's next​