SOP: Geo-rule engine — regex matching vs lookup table
Step 1 — Count your geo rules. Under ~15 country groups, a flat lookup table (country → offer) is readable and fast.
Step 2 — Switch to a structured table with tiers when rules overlap: Tier-1, Tier-2, ROW (rest of world) buckets instead of listing 190 countries.
Step 3 — Avoid regex on country codes. It feels clever (^(US|CA|GB)$) but becomes unmaintainable and hides ordering bugs.
Step 4 — Order matters in any engine. Most specific rule first (single country), broadest last (ROW catch-all). A misplaced wildcard swallows traffic silently.
Step 5 — Always end with an explicit ROW rule. Never let an unmatched geo hit a 404 — route it to a safe house offer.
Tradeoff: tables are auditable; regex is compact but breaks under team handoff.
Re-audit rule ordering after every new geo is added.
Smartlink Ops
@SmartlinkOps
SOP: Geo-rule engine — regex matching vs lookup table
Этот пост опубликован в Telegram-канале Smartlink Ops. Подписаться можно по ссылке: @SmartlinkOps.