Rule geo_mismatch, read from the engine code

Geo mismatch fraud between click and sale

Geo mismatch fraud shows up as sales from countries the affiliate's clicks never came from, a common trace of stolen cards and proxy buyers. At 3 such sales in 7 days, making up at least 10% of the affiliate's geo-tagged sales, the engine holds the sale.

By the AffiliateTracking teamUpdated 5 min read

Fraud page on demo data: held commissions, each with the rule that held it and Release and Uphold buttons, above the verdicts that explain each hold.

The fraud queue in the product, running on demo data.

The short answer

The rule compares the countries of the affiliate's clicks with the billing countries of their sales over 7 days. It needs 5 or more sales with a country. It fires at 3 or more sales from click-less countries, if they are 10% or more of those sales.

How the rule works

Read from internal/fraud/rules3.go. The code fixes the thresholds. No setting changes them.

  1. 01Click country from the edge

    The click's country comes from your CDN's geo header, such as Cloudflare's CF-IPCountry. The engine only trusts it from proxies you list in AE_TRUSTED_PROXIES.

  2. 02Sale country from billing

    The sale's country comes from the billing address your billing tool reports, as Stripe and Chargebee do. The rule skips sales without one.

  3. 033 sales and 10%

    Sales from countries with no clicks must number 3 or more. They must also be at least 1 in 10 of the affiliate's geo-tagged sales.

The exact logic

// internal/fraud/rules3.go, GeoMismatch (condensed)
clickCountries := countries of counted clicks, last 7 days
tagged := affiliate's sales with a country, last 7 days
if tagged < 5 || len(clickCountries) == 0 { return }
foreign := tagged sales whose country is not in clickCountries
if foreign >= 3 && foreign*10 >= tagged { hold(commission) }

Condensed from the Go source in v0.5.0 (main 4f87f77). Comments are ours.

The signals

  • 3 or more sales from countries with no clicks
  • At least 10% of geo-tagged sales
  • 5 tagged sales minimum in 7 days
Hold scope. It holds only the commission being screened. Nothing else in the affiliate's balance moves.

Our data

We ran the rule at its threshold

We ran 4 fixtures through the real engine on 3 Oct 2026: 2 below the line, 2 at or past it. These are the results and the engine's own words.

geo_mismatch · 4 fixtures · fresh SQLite each
Each fixture run through the real engine, and whether geo mismatch fired
FixtureResultThe engine's reason
Clicks from US only, 2 of 5 tagged sales from VNSilentNo verdict
Clicks from US only, 3 of 5 tagged sales from VNFired3 of 5 sales in the last 7 days came from countries none of the clicks came from (like VN)
Clicks from US only, 3 of 30 tagged sales from VNFired3 of 30 sales in the last 7 days came from countries none of the clicks came from (like VN)
Clicks from US only, 3 of 31 tagged sales from VNSilentNo verdict
3 of 30 is exactly 10% and fires. 3 of 31 is 9.7% and stays silent.
Geo mismatch: where the rule fires Threshold chart: click-less-country share of tagged sales (%). The engine stayed silent at 9.7 and fired at 10. The line sits at 10. Click-less-country share of tagged sales (%) Fires at 10 Green: 9.7, silent Red: 10, fires 040
Where geo mismatch fires, from the fixtures above. Engine v0.5.0 (main 4f87f77), run 3 Oct 2026.

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 geo mismatch fires, the verdict shows the rule, who it's about and what it saw. Release or uphold is your call, not the engine's.

Fraud queue · geo_mismatch · demo dataMade-up numbers, real wording
Example held commission after geo mismatch fired, on demo data, with the engine's reason text
PartnerWhat it sawCommissionResult
Affiliate 215 of 9 sales in the last 7 days came from countries none of the clicks came from (like VN)$163.75Commission 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

Stolen cards are a market, sold across borders.

  • Case: The Infraud Organization had 10,901 registered members as of Mar 2017 and caused more than $568 million in losses. Co-founder Sergey Medvedev got 10 years in Mar 2021. Source: US ICE, 19 Mar 2021.
  • Forecast: Juniper Research forecast in 2023 that merchant online payment fraud losses would exceed $362 billion from 2023 to 2028. Source: FinTech Global, 26 Jun 2023.

Each item re-read against its linked source on . Items we couldn't verify were cut.

Limits, and how attackers try to beat it

  • Travellers and gift buyers trip it. A buyer who clicked at home and paid with a card billed abroad looks the same.
  • No trusted proxy means no click country, and then the rule can't run.

A fraudster can route clicks through the same country as the stolen cards. That takes infrastructure per country, and reused exits show up in addresses shared between affiliates. A batch of carded checkouts in one evening also meets the hourly sales ceiling.

Related rules

Thresholds checked against the code on . Windows roll with each sale.

Geo mismatch questions

Which billing tools send a country?

Stripe Checkout and Chargebee invoices carry a billing country today. Sales without one never count toward this rule.

Is the click country exact?

It's the country your CDN assigns to the visitor's IP. VPN users show the VPN's country.

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.

Who wrote this

The AffiliateTracking team writes these pages from the engine's own code. Every threshold here is pinned by a test in the repository. Spot a mismatch? Tell us and we'll fix the page or the code.

This rule, on every sale,
before the payout.

Self-host for free, or let us run it for you.