Smart Router — Conversion Tracking API
← Back to admin

Conversion Tracking API

Report a paid conversion back to Smart Router. Send the click ID we minted on the click-out plus the conversion amount, and we'll record revenue against the original offer, campaign, segment, and source.

v1 · production endpoint
On this page

Endpoint

All three handlers below share the same logic. Pick whichever fits the partner platform you're integrating with.

POST {HOST}/api/conversion
GET {HOST}/api/conversion
GET {HOST}/c/:click_id

Getting the click_id

Every click through Smart Router mints a unique click_id (UUIDv4) and auto-appends it as &click_id= to the outbound destination URL:

// Outbound URL the user lands on
https://your-offer.com/landing?u=abc&sr=src&click_id=8a4f1c3e-…-9b22

If your partner needs the value under a different parameter name (e.g. subid1), drop the {clickId} template variable anywhere in the destination URL when configuring the offer:

// Offer destination template
https://your-offer.com/?subid1={clickId}&sr={sr}
Auto-append is non-clobbering. If you've already placed {clickId} manually, Smart Router won't add a second click_id param. The URL stays clean.

Request fields

Send as JSON body (POST) or query string (GET). Field names are case-insensitive and most accept several aliases.

FieldAliasesTypeRequiredDescription
click_id clickId, cid, subid string yes The ID we minted on click-out. 8–80 chars, [a-zA-Z0-9_-].
amount payout, revenue, value number no Conversion value. Defaults to 0. Negative values are clamped to 0.
currency string no ISO 4217 currency code (e.g. USD). Defaults to USD.
txid transaction_id, order_id string no Your transaction ID. Stored for audit but not used for dedupe.

Examples

POST · JSON body

curl -X POST {HOST}/api/conversion \
  -H 'Content-Type: application/json' \
  -d '{"click_id":"8a4f1c3e-3a91-4d2e-9b22-7f01dd33ee10","amount":12.50,"currency":"USD","txid":"ORD-1001"}'

GET · pixel / postback URL

{HOST}/api/conversion?click_id=8a4f1c3e-3a91-4d2e-9b22-7f01dd33ee10&amount=12.50&currency=USD&txid=ORD-1001

Short path · /c/:click_id

{HOST}/c/8a4f1c3e-3a91-4d2e-9b22-7f01dd33ee10?amount=12.50

Response shape

Always returns 200 OK. JSON body:

{
  "ok":       true,
  "accepted": true,
  "clickId":  "8a4f1c3e-3a91-4d2e-9b22-7f01dd33ee10",
  "amount":   12.5,
  "currency": "USD"
}

accepted is false when one of these is true:

Why always 200? Partner ad-networks aggressively retry on non-2xx responses. We accept the postback and indicate disposition in the JSON body to prevent retry storms during minor issues (network glitches, brief outages, slow Firestore reads).

Dedupe & retries

Conversions are deduplicated by click_id. Once a conversion is recorded for a given click, subsequent postbacks for the same click_id are ignored. The first amount wins.

Your platform may safely retry on transient errors — we'll always return 200, and duplicates are silently dropped at the storage layer.

Heads up: dedupe is on click_id, not on txid. If a single user clicks once but makes two separate purchases (two distinct txids), only the first conversion is recorded against that click. Most partners expect this behavior, but worth noting if you care about lifetime value per click.

How it appears in Reports

After successful postbacks, two new metrics show up in the admin Reports view:

The per-offer, per-campaign, per-segment, and per-source breakdown tables also gain Conv and Revenue columns. Past-day totals come from the nightly rollup; today's totals are computed live.

Integration checklist

  1. Configure your partner's offer to land on the Smart Router destination URL (the click_id auto-appends, no template change needed).
  2. In the partner's postback settings, drop in either the POST or GET URL from Endpoint above.
  3. If the partner's UI offers a macro placeholder for the click ID (e.g. {sub_id}, {aff_sub}), point it at click_id in our endpoint.
  4. Send a test conversion. The Reports view should show 1 conversion within ~5 seconds.
  5. Send a duplicate to confirm dedupe (accepted: false).

Questions? Ping the Smart Router maintainer.