Back to overview
Lesson 2 of 5

IB Attribution and Postback Integration

8 min read

Attribution in a Forex IB program answers one question: which IB is responsible for this trader and their activity? Getting this wrong means paying the wrong IB, or paying no one and losing a partner who brought real value. The technical backbone of IB attribution is the postback -- a server-to-server callback that confirms an event happened and passes the data needed to credit the right partner.

How Server-to-Server Postbacks Work in Forex

A server-to-server (S2S) postback is an HTTP request sent from one system to another when a trackable event occurs. In Forex IB tracking, postbacks are typically fired at three stages: registration (trader creates an account), deposit (trader funds the account), and trade close (trader completes a round-turn). The postback carries parameters like the click ID, trader ID, event type, and event value.

Unlike pixel-based tracking, S2S postbacks are not affected by browser privacy settings, ad blockers, or cookie restrictions. They run server-side, which makes them more reliable for Forex where the conversion path can span days or weeks between the initial click and the first funded trade.

Postback EventWhen It FiresKey ParametersUse Case
RegistrationTrader creates a live accountclick_id, trader_id, registration_dateIB attribution confirmation
DepositTrader makes a qualifying depositclick_id, trader_id, amount, currencyCPA qualification trigger
Trade closeTrader closes a positiontrader_id, lots, instrument, P&LLot-based commission calculation
WithdrawalTrader withdraws fundstrader_id, amountClawback or hold period evaluation

Postback URL Configuration

Each postback URL follows a standard pattern: the receiving system endpoint plus dynamic macros that get replaced with actual values at fire time. A typical Forex deposit postback might look like: https://tracking.example.com/postback?click_id={click_id}&event=deposit&amount={amount}&currency={currency}. The sending system (your CRM or trading platform) replaces the macros with real data before firing.

Always include a unique transaction ID in your postbacks to prevent duplicate crediting. If a postback fires twice due to a network retry, the receiving system should deduplicate on the transaction ID. Without this, a single $500 deposit could generate two CPA payouts.

IB Link Management and Referral Methods

The referral method determines how a trader gets tagged to an IB in the first place. Forex programs typically use three methods: tracking links with embedded IB identifiers, referral codes entered during registration, and direct account assignment by the broker back-office team. Each method has different reliability and fraud exposure profiles.

  • Tracking links: most common method -- the IB shares a unique URL that passes their ID via query parameter or subdomain. Reliable when combined with S2S postbacks.
  • Referral codes: the trader enters a code during signup. Works well for offline or social media referrals where link tracking is impractical.
  • Direct assignment: the broker manually assigns an account to an IB in the CRM. Necessary for institutional introductions but creates audit risk without proper logging.
  • Hybrid: some brokers combine link-based tracking with a referral code fallback to capture referrals across both digital and offline channels.

API Integration Patterns

Beyond postbacks, mature Forex brokers connect their trading platform, CRM, and IB management system through API integrations. The most common pattern is a scheduled pull: the IB system queries the trading platform API every 5-15 minutes for new closed trades, matches them to tagged accounts, and runs commission calculations. This is more reliable than real-time postbacks for trade data because it catches any events that a postback might miss due to network issues.

A second pattern is the event-driven push: the trading platform fires webhooks to the IB system whenever a trade closes. This provides faster data but requires robust retry logic and dead-letter handling for failed deliveries. Most brokers use a combination -- real-time webhooks for immediate dashboard updates and a scheduled reconciliation pull to catch any gaps.

When integrating with MT4 or MT5, the trade data pull should include both closed trades and rollover/swap events. Swap charges affect the net P&L of a position, which matters for revenue share calculations. Ignoring swaps can lead to commission discrepancies on positions held overnight or over weekends.

Key Takeaways

  • Server-to-server postbacks are more reliable than pixel tracking for Forex because conversion paths span days or weeks
  • Key postback events in Forex IB tracking are registration, deposit, trade close, and withdrawal -- each serves a different attribution or commission purpose
  • Always include unique transaction IDs in postbacks to prevent duplicate commission payouts from network retries
  • Combine real-time webhooks for dashboard speed with scheduled API pulls for reconciliation accuracy
  • IB link management should support tracking links, referral codes, and direct assignment to cover digital, offline, and institutional referral channels