user_​location

Version: v2023-01-05Includes use: Yes

Criterion name: User Location Data

The client browser's approximate geographic location, determined by looking up the IP address in a database.

Default criterion

These samples reflect the criterion's default settings. You can use these as is in your configurations or make adjustments based on the criterion's available options.

data "akamai_property_rules_builder" "user_location" {
  rules_v2023_01_05 {
    name     = "User Location Data"
    comments = "The client browser's approximate geographic location."
    criterion {
      user_location {
        country_values = []
        field = "COUNTRY"
        check_ips = "BOTH"
        use_only_first_xforwarded_for_ip = false
        match_operator = "IS_ONE_OF"
      }
    }
  }
}
"criterion": [
  {
    "name": "userLocation",
    "options": {
      "countryValues": [],
      "field": "COUNTRY",
      "checkIps": "BOTH",
      "useOnlyFirstXForwardedForIp": false,
      "matchOperator": "IS_ONE_OF"
    }
  }
]

Options

Option Description
field
Indicates the geographic scope. Value is one of:
  • COUNTRY. The user's country.
  • REGION. The user's state or province within the country.
  • CONTINENT. The continent on which the user is.
match_operator
Specifies the match logic. Value is one of:
  • IS_ONE_OF. The field's value matches.
  • IS_NOT_ONE_OF. The field's value doesn't match.
country_values
An ISO 3166-1 country codes, such as US or CN.
continent_values
region_values
An ISO 3166 country and region codes, for example US:MA for Massachusetts or JP:13 for Tokyo.
check_ips
Specifies which IP addresses determine the user's network. Value is one of:
  • BOTH. Behaves like HEADERS but also considers the connecting client's IP address.
  • CONNECTING. Considers the connecting client's IP address.
  • HEADERS. Considers IP addresses specified in the X-Forwarded-For header, succeeding if any of them match.
use_only_first_x_forwarded_for_ip
When connecting via a proxy server as determined by the X-Forwarded-For header, enabling this option matches the end client specified in the header. Disabling it matches the connecting client's IP address.