The ip2location module
Part of the SharedID Edge specification. The general rules for modules, including consent, time limits and merging in SID_MODULES order, are there.
Name ip2location; no purposes, no gvlid; routes v1 only. A vendor module (packages/vendor-modules/ip2location), added at build time, that runs only when listed in SID_MODULES. It looks the client IP up in two tables built at build time: the country from IP2Location LITE DB1, and proxy signals from IP2Proxy LITE PX10. Both are downloaded with the deployer's free IP2Location download token and make no network calls. The token is used only by the build and MUST NOT be in the bundle.
- Country lookup: the client IP (
PlatformInfo.clientIp, IPv4, IPv6, or IPv4-mapped IPv6 as IPv4) in the bundled DB1 table. IPv4 results MUST equal the database's. IPv6 is keyed by the address's first 64 bits: a /64 that the database splits between countries takes the country of its first address. A missing or unparsable client IP, an address without data, or a country code with no ISO 3166-1 alpha-3 equivalent (such asXK) is a miss for the country. - Country output:
{ "device": { "geo": { "type": 2, "country": <ISO 3166-1 alpha-3>, "ipservice": 1 } } }, merged intoortb2.ipserviceis 1, IP2Location in AdCOM 1.0's List: IP Location Services, and is sent only with the module's country. - Traffic lookup: the same client IP in the bundled PX10 table, whose values are one or more proxy kinds separated by commas. A record with several kinds keeps the most specific, in core's
PROXY_KINDSorder (tor,residential,relay,vpn,public,datacenter).is_anonymousalone names no kind. A miss adds no traffic signal. - Traffic output:
ModuleResult.trafficas{ "proxy": <kind> }, which core merges intoortb2.device.ext.trafficwith the platform's and other modules' reports and setssources. The module MUST NOT setbotorbotKind: it cannot tell a bot from a person on a proxy address, andSID_SKIP_BOTSwould then withhold SharedIDs from real visitors. The signal is independent ofmode. mode(SID_MODULE_CONFIG.ip2location.mode), for the country only:fill(the default): the module omits the country when the platform reports one (PlatformInfo.country) that has an alpha-3 code, that is, one thegeomodule would send;replace: it returns the country whenever the lookup finds one. Listed aftergeoinSID_MODULES, itscountryoverridesgeo's in the merge;geo's other fields remain.- Any other
mode, or any setting other thanmodeandmaxAgeDays, is anerror.
maxAgeDays(optional, positive finite number): when either bundled database's publication date is older than this age, reportstalewhile retaining the normal last-good output (including on a miss, and when neither lookup adds anything). An invalid setting is anerror. When this setting is enabled, an invalid publication date in either table is also anerror.- Consent: the country is coarse location and the proxy signal describes the network, so both are returned whatever the consent signals (GPC, COPPA, a US privacy opt-out, GDPR with or without a TC string, opt-out), as
georeturns the CDN's country. The module's output never changes core's consent decisions. - LITE coverage: IP2Proxy LITE PX10 is a public-proxy subset; VPN, Tor, hosting and residential coverage is in the commercial PX10 database, which the same build accepts through
--proxy-file. A deployment MUST NOT treat the LITE signal as full proxy detection. - The tables without real data (the package's fixtures) cover only documentation addresses: the country fixture is the shared one (192.0.2.0/25
FR, 192.0.2.128/25XK, 198.51.100.0/24JP, 203.0.113.0/24BR, 2001:db8::/48FR, 2001:db8:1::/48JP); the proxy fixture maps 192.0.2.0/26tor, 192.0.2.64/26vpn, 192.0.2.128/26residential, 192.0.2.192/26public, 198.51.100.0/25public,datacenter, 2001:db8::/48torand 2001:db8:1::/48vpn. The conformance cases (conformance/cases/module-ip2location*.json) use them. - Nothing about the request is stored or logged.