Tutorial

How to design commission tracking in a custom CRM

A practical design for commission tracking in a custom CRM: plan fields, payout triggers, splits, ledger entries and correction handling.

Commission tracking in a custom CRM comes down to four decisions: what a deal is worth for commission purposes, which event makes it payable, who gets which share, and how corrections get recorded. Settle those on paper before anyone designs a table. On a team of three to fifteen reps the rules usually change twice in the first year, and the design has to survive both changes without a rebuild.

Write the plan down before you design the schema

Your CRM, or customer relationship management system, is the database that holds companies, contacts and deals. A deal, sometimes called an opportunity, is the record of a potential sale moving through stages. The schema is the defined set of tables and fields underneath, where a table is a collection of records of one type and a field is a single named value on a record.

A commission plan is a written rule set that turns closed business into money owed to a rep. Most small teams have one, but it lives in a founder's head and a spreadsheet tab that only one person understands. That is a problem, because the CRM has to explain any number it prints.

Start with the calculation itself. For each plan, write down four things:

  • The rate: a percentage, a flat amount, or a formula.
  • The basis: the number the rate multiplies, such as deal value, gross margin, or quota attainment, where quota is the revenue target a rep is expected to reach in a period. Gross margin is deal value minus the direct cost of delivering it.
  • The trigger: the event that makes the amount payable.
  • The owner: the person or people who receive it.

If you cannot write those four lines for a plan, the software cannot encode it either. Vague plans produce disputed statements, and disputes cost a small team more in trust than in cash.

What does a commission plan need to store?

A commission plan needs four stored facts: the rate, the basis it applies to, the trigger that makes it payable, and the owner of the payout. Splits, tiers and clawbacks are variations on those four fields.

Tiers are the first variation. A tiered plan pays a low rate until a rep passes a threshold, then a higher rate above it. If you store tiers as one rate field you will rewrite the schema every time someone adjusts a band. Store them as a list of bands, each with a floor and a rate, attached to the plan.

Gross margin as a basis needs cost data on the deal, which means a cost field or a feed from finance. Decide early whether reps can see margin. Making it visible changes behavior, and not always in the direction leadership expects.

Comparing common plan shapes

Plan shapeBest fitDispute riskBuild effort
Flat percentage of deal valueUniform products, short sales cyclesLowLow: one rate field per plan
Percentage of gross marginServices and resale with varied deal mixMedium: needs reliable cost dataMedium: cost field plus margin calculation
Tiered by quota attainmentTeams with a clear annual number per repHigh near band edgesHigh: band table plus attainment snapshots
Flat bonus per closed dealHigh volume, low value salesLowLow
Role-based splitDeals with a setter and a closer, where a setter books meetings and a closer takes them to signatureMedium: ownership argumentsMedium: split table with percentages

Two plan shapes in one CRM is manageable. Four is how you end up with a calculation nobody can audit.

Which event should make a commission payable?

The trigger is the event that converts an earned commission into a payable one. Most small teams should use invoice paid rather than deal closed, because paying on cash collected removes arguments about signed deals that never bill.

The alternatives are worth knowing. Closed-won is the simplest trigger and the easiest to build, and it pays reps fast, but it puts commission expense ahead of revenue. Invoiced sits in between: the deal has produced a billable event, but the cash has not arrived. Milestone triggers suit long implementations where, for example, an estimated 40% is earned at signature and the rest at go-live, and they need a milestone table rather than a single date field.

Whichever you pick, store the trigger event with a timestamp on the commission record. If you only store a yes/no paid flag, you lose the ability to answer the question a rep will actually ask, which is when.

How should splits work when two reps touch a deal?

A split is a percentage allocation of one deal's commission across two or more people. Store each share as its own record and require the percentages to total exactly 100 before the deal can be paid.

The hard part is not the arithmetic. It is deciding when the split is frozen. If splits stay editable after payout, anyone with edit rights can change history. Freeze the allocation at the trigger event by writing an immutable copy, meaning a stored version the application never updates afterwards.

Common patterns on a small team:

  1. A single owner takes 100%.
  2. A setter and a closer split the deal, typically 20/80 or 30/70.
  3. A new business rep takes first-year value and an account manager takes renewals.
  4. An overlay specialist, someone who supports a deal without owning the account, takes a fixed slice.

Pick the patterns you actually use. A free-form percentage field with no validation produces totals of 97.5% and a finance team that stops trusting the report.

Should commission be calculated live or stored in a ledger?

Store commission in a ledger, a table of entries written when a trigger fires with the inputs copied in at that moment. Calculating live from current deal data is cheaper to build and much harder to defend later.

A ledger entry should carry the deal reference, the plan version, the basis amount, the rate applied, the resulting commission, the owner, the trigger date and a status. Copy the basis amount rather than pointing at the live deal value. That copy is what lets you answer "why was this 1,240 and not 1,500" a year later.

Two properties matter. The write must be idempotent, meaning running the same trigger twice produces one entry rather than two. The table also needs an audit log, a record of who changed what and when, kept separate from the entries themselves. Both are cheap to add at the start and expensive to retrofit.

If you are weighing a custom build against a packaged tool, the deciding question is how unusual your plan is. Flat-rate plans are well served by existing tools. Multi-tier plans with role splits and margin bases usually are not, which is where custom CRM development tends to pay for itself.

What does the commission data model look like?

A workable starting model has five tables: plans, plan bands, deals, split allocations and commission entries. Every row needs a stable identifier, and each commission entry needs a foreign key back to its deal and plan version.

A foreign key is a field that points at a row in another table, which is how the database keeps the link intact. Versioning the plan is the detail teams skip. A plan version is a frozen copy of the rules as they stood on a given date. Without it, changing a rate in March rewrites January's calculations. Add an effective-from date and never edit a version once it has paid anything.

Rough estimates for a small team: the core schema plus a review screen is typically two to four weeks of build, the payroll export another three to five days, and the first quarter of live use will surface two or three rules nobody wrote down. Budget for that revision rather than treating it as failure.

How do you handle corrections and clawbacks?

A clawback reverses commission that was already paid or accrued, usually because an invoice went unpaid or a deal was canceled. Handle it as a new negative entry linked to the original, never as an edit to that row.

Corrections follow the same rule. If a deal was recorded at the wrong value, post an adjustment entry with a reason code and the name of whoever approved it. Reason codes sound bureaucratic on a team of six. They are what stop the same argument recurring every month.

Give reps read access to their own entries and nobody else's. Role-based access means permissions attached to a user role rather than to individual people, so a new hire inherits the right view on day one. Reps who can check their own numbers ask fewer questions, and the questions they do ask tend to be about the rule rather than the arithmetic. As a rough estimate, self-serve visibility removes somewhere between half and two thirds of the routine commission queries that would otherwise land on a founder or an ops lead.

Frequently asked questions

How do you calculate sales commission in a CRM?

Multiply a stored basis amount by a stored rate, and attach the result to a specific deal, a plan version and an owner. The basis should be copied at the moment the trigger fires rather than read live from the deal, so later edits do not change past payouts.

Should commission be paid on closed deals or paid invoices?

Most small teams are better served by paid invoices, because it ties commission expense to cash actually collected. Closed-won pays reps faster but puts cost ahead of revenue and creates cleanup work when deals fall through after signature.

How many database tables does a commission tracker need?

Five is a reasonable starting point: plans, plan bands, deals, split allocations and commission entries. You can add a sixth for adjustments if you want corrections kept apart from original entries, which is usually worth the small extra effort.

Can a small sales team track commission in a spreadsheet?

A spreadsheet works while one person owns the rules and the plan does not change mid-quarter. It fails once splits, tiers and clawbacks arrive, because there is no audit trail and no record of the rules as they stood at payout time.

Back to blog