Flow Engine & Macros
The flow engine is what runs on every click to decide where the visitor goes. This page explains how it evaluates a flow, how the Smart Rotator’s AI works, and lists every URL macro you can use.
How a flow is evaluated
When a click arrives, the engine receives a context about the visitor — their
country, device, os, browser, bot status, and all sub1–sub30 values —
and walks the flow:
Sort by specificity
Rules are sorted so those with more conditions are checked first. This guarantees
a narrow rule (FR + mobile) is evaluated before a broad one (FR) and never gets
shadowed.
Match conditions
For a rule to win, every one of its conditions must be true. Conditions are matched against the visitor context:
| Condition field | Matched against |
|---|---|
country / device / os / browser | The parsed visitor signals (case-insensitive). |
sub1–sub30 | The sub-IDs from the link. |
is_bot | The bot verdict (the Bot Filter node). |
schedule | The current UTC day & time (Dayparting). |
offer_cap | A live conversion count for the offer (Offer Cap). |
site_status | A live uptime signal from monitoring (Landing failover). |
Pick a branch
The first fully-matching rule wins. Within it:
- if it points at a Smart Rotator, the bandit chooses the option;
- otherwise a weighted random pick selects the landing and offer independently (respecting % Split weights).
Fall through to defaults
If no rule matches, the engine uses the campaign’s default landings/offers (or default rotator) — the routes wired directly off the Campaign node.
Fail-safe by design. Live-data conditions degrade gracefully — a momentary hiccup never stops your traffic: an Offer Cap errs toward letting the click through, and a site-status check assumes the site is up.
Smart Rotator
The Smart Rotator (the AI rotation node) solves the classic explore vs. exploit problem: it must send most traffic to the current winner (exploit) while still testing the others enough to catch a new winner (explore). It uses Thompson Sampling over a Beta distribution.
How a choice is made, in order:
- Cold start — any option that hasn’t reached
minImpressionsviews gets the next visitor (round-robin), so every option earns a fair trial. - Exploration floor — with a small probability (e.g. 5%), pick a uniformly random option, so a late bloomer is never starved.
- Thompson Sampling — otherwise, draw a random score for each option from its Beta posterior and pick the highest. For the CR goal the posterior is built from conversions vs. views; for EPC it’s weighted by each option’s earnings per click. Options that have been performing better get higher expected draws — but randomness keeps probing the rest.
Synaptyx continuously learns from each option’s recent performance (over your chosen rolling window) and re-balances traffic toward the winners.
The optimization is applied to edge-served traffic too, and kept up to date automatically — so even your fastest, globally-distributed redirects route toward your best-performing options.
You can watch each rotator’s performance — credible intervals, probability-to-be-best, and statistical significance — on the Experiments / Analytics view.
Macro reference
Macros are {tokens} you put in destination URLs and notification templates;
Synaptyx replaces them with the real value at runtime. Matching is case-insensitive.
URL macros (offers & landing pages)
These expand in Offer URLs and their parameters:
| Macro | Expands to |
|---|---|
`{clickid}` | The click’s unique ID |
`{ref_id}` | External ID if present, else the click ID |
`{externalid}` | The external/transaction ID |
`{country}` / `{geo}` | Visitor country code |
`{city}` | Visitor city |
`{device}` | Device type |
`{os}` | Operating system |
`{browser}` | Browser |
`{ip}` | Visitor IP |
`{ua}` / `{uagent}` | URL-encoded user-agent |
`{referer}` | URL-encoded referrer |
`{sub1}` … `{sub14}` | Your sub-IDs |
`{timestamp}` | Unix seconds of the click |
Macros cover sub1–sub14 directly. Your sub15–sub30 are still captured and are
auto-forwarded to the offer as query parameters — you just can’t reference them as
{subN} macros in the URL template.
Notification macros (Discord / Telegram / Postback / Push)
Notification templates support the URL macros above plus conversion-specific ones:
| Macro | Expands to |
|---|---|
`{payout}` | What you earned |
`{revenue}` / `{sum}` | The sale value |
`{offer}` | Offer name |
`{campaign}` | Campaign name |
`{status}` | Conversion status (approved, pending…) |
`{goal}` | The conversion goal/event |
`{event}` | The event name |
`{transactionid}` | The transaction / order ID |
Example offer URL:
https://offer.com/?cid={clickid}&geo={country}&s1={sub1}Example Discord template:
💰 {offer}: {payout} ({status}) from {country}