Open-source affiliate tracking: read the code that counts your commissions

Affiliates have always had to trust that a brand's tracking counts every sale they send. We publish the rules ViralPayouts runs in production so nobody has to: how a click, a coupon or an AI-agent checkout is tied to a partner, which signal wins when several disagree, and exactly how a recruiter's two-tier override is worked out and refunded.

It is the same code, with the same tests, that runs on viralpayouts.com. The repository is github.com/viralpayouts/viralpayouts.

Open packages:
3.
Open specs:
6.
Platforms in the dataset:
535.
Licences:
MIT · AGPL · CC BY.

Updated · Who writes ViralPayouts

What is open

Everything that decides who earns and how much. Each part has its own licence, chosen so it can be used as widely as possible.

The open-source parts of ViralPayouts
PartWhat it doesLicence
@viralpayouts/trackingnpm install @viralpayouts/trackingSub IDs, partner coupon codes, where a click came from, the click-capture script for a brand’s site, postback URL checks and registrable domains.MIT
@viralpayouts/attributionnpm install @viralpayouts/attributionThe commission and two-tier override maths, refunds, rate rules, and attribution that survives AI assistants and agentic checkouts.AGPL-3.0
@viralpayouts/mcpnpx -y @viralpayouts/mcpAn MCP server for Claude, Cursor, ChatGPT and other assistants: resolve attribution, work out commissions, check postbacks, detect agent clicks and search 535 affiliate platforms, offline.MIT
Open tracking specsThe rules in plain language: attribution order, two-tier override, rate rules, sub IDs and coupons, postbacks, click capture.CC BY 4.0
Affiliate platform dataset535 affiliate, partner and referral platforms with pricing, payouts, tracking and two-tier support, every fact with its source.CC BY 4.0

Why we opened it

Partners can check every sale

Commission shaving is the oldest complaint in affiliate marketing. When the attribution rules are public and tested, a partner can see exactly why a sale was or was not theirs.

Brands can audit before they install

The click-capture script a brand pastes on its site is short, readable and sets only first-party cookies. Nothing hidden runs on your pages.

Agents prefer code they can read

AI assistants increasingly pick the tools developers use. An open MCP server and open specs let them use ours, and check it, without guessing.

Bugs are found sooner

More people reading the rules means problems are caught before they cost anyone a commission. Security reports go to max@viralpayouts.com.

Try it in a minute

Work out a two-tier commission

import { computeSplit } from '@viralpayouts/attribution/commission';

computeSplit(10000, {
  rewardType: 'percent', directRateBps: 3000,
  directFixedCents: 0, overrideBase: 'commission',
  overrideRateBps: 1000, overrideFixedCents: 0,
}, true);
// { directCents: 3000, overrideCents: 300, ... }

A $100 sale at 30%: the seller earns $30, and the person who recruited them earns $3 on top, never taken from the seller.

Add it to your AI assistant

{
  "mcpServers": {
    "viralpayouts": {
      "command": "npx",
      "args": ["-y", "@viralpayouts/mcp"]
    }
  }
}

Then ask: “Which affiliate platforms pay partners for you and support two-tier?” It works offline, with no key.

What stays in the hosted service

We are open about what is not open, too.

Paying partners

Sending money to partners in many countries, invoices, and tax forms.

Fraud and risk scoring

Kept private because publishing it would show fraudsters exactly what to avoid.

The partner network

The marketplace, partner profiles, leaderboards and the recruiting flywheel across brands.

Accounts and dashboards

Brand and partner portals, admin and our own pricing.

That is what you pay for when ViralPayouts runs your program. See pricing.

Questions about the open-source code

Can I self-host all of ViralPayouts?
Not today. The tracking, attribution and commission rules are open and you can run them in your own stack. Payouts, the partner network and fraud scoring are part of the hosted service.
Why is the attribution engine AGPL and the rest MIT?
MIT lets anyone drop the tracking script and MCP server into anything. AGPL on the engine means anyone may use and change it, but a company that offers it as a hosted service must publish its changes, so improvements come back to everyone.
Is this exactly the code you run?
Yes. The open packages are the same modules and tests the live service uses. The only change is that our own platform fee is not in the open engine: you pass in your own fee rule, or none.
How do I correct the platform dataset?
Open an issue or pull request with a link to the platform's own page. Every record lists its sources. You can also browse it on compare tools.