Integration guide

tracksn is a server-to-server affiliate tracking platform. This page documents every URL, parameter, and macro you need — whether you're an advertiser firing conversions in, or an affiliate consuming postbacks out.

Live S2S Postback Multi-event Macro substitution
For advertisers / brands

Fire postbacks to us

You receive a click_id in your landing page URL. When the user converts (signup, deposit, etc.), fire a single GET request back to our postback URL with that click_id. We record the conversion and forward it to the affiliate.

Read advertiser docs →

For affiliates / publishers

Send traffic, get postbacks

You get a tracking URL with {pubid} and {subid} macros for your campaign data. We fire a postback back to your endpoint when a conversion lands.

Read affiliate docs →

For advertisers — incoming postback

When you're approved as an advertiser, we'll give you two things:


https://tracksn.com/postback?clickid={CLICK_ID}&event={EVENT}&payout={PAYOUT}&txid={USER_ID}&status=approved&secret=YOUR_SECRET

Substitute {CLICK_ID} with the value you stored, {EVENT} with the conversion type, and so on. All other braces stay literal.

Postback parameters

ParamDescriptionExample
clickid The click ID we passed in your landing URL. Identifies which click this conversion belongs to. a1b2c3d4... required
event Conversion type. Lowercase. Common: signup, deposit, sale. deposit required for multi-event
payout Affiliate commission for this conversion in USD. Float. If omitted, the offer's default payout is used. 50.00 recommended
txid Your unique ID for this conversion (user_id, order_id, transaction_id). Used for deduplication. user_4821 recommended
status approved | pending | rejected. Default: approved. approved optional
secret Shared secret. Required when configured to prevent fraud. a1b2c3d4... required

Examples

Signup conversion (lead, $5 payout):

GET https://tracksn.com/postback?clickid=ad933e25...&event=signup&payout=5&txid=user_4821&secret=YOUR_SECRET

Deposit conversion (same user, paid commission $50):

GET https://tracksn.com/postback?clickid=ad933e25...&event=deposit&payout=50&txid=user_4821&secret=YOUR_SECRET
Same user can fire multiple conversions. The combination of (clickid, event, txid) is unique — so the same user_id firing both a signup and a deposit creates two separate rows. Identical (clickid, event, txid) tuples are deduplicated, so retries are safe.

Response

{
  "ok": true,
  "clickid": "ad933e25...",
  "status": "approved",
  "payout": 50,
  "outgoing_postback": {
    "url": "https://affiliate.example.com/pb?...",
    "status": 200
  }
}

HTTP 200 with "ok": true means the conversion was recorded. HTTP 401 means a wrong/missing secret. HTTP 404 means the clickid doesn't exist (most often: testing without an actual prior click).

For affiliates — tracking links + outgoing postback

You receive two things from us:

Click URL

https://tracksn.com/c?offer={offer_id}&aff={your_aff_id}&pubid={pubid}&subid={subid}

Replace {pubid} and {subid} with your traffic-source macros (Meta's {{campaign_id}}, Google's {campaignid}, TikTok's __CID__, etc.). We don't care about the exact format — whatever string you pass is stored as-is and echoed back to your postback.

Click URL behavior:

Outgoing postback

When the advertiser confirms a conversion for one of your clicks, we fire a single GET to your configured postback URL. We replace any {macro} tokens with real values:

MacroFilled with
{clickid} Our internal click ID (the one passed to the advertiser)
{pubid} Your pubid from the click URL, as passed
{subid} Your subid from the click URL, as passed
{payout} Your commission for this conversion (USD)
{status} approved / pending / rejected
{event} signup, deposit, etc. (advertiser-defined)
{txid} Advertiser's transaction/user ID
{offerid} Our offer ID
{affid} Your affiliate ID with us
{ts} Unix timestamp of the conversion

Example postback URL you'd give us:

https://your-network.com/postback?clickid={subid}&payout={payout}&status={status}&event={event}

(Yes — you typically pass our {subid} back as your "clickid" because that's where you put your own click identifier when you generated the click URL. Do whatever matches your stack.)

Reliability. We fire postbacks once per conversion. If your endpoint returns non-2xx we record the failure but don't currently retry — make sure your endpoint is reliable. Retry-with-backoff is on the roadmap.

All macros, in one place

Macros use {name} syntax (lowercase, alphanumeric). Unknown macros are left as-is so they're easy to spot in logs. Values are URL-encoded automatically when substituted.

MacroWhere it worksWhat it is
{clickid} offer target_url, affiliate postback_url32-char hex generated per click
{pubid} bothAffiliate-supplied pub ID
{subid} bothAffiliate-supplied sub ID
{offerid} bothNumeric offer ID
{affid} bothNumeric affiliate ID
{payout} affiliate postback_urlFloat, USD
{status} affiliate postback_urlapproved / pending / rejected
{event} affiliate postback_urlsignup / deposit / sale / ...
{txid} affiliate postback_urlAdvertiser transaction ID
{ts} affiliate postback_urlUnix timestamp (seconds)

Endpoints reference

MethodPathPurpose
GET/i.gifImpression pixel — returns 1×1 GIF, logs impression.
GET/cClick tracker — generates clickid, logs click, 302 redirects.
GET / POST/postbackS2S postback — records conversion, fires outgoing postback.
GET/healthzHealth check — returns {ok:true} if DB is reachable.
GET/adminAdmin dashboard (login required).
GET/docsThis page.

Questions?

Email oshri1amsalem@gmail.com or reply to the thread you got onboarded through.

copied