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.
How It Works
Section titled “How It Works”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
2. Open-Source IP Lists
Section titled “2. Open-Source IP Lists”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
Detection Flow
Section titled “Detection Flow”1. Visitor's IP → Extract ASN2. Check ASN against known VPN ASN list3. Check IP against known VPN/proxy IP ranges4. If match → return show: false with reason: "vpn_detected"5. If no match → proceed with normal PPP logicAccuracy
Section titled “Accuracy”| Method | Accuracy | False Positives |
|---|---|---|
| ASN checking | High | Very low |
| IP list matching | Medium-High | Low |
| Combined | High | Very low |
The combined approach catches the vast majority of consumer VPN services (NordVPN, ExpressVPN, Surfshark, etc.) while maintaining very low false positive rates.
Known Limitations
Section titled “Known Limitations”- 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
What Happens When a VPN Is Detected
Section titled “What Happens When a VPN Is Detected”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.
Upgrading Detection
Section titled “Upgrading Detection”The free tier uses open-source ASN and IP lists. For higher accuracy, GoPayLocal supports integration with paid VPN detection services:
| Service | Method | Coverage |
|---|---|---|
| Open-source lists (default) | ASN + IP lists | Good |
| IPQualityScore | Real-time API | Excellent |
| MaxMind GeoIP | Database lookup | Very good |
| IP2Location | Database lookup | Very good |
Paid detection services are available on Business plans or as an add-on.
Configuration
Section titled “Configuration”VPN detection is enabled by default and cannot be disabled on a per-campaign basis (it’s a security feature). However, you can:
- Allowlist specific IPs — Useful for testing from known VPN connections
- Allowlist specific ASNs — Useful for corporate networks
Configure allowlists in the dashboard under Settings > Security.
Testing VPN Detection
Section titled “Testing VPN Detection”To test VPN detection:
- Connect to a VPN service
- Visit your page with the GoPayLocal banner
- The banner should not appear
- Check the API response for
"reason": "vpn_detected"
Or test via the API directly:
# Without VPN — should return show: truecurl 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)