Rule self_referral, read from the engine code
Affiliate self-referral fraud, held before payout
Affiliate self-referral fraud is an affiliate buying through their own link to earn commission on their own purchase. The engine compares the buyer's email with the affiliate's and holds the commission when they match.
By the AffiliateTracking teamUpdated 5 min read
The fraud queue in the product, running on demo data.
The short answer
The rule fires when the buyer's email matches the affiliate's own email. It ignores case, anything after a plus sign, and dots in Gmail addresses. It holds that one commission until you release or uphold it.
How the rule works
Read from internal/fraud/engine.go. The code fixes the thresholds. No setting changes them.
- 01One email comparison
Each credited sale carries the buyer's email from your billing tool. The engine cleans both addresses the same way and compares them.
- 02Aliases cleaned first
Both addresses lose case and anything after a plus sign. Gmail and Googlemail addresses also lose their dots, and googlemail.com counts as gmail.com.
- 03It holds that sale
A match holds the commission under review. Nothing else in the affiliate's balance moves, and you decide in the fraud queue.
The exact logic
// internal/fraud/engine.go, SelfReferral (condensed)
if normalizeEmail(affiliate.email) == normalizeEmail(buyerEmail) {
hold(commission) // "The buyer's email ... is the partner's own email"
}
// normalizeEmail: lowercase, cut "+tag", drop dots on gmail.com
// and googlemail.com (googlemail becomes gmail)
Condensed from the Go source in v0.5.0 (main 4f87f77). Comments are ours.
The signals
- Buyer email equals the affiliate's email after cleanup
- Plus tags cut on every domain
- Dots ignored on Gmail only
Our data
We ran the rule at its threshold
We ran 5 fixtures through the real engine on 3 Oct 2026: 2 below the line, 3 at or past it. These are the results and the engine's own words.
| Fixture | Result | The engine's reason |
|---|---|---|
| Affiliate Owner@Gmail.com, buyer o.w.n.e.r+shop@gmail.com | Fired | The buyer's email "o.w.n.e.r+shop@gmail.com" is the partner's own email |
| Affiliate Owner@Gmail.com, buyer owner@googlemail.com | Fired | The buyer's email "owner@googlemail.com" is the partner's own email |
| Affiliate Owner@Gmail.com, buyer owner2@gmail.com | Silent | No verdict |
| Affiliate jane.doe@example.com, buyer jane.doe+deal@example.com | Fired | The buyer's email "jane.doe+deal@example.com" is the partner's own email |
| Affiliate jane.doe@example.com, buyer janedoe@example.com | Silent | No verdict |
Method: one Go test against engine v0.5.0 (main 4f87f77), a new SQLite database per fixture, dry run so nothing was held. Re-run with go test ./internal/fraud/ plus the fixture list above.
What lands in your queue
When self-referral fires, the verdict shows the rule, who it's about and what it saw. Release or uphold is your call, not the engine's.
| Partner | What it saw | Commission | Result |
|---|---|---|---|
| Affiliate 7 | The buyer's email "o.w.n.e.r+shop@gmail.com" is the partner's own email | $112.40 | Commission held |
heldWaits for youThe commission stays out of payouts until you decide.releasedPaid normallyIt goes into the next payout.upheldNot paidThe engine cancels it and takes the money back. Already paid? Use a refund.In the wild
Big programs ban it outright, and affiliate commission fraud has ended in prison.
- Policy: Amazon's Associates rules prohibit buying products through your own Special Links, whether for yourself or anyone else. Source: Amazon Associates Participation Requirements, section 6(u), updated .
- Related case: In 2014, eBay affiliate Shawn Hogan, paid more than $28 million in commissions, got 5 months in prison and a $25,000 fine for wire fraud. His scheme was cookie stuffing, not self-referral. Source: Wikipedia: Shawn Hogan.
Each item re-read against its linked source on . Items we couldn't verify were cut.
Limits, and how attackers try to beat it
- A different email beats it. An affiliate who buys with a second address they own passes this rule.
- Dots count on custom domains. jane.doe@yourco.com and janedoe@yourco.com stay different people.
The cheap dodge is a second inbox. When that inbox also signs up as an affiliate, the rule for one person running several accounts compares the two applications. When a group of affiliates trades purchases instead, buyer overlap across affiliates picks up the pattern.
Related rules
Thresholds checked against the code on . Windows roll with each sale.
Self-referral questions
Does it catch an affiliate using their partner's card?
No. It compares emails only. A purchase with a different email and a shared card passes this rule.
What if the affiliate is also a real customer?
That sale still holds, because the emails match. Release it in the fraud queue and it pays in the next payout.
When does the rule run?
On every credited sale, in the same database transaction as the credit. A sweep every 5 minutes also re-checks affiliates active in the last hour.
What does a hold cost me?
Nothing but time. A held commission stays out of payouts. Release it and it pays in the next payout. Uphold it and the engine cancels it and takes the money back.
Can I test it without holding anything?
Yes. Set AE_FRAUD_DRYRUN=1. The engine records each verdict and holds nothing.