Building the Referral Attribution Backbone Powering Driver Acquisition and Vendor Payouts
A leading pan-India fleet management company running a driver-referral program across multiple referrer types.
Where things stood
A fleet management company running a driver-referral program — where existing drivers, in-house field sales staff, and third-party sourcing vendors all earn credit for successfully referring new driver-partners — needs a precise, time-bound way to decide whether a given vehicle allocation counts as a successful referral.
Without clear rules, referral attribution is prone to disputes: a referral logged weeks before a driver actually joins, a driver who takes on a second vehicle, or a referral credited to the wrong referrer type can all distort who gets paid and how much.
What we built
MySQL operational data (referral logs, allocations, driver records) feeds a PostgreSQL analytics warehouse, producing a referral-attribution fact table consumed directly by incentive and commission-payout pipelines.
How it works
TopN Analytics built a referral-attribution pipeline anchored on a precise time window — a referral only counts if the referred driver's first vehicle allocation falls between the referral's logged activation date and its expiry date.
The pipeline normalizes referrer identity across several source types into one consistent category set, and separately tracks 'add-on' credit for when a referred driver takes on an additional vehicle within 30 days of their first allocation, so multi-vehicle referral value isn't lost. The resulting fact table applies the same new-join/rejoin/resurrection classification used elsewhere in the business.
What we delivered and learned
This is a clear example of infrastructure functioning as shared foundation rather than a standalone report: the referral fact table is a direct input other financial calculations depend on, meaning any error here would propagate into two other payout systems — exactly why the attribution window and referrer-normalization logic is handled centrally rather than recomputed by each downstream consumer.
What it's built on
Want the full picture?
We're happy to walk through the details, numbers, and trade-offs directly.