Zip code routing and state routing are not two ways to do the same thing. They answer two different questions. The state answers "is this buyer allowed to take this lead at all?" The zip answers "is this lead inside the area this buyer covers?" Pick by the question your business is really asking, and when it asks both, stack them.
This article goes through the cases where the state is the rule, the cases where the zip is the rule, how to stack the two so a mistyped zip never crosses a state line, and the three things that break zip routing in practice: prefixes, counties and postal codes that are not five digits.
When the state is the rule
The state is the rule when the buyer's right to work the lead stops at the state line. That is the situation in every licensed vertical.
- Mortgage. A loan officer holds licenses in specific states. A lead from any other state is not a weaker match, it is a lead the officer cannot legally quote.
- Insurance. An agent is appointed with carriers in specific states. Same logic, and it applies line by line.
- Tax resolution and legal. A firm works the states where it is admitted or where it has staff who know the state's rules.
- Any product that differs by state. Rates, plans and eligibility that change at the border make the state the first thing to check, before any preference.
In these cases the state condition is not one filter among several; it is the gate everything else sits behind. Write it as a condition on the state field, state equals TX or state is one of TX, OK, AR for a buyer that works several, and make sure it is checked before caps, weights and prices. A buyer who fails the state check should be skipped outright, not deprioritized.
The state also works as a coarse territory when precision does not matter: a national buyer who takes everything from three states, or a call center that covers the whole Southeast. One condition, a handful of values, done. The auto insurance version of this, with its licensing wrinkles and fallback rules, is worked through in route auto insurance leads by state.
When the zip is the rule
The zip is the rule when the buyer's reach is measured in distance, not in law. Nobody needs a license to install a roof two towns over; they just will not drive there.
- Service areas. A contractor, an installer or a local agency covers a set of zips around where they operate. Outside that set the lead is worthless to them.
- Sales territories. A buyer paid for a county, or a metro, and expects every lead from it and none from outside.
- Anything sold exclusively by area. Two buyers who both want the same zips need the boundary drawn precisely, and a state is far too big a unit for that.
The zip condition takes two shapes. A pasted list, zip is one of, when the territory has an exact edge: a county, a set of neighborhoods, a map somebody drew. A prefix, zip starts with, when the territory is roughly an area: the first three digits of a US zip cover a region around a sorting center, so zip starts with 335 is the Tampa Bay area in one condition. The list is precise and slower to maintain; the prefix is one line and spills a little at the edges. Both are covered with examples in Route leads by zip code, state or city.
Stacking both
Most pipelines need both because most buyers have both constraints: a mortgage officer licensed in Florida who only wants the Tampa area, an insurance agency appointed in Texas that bought Dallas. The rule is a state condition and a zip condition in one AND group.
| Buyer | Condition | What it prevents |
|---|---|---|
| Loan officer, Florida, Tampa Bay only | state equals FL AND zip starts with 335 | A lead from a Georgia zip that starts with 335 by typo, and any lead outside Tampa |
| Agency appointed in Texas, Dallas metro | state equals TX AND zip is one of (pasted Dallas list) | An out-of-state lead, and a Texas lead from Houston |
| National buyer, three states | state is one of TX, OK, AR | Nothing else needed; the state is the territory |
The order matters even when both conditions are in the same group. Put the state first, because a zip condition on its own trusts that the zip was typed correctly, and it was not always. A five-digit typo lands in another state more often than you would think; the state condition catches it, and the lead goes to a buyer who can actually work it, or to your backfill, instead of to a loan officer who cannot touch it.
Stacking is also how you reconcile two buyers in the same state. Give both the state condition, then each their own zip list. Where the lists overlap, the pipeline's exclusive or shared mode decides, and the trace on the lead shows the decision. That reconciliation is the subject of exclusive vs shared territories for lead buyers.
Prefixes, counties and Canadian postal codes
Three things come up the moment zip routing meets a real map.
Prefixes. A three-digit prefix is a real geographic unit in the US, but it follows postal logistics, not city limits. A prefix can cover two counties, or stop halfway through a suburb. Use it when "roughly this area" is acceptable, and use a pasted list when a buyer will argue about a specific zip.
Counties. A county is not a field on the lead, and a rule cannot look it up. What a rule can do is match a list, and a county is a list of zips, usually 20 to 80 of them, available from any zip database. Paste the list into an is one of condition and the county is a territory like any other. When a buyer says they want a county, they are asking for a list; get it once and keep it on the buyer.
Canadian postal codes. A Canadian code is six characters, letters and digits, and its first three characters are the forward sortation area, which is the unit lead buyers actually think in. A starts with condition on the first three characters, postal starts with M5 for downtown Toronto, does the job, and a province condition above it plays the role the state plays in the US. Nothing about the rule changes; only the field's shape does.
Set it up (screenshots)
Take the stacked case, a licensed buyer with a territory inside the state.
- Check both fields arrive. The state field and the zip field must be mapped from what the form sends. Ask for the state as a two-letter code; a source that sends "Florida" on Monday and "FL" on Tuesday will fail half its matches on a strict equals.
- Write the state gate. Open the buyer on the pipeline and add a condition under When: state equals FL, or state is one of the states the buyer works.
- Add the zip inside it. In the same AND group, add zip starts with 335 for an area, or zip is one of a pasted list for an exact territory.
- Cover the rest. Add a buyer with no condition in a lower tier for leads from zips nobody owns, or leave them unrouted and place them by hand.
- Test four leads: one inside the territory, one in the state but outside it, one outside the state, and one with a mistyped zip. Read the routing decision on each and confirm the state gate caught the typo.
📸 SCREENSHOT: territory-state-gate.jpg (already in /public/docs-assets, upload as an image block here): an AND group holding state equals FL and zip starts with 330, so a lead must satisfy both.
📸 SCREENSHOT: territory-zip-prefix.jpg (already in /public/docs-assets, upload as an image block here): an OR group of three conditions, zip starts with 335, 336 and 337, with the preview reading "zip starts with 335 or 336 or 337".
The step-by-step guide with the example pipeline, state gate included, lives in Routing by territory in the docs.
Common mistakes (leading zeros, mistyped zips)
Leading zeros. Zips in the Northeast start with 0, and a spreadsheet exported as numbers drops it: 02134 becomes 2134 before the lead reaches you, and a list of Boston zips never matches. Make the source send the zip as text, and when you paste a list, check that the first entries still have five digits.
Mistyped zips. A wrong digit lands the lead in another state or another buyer's territory. The state gate catches the first case; the second is caught only by looking at leads the trace routed somewhere surprising. Read the trace the first week and fix the source's form if typos are frequent.
Zip+4 and spaces. Some forms send 33602-1234 or a code with a space. A starts with condition still matches; an is one of list does not. Normalize the field at intake to five digits, or use the prefix where the source is messy.
A state without a zip, or the reverse. A lead that arrives with only one of the two fields fails a stacked AND group. Decide on purpose: route it on the field you have, or hold it for review. Silence is the one option that costs you a buyer.
The pattern is the same in every licensed vertical. Mortgage puts the licensed-state gate first and the territory inside it, as on mortgage lead distribution; insurance does the same with appointments, then adds the line of business, as on insurance lead distribution. The state says who may take the lead, the zip says who should, and the rule holds both.
Frequently asked questions
Should I route leads by zip code or by state?
Why put the state condition above the zip condition?
Can I route by county?
Do Canadian postal codes work with zip routing?
Why do my Boston leads never match my zip list?
Continue reading
How to split leads between agents by territory (zip, state, city)
Give each agent a territory as a condition on the zip, state or city field, choose exclusive or shared, and add a backfill for the zips nobody owns.
Exclusive vs shared territories for lead buyers: how to run both on one pipeline
What buyers mean by exclusive, how to price exclusive and shared, and how tiers and per-buyer prices let one pipeline run both without a second setup.
How do I distribute leads to multiple buyers based on zip code?
Distribute leads by zip code to the right buyer automatically. Pasted zip lists, zip prefixes, state gates and overflow logic explained.
Route Auto Insurance Leads by State: Licensing, Fallback, and Common Mistakes
Build state-based routing for auto insurance leads: licensing checks, fallback rules, multi-state buyers, and the mistakes that route leads to unlicensed agents.