Skip to content

VPN Detection

How GoPayLocal detects VPN and proxy usage to prevent discount abuse.

VPN detection is a critical feature for PPP discounts. Without it, users from high-income countries could use a VPN to appear as if they’re from a lower-income country and get undeserved discounts.

GoPayLocal uses two layers of VPN detection:

1. ASN (Autonomous System Number) Checking

Section titled “1. ASN (Autonomous System Number) Checking”

Every IP address belongs to an ASN — a network identifier. VPN providers operate their own networks with recognizable ASNs. GoPayLocal maintains a list of known VPN/proxy ASNs and checks incoming requests against it.

Examples of VPN ASNs:

  • AS9009 — M247 (hosts many VPN providers)
  • AS20473 — The Constant Company (Vultr, used by WireGuard services)
  • AS13335 — Cloudflare Warp

GoPayLocal uses curated open-source IP lists that track known VPN, proxy, and data center IP ranges. These lists are updated regularly and stored in a Cloudflare KV namespace for fast edge lookups.

Sources include:

  • Open-source VPN IP databases
  • Data center IP ranges (AWS, GCP, Azure, etc.)
  • Known proxy/relay services
1. Visitor's IP → Extract ASN
2. Check ASN against known VPN ASN list
3. Check IP against known VPN/proxy IP ranges
4. If match → return show: false with reason: "vpn_detected"
5. If no match → proceed with normal PPP logic
MethodAccuracyFalse Positives
ASN checkingHighVery low
IP list matchingMedium-HighLow
CombinedHighVery low

The combined approach catches the vast majority of consumer VPN services (NordVPN, ExpressVPN, Surfshark, etc.) while maintaining very low false positive rates.

  • New VPN services may not be in the lists until they’re added
  • Residential proxies are harder to detect (they use residential IP addresses)
  • Corporate VPNs may trigger false positives if their exit nodes are in known data centers
  • Tor exit nodes are detected via IP lists

When a VPN is detected, GoPayLocal responds with:

{
"show": false,
"country": "IN",
"countryName": "India",
"reason": "vpn_detected"
}

The banner is not shown, and no discount is offered. The visitor sees the original price.

The free tier uses open-source ASN and IP lists. For higher accuracy, GoPayLocal supports integration with paid VPN detection services:

ServiceMethodCoverage
Open-source lists (default)ASN + IP listsGood
IPQualityScoreReal-time APIExcellent
MaxMind GeoIPDatabase lookupVery good
IP2LocationDatabase lookupVery good

Paid detection services are available on Business plans or as an add-on.

VPN detection is enabled by default and cannot be disabled on a per-campaign basis (it’s a security feature). However, you can:

  1. Allowlist specific IPs — Useful for testing from known VPN connections
  2. Allowlist specific ASNs — Useful for corporate networks

Configure allowlists in the dashboard under Settings > Security.

To test VPN detection:

  1. Connect to a VPN service
  2. Visit your page with the GoPayLocal banner
  3. The banner should not appear
  4. Check the API response for "reason": "vpn_detected"

Or test via the API directly:

Terminal window
# Without VPN — should return show: true
curl https://api.gopaylocal.com/v1/banner/config/gpl_pk_live_abc123
# With VPN — should return show: false, reason: vpn_detected
# (make the request through a VPN)