Geographical Location
The visitor's geographical location is determined by matching the given IP address to the GeoLite City database provided by MaxMind. Using this database, visitor.js can geolocate more than 99.5% of all IP addresses on a country level.
- Gets the two-letter code of the continent where the visitor is located.
- Data Type: String
- Default Value: '' (if the visitor's location is unknown)
- Possible Values:
Value |
Continent |
'AF' |
Africa |
'AS' |
Asia |
'EU' |
Europe |
'NA' |
North America |
'SA' |
South America |
'OC' |
Oceania |
'AN' |
Antarctica |
'' |
Unknown |
- Gets the full English name of the continent where the visitor is located.
- Data Type: String
- Default Value: '' (if the visitor's location is unknown)
- Possible Values: 'Africa', 'Asia', 'Europe', 'North America', 'South America', 'Oceania', 'Antarctica', ''
- Gets the two-letter ISO 3166 code of the country where the visitor is located.
- Data Type: String
- Default Value: '' (if the visitor's location is unknown)
- Possible Values: See ISO website, with the addition of the following values:
Value |
Description |
'A1' |
Anonymous Proxy |
'A2' |
Satellite Provider |
'EU' |
Europe (exact country is unknown) |
'AP' |
Asia/Pacific Region (exact country is unknown) |
- Example Values: 'US' (for United States), 'DE' (for Germany)
- Gets the name of the country the visitor where is located.
- Data Type: String
- Default Value: '' (if the visitor's location is unknown)
- Example Values: 'United Kingdom', 'Switzerland', 'Côte d'Ivoire'
- Gets the name of the city or town where the visitor is located.
- Data Type: String
- Default Value: '' (if the visitor's city is unknown)
- Example Values: 'San José', 'Beijing', 'Münster'
- Gets the visitor's zip/postal code. Postal codes are only available for a fraction of IP addresses located in the U.S. and Canada.
- Data Type: String
- Default Value: '' (if the visitor's postal code is unknown)
- Example Values: '10017' for New York, 'v7c1n5' for Vancouver
- Gets the latitude of the city or town where the visitor is located.
- Data Type: Float
- Default Value: 0 (if the visitor's city is unknown)
- Example Value: 48.8667 for Paris, France
- Gets the longitude of the city or town where the visitor is located.
- Data Type: Float
- Default Value: 0 (if the visitor's city is unknown)
- Example Value: 2.3333 for Paris, France