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.
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.
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.
For advertisers — incoming postback
When you're approved as an advertiser, we'll give you two things:
- A click ID macro embedded in the landing-page URL we redirect users to. Most commonly this looks like
?aff_click_id={clickid}or?cid={clickid}. Whatever the parameter name, capture and store it server-side keyed to the user. - A postback URL like:
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
| Param | Description | Example | |
|---|---|---|---|
| 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
(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:
- A click URL to send your traffic to.
- A postback URL we'll fire when one of your users converts. You define this URL when you onboard; we substitute macros into it on every conversion.
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:
- We generate a unique
clickid, store the click (IP, geo, device, OS, browser, referer, timestamp), and 302-redirect the user to the offer's landing page with theclickidmacro substituted in. - The redirect typically completes in under 100ms.
- You can also use
/i.gif?offer=...&aff=...&pubid=...&subid=...as a 1×1 transparent pixel for view-through impression tracking.
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:
| Macro | Filled 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.)
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.
| Macro | Where it works | What it is |
|---|---|---|
| {clickid} | offer target_url, affiliate postback_url | 32-char hex generated per click |
| {pubid} | both | Affiliate-supplied pub ID |
| {subid} | both | Affiliate-supplied sub ID |
| {offerid} | both | Numeric offer ID |
| {affid} | both | Numeric affiliate ID |
| {payout} | affiliate postback_url | Float, USD |
| {status} | affiliate postback_url | approved / pending / rejected |
| {event} | affiliate postback_url | signup / deposit / sale / ... |
| {txid} | affiliate postback_url | Advertiser transaction ID |
| {ts} | affiliate postback_url | Unix timestamp (seconds) |
Endpoints reference
| Method | Path | Purpose |
|---|---|---|
| GET | /i.gif | Impression pixel — returns 1×1 GIF, logs impression. |
| GET | /c | Click tracker — generates clickid, logs click, 302 redirects. |
| GET / POST | /postback | S2S postback — records conversion, fires outgoing postback. |
| GET | /healthz | Health check — returns {ok:true} if DB is reachable. |
| GET | /admin | Admin dashboard (login required). |
| GET | /docs | This page. |
Questions?
Email oshri1amsalem@gmail.com or reply to the thread you got onboarded through.