[fusion_builder_container hundred_percent="yes" overflow="visible"][fusion_builder_row][fusion_builder_column type="1_1" background_position="left top" background_color="" border_size="" border_color="" border_style="solid" spacing="yes" background_image="" background_repeat="no-repeat" padding="" margin_top="0px" margin_bottom="0px" class="" id="" animation_type="" animation_speed="0.3" animation_direction="left" hide_on_mobile="no" center_content="no" min_height="none"][fusion_text]Territories allow your locations to be returned as search results when they are possibly not physically present in a given searched area. This is useful for creating sales territories, defining service areas or delivery boundaries for your locations.
You can create territories from:
- Lists of Countries
- Lists of States
- Lists of Cities (as City,ST no space)
- Lists of Counties (US only, as County,ST no space)
- Lists of Postal codes
- Lists of Postal code prefixes (E.g. 532)
- Polygon bounded areas
When a geographic search is performed, and a location includes a territory that coincides with that search, it is included with the search results regardless of the location's latitude and longitude.
To create a territory-based search interface, the first step is to create a field to store the territory data. Go to Fields,
then click New
in the toolbar.
Note the available options within the Territories option group. In this example, we'll create a State List Territory called StateTerritories.
Next, increase the "Field Length" to a length that will contain your list of territories. For very large lists, use the "BLOB/TEXT" (b
Save the field you have created. The next step is to add locations with territory data to your database. This can be done by importing your data in bulk or by editting your locations one by one. In this example, we'll import the data in bulk. We've prepared a CSV file with state territories as shown here:
Download the sample file
for an example import file.
We can now import that file by going to Data
. Click the Choose File...
button and allow the import to proceed. Observe that our individual locations now have lists of state abbreviations in our StateTerritories field. You can see this list by editing a location, and scrolling to the bottom of the Edit Location screen to see the contents of the StateTerritories field as shown here:
Be sure your Territory values are formatted according to this table:
||Alberta,CA (These values are newline separated and have no spaces between the comma and state)
|Postal Code Prefix
Since our data already has latitude and longitude, we can skip the geocoding process normally required as part of the import process. If your data needs to be geocoded, do that now. That process is covered in various other articles on this site including the Getting Started
Now that data are imported, we are ready to create our Interface. Do this by clicking Interfaces
, then New
. Choose Locator Layout
and provide a Title for the new Interface.
Click over to the Settings
tab of the new interface and set the following options:
Data Settings > Enable Territories? : Yes
Save your Interface and click Preview
to see the results. The default layout provides a postal code search. Let's try searching for 53202, a Wisconsin postal code. Recall that none of our locations are actually present in Wisconsin, yet we do have a single location that in