Geolocation-Based Pricing & Currency Localization
Show the right price in the right currency, without asking the user.
If you sell to more than one country, a USD-only price page leaves money on the table. European buyers see “$19” and mentally add 20% VAT uncertainty. Emerging-market buyers convert in their head, hit sticker shock, and bounce. Localizing price + currency at page-load lifts conversion by 15–35% in most B2B SaaS A/B tests.
The business problem
Hard-coded pricing in one currency is a conversion tax in every other market. The cheapest fix is to:
- Detect the visitor’s country on their first request.
- Map that country to its currency + local pricing tier.
- Render the price in-line, before the pricing page paints.
IP geolocation makes step 1 cost ~0,0001 EUR per visitor.
Implementation
1. Server-side (recommended — no layout shift)
// Next.js middleware (Edge runtime) or Express middleware
import { ipgeoLookup } from "./lib/ipgeo.js";
export async function middleware(req) {
const ip = req.headers.get("x-forwarded-for")?.split(",")[0] || req.ip;
const geo = await ipgeoLookup(ip);
req.geo = geo; // { country_code, currency, is_eu, ... }
return NextResponse.next({ request: { headers: req.headers } });
}
Then in your pricing page:
function PricingTable({ geo }) {
const pricing = getPricingForCountry(geo.country_code); // your mapping
return (
<>
<p>Showing prices in {pricing.currency} for {geo.country_name}</p>
<p><a href="?currency=USD">Switch to USD →</a></p>
{/* price cards */}
</>
);
}
2. Client-side (fallback for static sites)
<script>
fetch("https://api.ipgeo.10b.app/v1/lookup/me", {
headers: { Authorization: "Bearer pub_live_…" }
})
.then(r => r.json())
.then(geo => {
const curr = geo.currency || "USD";
document.querySelectorAll("[data-price]").forEach(el => {
el.textContent = formatMoney(el.dataset.price, curr, geo.country_code);
});
});
</script>
Note: client-side lookup exposes your API key to the browser. Use a public/restricted key with IP-lookup-only scope + referrer whitelisting. Never embed a server key.
Why IP Geo API for this use case
- Currency code included on every response (ISO 4217 — “EUR”, “USD”, “INR”, “BRL”, …). No second API call needed.
- EU membership flag (
is_eu: true/false) — critical for VAT calculation and EU-only promotions. - Language hint (
languages: ["nl", "en"]) — pair with currency to also switch the marketing copy. - Timezone — show time-sensitive offers (“Ends in 4h”) in the visitor’s local time without JS timezone-detection quirks.
- Sub-40 ms median latency (EU) — fast enough to run inside edge middleware before TTFB.
Pricing math for a pricing page
| Monthly visitors | Tier | Cost/mo |
|---|---|---|
| < 30 K | Free | € 0 |
| < 1 M | Starter | € 29 |
| < 10 M | Business | € 99 |
A 10K-visitor/mo SaaS pricing page → € 0. A 1M/mo high-traffic marketing site → € 29. If geo-pricing lifts conversion 15% and your ARPU is € 50, that’s € 7,500 extra MRR for € 29/mo spend (break-even at 1 extra customer).
Honest trade-offs
- VPN users see the “wrong” country. Always show a currency-switcher link (“Showing in EUR. Switch to USD →”). Users on a US VPN in Amsterdam will still convert if they can override.
- Purchasing-power parity (PPP) pricing is a policy decision, not a technical one. IP geolocation tells you where the user is — it doesn’t tell you what they should pay. If you discount emerging markets, you need abuse controls (device binding, card-country match) because a €15 Brazil-tier price is VPN bait.
- Don’t A/B test currency on the same user. Pick a rule, show the same price on reload. Price-flickering destroys trust faster than any other UX bug.
Related use cases
- Geo-personalization / content —
./geo-personalization.md - Compliance / geoblocking —
./geoblocking-compliance.md - Visitor analytics —
./visitor-analytics.md
Get started
- Free tier: 1 000 lookups / day →
/pricing - Add geo-pricing to your marketing site in under 20 minutes with the snippets above.
Sign up at https://ipgeo.10b.app/pricing.
Get early access — 50% off for 12 months
First 100 signups lock in 50% off any paid plan for the first year. No credit card required — we’ll email you at launch.