← All docs

Setting Up Postbacks

What is a postback?

A postback (also called server-to-server tracking or S2S) is an HTTP request your server sends to Trcker when a conversion happens. It tells Trcker "this click just turned into a sale."

Postbacks are more reliable than tracking pixels because they run server-side, can't be blocked by ad blockers, and are harder to fake.

Your postback URL

Every offer has a postback URL in this format:

https://app.trcker.io/api/postback/your-brand/offer-slug?click_id={click_id}&amount={amount}

Replace your-brand and offer-slug with your actual brand and offer slugs.

Required parameters

| Parameter | Description | Example | |-----------|-------------|---------| | click_id | The click ID from the original redirect. Passed as a URL parameter when the user clicked the affiliate link. | a1b2c3d4-e5f6-... |

Optional parameters

| Parameter | Description | Example | |-----------|-------------|---------| | amount | Revenue amount in dollars | 49.99 | | payout | Override the payout for this conversion | 7.50 | | txn_id | Your internal transaction ID (used for deduplication) | order-12345 | | event | Event type | sale, lead, install | | currency | Currency code | USD | | coupon_code | Coupon used (for coupon-based attribution) | PARTNER20 |

How to pass the click_id

When a user clicks an affiliate link, Trcker redirects them to your destination URL with a click_id parameter appended:

https://yoursite.com/landing?click_id=a1b2c3d4-e5f6-...

You need to:

  1. Capture the click_id from the URL when the user lands on your site
  2. Store it (in a session, cookie, or database) so it's available when they convert
  3. Send it back in the postback when the conversion happens

Example postback call

When a user completes a purchase on your site:

GET https://app.trcker.io/api/postback/your-brand/offer-slug?click_id=a1b2c3d4-e5f6-...&amount=49.99&txn_id=order-12345

Trcker will:

  • Match the click_id to the original affiliate click
  • Attribute the conversion to the correct partner
  • Calculate the payout based on your offer settings
  • Return {"data": {"status": "ok", "conversionId": "..."}}

Deduplication

If you include a txn_id, Trcker automatically deduplicates. Sending the same txn_id twice returns {"data": {"status": "duplicate"}} instead of creating a second conversion.

IP whitelisting

For extra security, you can restrict which IPs can fire postbacks. Go to the offer detail page and add your server IPs under Advanced Settings.

Testing

You can test your postback integration by firing a test request with curl:

curl "https://app.trcker.io/api/postback/your-brand/offer-slug?click_id=test&amount=10&txn_id=test-123"

The response will confirm whether the postback was processed successfully.

Full macro reference

For a complete list of all postback macros (both inbound and outbound), see Postback Macros Reference.