What are macros?
Macros are placeholder tokens in a URL that get replaced with real values when a conversion happens. They let you pass tracking data between systems automatically.
Trcker uses macros in two directions:
- Inbound — your server tells Trcker about a conversion (brand → Trcker)
- Outbound — Trcker tells your partner's server about a conversion (Trcker → partner)
Inbound postback parameters (brand → Trcker)
When your server fires a postback to Trcker, include these parameters in the URL:
GET https://app.trcker.io/api/postback/{brand}/{offer}?click_id={click_id}&amount=49.99
Required
| Parameter | Description | Example |
|-----------|-------------|---------|
| click_id | The unique click ID from the original tracking redirect. Trcker appends this to your landing page URL when a user clicks a tracking link. | a1b2c3d4-e5f6-7890 |
Optional
| Parameter | Description | Example |
|-----------|-------------|---------|
| amount | Revenue amount in dollars. Overrides the offer's default revenue per sale. | 49.99 |
| payout | Override the partner payout for this specific conversion (dollars). If omitted, Trcker calculates payout from the offer settings. | 7.50 |
| txn_id | Your internal transaction or order ID. Used for deduplication — sending the same txn_id twice returns "duplicate" instead of creating a second conversion. | order-12345 |
| event | The type of conversion event. Defaults to sale if not provided. | sale, lead, install, signup |
| currency | Currency code. Defaults to USD. | USD, EUR, GBP |
| coupon_code | Coupon or promo code used in the purchase. Used for coupon-based attribution — Trcker matches the code to the assigned partner. | PARTNER20 |
Example
A user clicks a tracking link. Trcker redirects them to your landing page with a click_id:
https://yoursite.com/landing?click_id=a1b2c3d4
When they purchase, your server fires:
GET https://app.trcker.io/api/postback/moneygeek/life-insurance?click_id=a1b2c3d4&amount=49.99&txn_id=order-789
Trcker responds with:
{"data": {"status": "ok", "conversionId": "conv_abc123"}}
Outbound postback macros (Trcker → partner)
When a conversion is approved, Trcker pings the partner's postback URL with real values substituted for macros. Partners configure their postback URL in Settings.
Available macros
| Macro | Description | Example value |
|-------|-------------|---------------|
| {click_id} | Unique ID of the original click that led to this conversion | a1b2c3d4-e5f6-7890 |
| {conversion_id} | Trcker's internal conversion ID | conv_abc123 |
| {amount} | Revenue amount in dollars | 49.99 |
| {payout} | Partner's commission for this conversion in dollars | 10.00 |
| {event} | Event type (sale, lead, install, etc.) | sale |
| {txn_id} | External transaction ID from the brand's postback | order-12345 |
| {sub1} | Tracking tag 1 — typically the traffic source or campaign | facebook |
| {sub2} | Tracking tag 2 — typically the ad group or placement | bio_link |
| {sub3} | Tracking tag 3 — additional custom tag | video_review |
| {sub4} | Tracking tag 4 — additional custom tag | |
| {sub5} | Tracking tag 5 — additional custom tag | |
Example
A partner configures their postback URL as:
https://partnertracker.com/postback?clickid={click_id}&payout={payout}&event={event}&sub1={sub1}
When a conversion is approved, Trcker sends:
GET https://partnertracker.com/postback?clickid=a1b2c3d4&payout=10.00&event=sale&sub1=facebook
How sub-IDs work
Sub-IDs (sub1 through sub5) are custom tracking tags that partners attach to their tracking links. They pass through the entire conversion chain:
- Partner adds tags to their tracking link:
https://go.brand.com/offer?via=partner&sub1=facebook&sub2=bio_link - Trcker stores the sub-ID values with the click
- When a conversion happens, Trcker includes sub-ID values in the outbound postback
Partners use sub-IDs to track which traffic sources, campaigns, or placements are driving conversions.
Testing
Test an inbound postback
Fire a test request with curl:
curl "https://app.trcker.io/api/postback/your-brand/your-offer?click_id=test&amount=10&txn_id=test-001"
Test an outbound postback
Partners can test their postback URL from Settings → Postback URL → Send Test. Trcker fires a test request with sample values:
| Macro | Test value |
|-------|-----------|
| {click_id} | test-click-abc123 |
| {conversion_id} | test-conv-xyz789 |
| {amount} | 49.99 |
| {payout} | 10.00 |
| {event} | sale |
| {txn_id} | test-txn-001 |
| {sub1} | test-campaign |
| {sub2} | test-adgroup |
| {sub3} | test-creative |
The test result shows the resolved URL, HTTP response code, and response body.
Deduplication
Include txn_id in inbound postbacks to prevent duplicate conversions. If the same txn_id is sent twice for the same brand, Trcker returns {"data": {"status": "duplicate"}} instead of creating a second conversion.
IP whitelisting
For extra security, restrict which IPs can fire inbound postbacks. Go to the offer detail page → Developer section → IP Whitelist.