Skip to main content

GEO

Vasyl MartyniukAbout 3 min

Syntax

${GEO.<pathToProperty>}

Definition

Note!

The GEO marker is exclusively available with our premium add-on and enables custom markers. For an introductory overview of geo lookup and geo-based access controls, please consult the "How to manage access to the website based on the user's IP address or geo location" article.

Utilize third-party geo lookup APIs to fetch geo-location information based on the user’s IP address. Currently, we support the following providers:

Each provider offers distinct sets of data. For instance, "ipapi.co" includes information about a country's population, while "geoapify.com" translates continent and country names into multiple languages. Below are examples of response payloads for each provider's free tier, showcasing the available data. More extensive information can be accessed through premium tiers, requiring consultation of their respective API documentation.

{
    "ip": "134.201.250.155",
    "type": "ipv4",
    "continent_code": "NA",
    "continent_name": "North America",
    "country_code": "US",
    "country_name": "United States",
    "region_code": "CA",
    "region_name": "California",
    "city": "Los Angeles",
    "zip": "90012",
    "latitude": 34.0655517578125,
    "longitude": -118.24053955078125,
    "location": {
        "geoname_id": 5368361,
        "capital": "Washington D.C.",
        "languages": [
            {
                "code": "en",
                "name": "English",
                "native": "English"
            }
        ],
        "country_flag": "https://assets.ipstack.com/flags/us.svg",
        "country_flag_emoji": "🇺🇸",
        "country_flag_emoji_unicode": "U+1F1FA U+1F1F8",
        "calling_code": "1",
        "is_eu": false
    }
}

To illustrate, for extracting the in_eu property from the "ipapi.co" payload, you can utilize the (*bool)${GEO.in_eu} marker. Similarly, to retrieve the currency code from the "ipgeolocation.io" payload, you can use the ${GEO.currency.code} marker. Detailed information on properly formatting marker paths is available in this article.

To ensure consistency across providers, common data points are abstracted out by AAM, irrespective of the chosen provider. These guaranteed properties include:

  • country_name
  • country_code
  • continent_name
  • continent_code
  • region_name
  • city
  • latitude
  • longitude

In the following example, access to the backend area is allowed only to individuals within Los Angeles city.

{
    "Statement": [
        {
            "Effect": "deny",
            "Resource": "Capability:aam_access_dashboard",
            "Condition": {
                "NotEquals": {
                    "${GEO.city}": "Los Angeles"
                }
            }
        }
    ]
}