Special Segmentation Format: geography

The geography value is made up of 3 granularity levels - continent, country, and usState. These granularity levels are explained in Special Filter: geography. A particular level needs to be selected, and this is to be included in the property name such as geography.continent or geography.country. Different granularity levels can be requested for different segmentation levels. Therefore, it is possible to generate a 3-level hierarchical tree in which level 1 would show the continent, level 2 would show the country, and level 3 would show the US state (for United States only).

The following example shows the levels object requesting 3 granularity levels as described above:

{

    "level1": {

        "property": "geography.continent",

        "segments": [

            {

                "type": "regex",

                "value": ".*",

                "split": true

            }

        ]

    },

    "level2": {

        "property": "geography.country",

        "segments": [

            {

                "type": "regex",

                "value": ".*",

                "split": true

            }

        ]

    },

    "level3": {

        "property": "geography.usState",

        "segments": [

            {

                "type": "regex",

                "value": ".*",

                "split": true

            }

        ]

    }

}

In the above example, no filtering is being done, and instead, a regular expression to include everything is set as the value. This will result in all the continents, countries and US states (where applicable) to be included in the hierarchy.