Table of Contents
When using the Agile Store Locator search function, you may encounter the following error message:
“geocode was not successful for the following reason: ZERO_RESULTS”
This error occurs when Google’s Geocoding API fails to return a matching location for the provided address or postal code.
Main Cause: Duplicate Locations for the Same Postal Code #
One of the primary reasons for this issue is that certain locations—particularly postal codes—exist in multiple countries. When the system attempts to search for such a postal code without specifying the country, Google may fail to determine the correct location and return zero results.
Example Scenario: #
- The postal code 65536 exists in the United States.
- However, this postal code may also be assigned to another country.
- If you search for “65536” without specifying the country, Google may be unable to determine the correct location and return zero results.
How to Fix the Issue #
- Include the Country in the Search Query
- Instead of searching for a postal code alone (
65536
), add the country name:
Example:"65536, United States"
- Instead of searching for a postal code alone (
- Enable Country Restriction in Google Geocoding API
- Set a preferred country in the ASL Settings that can be setup in the ASL Settings > Country Restriction, however there is a limitation that Geocoding API can only be restricted with a single country, multiple countries restriction is only supported in Google Place API.