user_geo_select_region

Description

Given a list of geographic regions, selects the one in which the user has been geolocated most.

string user_geo_select_region( list regions )

Regions should be a list of four-element lists. Each inner list should contain:

  • a custom string to identify the region
  • latitude
  • longitude
  • radius, in miles

Will return the identifier string for the user’s most-visited region, or null if the user has never been identified within any of the regions.

If the user has only been identified within one of the regions, the function will return the string for that region.

Note: This function is only available for use with coordinates in the United States, UK, or Canada.

Example

{user_geo_select_region([['New York',40.732,-73.989,50],['London',51.385,-0.430,40]])}

Will return New York if the user has been within 50 miles of New York City, London if the user has been within 40 miles of London, or null if the user has not been identified in either of those locations.

Top