View Categories

How to Fetch Store Coordinates Using Agile Sync Addon

When syncing store data using the Agile Sync Addon, some external APIs may not provide latitude and longitude values. In such cases, the addon can automatically fetch coordinates for you using Google Geocoding API, based on the store’s address.

This ensures your stores appear correctly on the map—even when coordinates are missing from the source data.


When Do You Need This Feature? #

You should enable coordinate fetching if:

  • Your external API does not return latitude and longitude
  • Your store records include address fields like:
    • Street
    • City
    • State
    • Postal Code
    • Country

Agile Sync uses these fields to generate accurate coordinates via Google Geocoding.


How Agile Sync Fetches Coordinates #

When coordinates are missing:

  1. Agile Sync sends the full address to Google Geocoding API
  2. Google returns the latitude and longitude
  3. The addon automatically saves those values with the store record

No manual intervention is required once configured correctly.


Required Configuration (Very Important) #

Before enabling this feature, make sure both requirements below are met.


Google Server API Key Must Be Properly Configured #

Your Google Server API Key must:

  • Be enabled and active
  • Have NO HTTP referrer restrictions
  • Have Geocoding API enabled

If your key is restricted or misconfigured, coordinates will not be fetched.

Follow this step-by-step guide to fix it:
https://agilestorelocator.com/wiki/google-server-api-key-troubleshooting/


Do NOT Map Latitude & Longitude Fields #

If your external API does not provide coordinates:

  • Do not map lat or lng fields in the Agile Sync field mapping
  • Leave latitude and longitude unmapped
Coordinates field agile sync addon

This allows Agile Sync to detect missing coordinates and fetch them automatically.


Important Note for Existing Sync Jobs #

If you already have an existing Agile Sync job, coordinate fetching may not run due to timestamp validation.

Why This Happens #

If the “Last Modified” field is mapped:

  • Agile Sync only updates records when the external API provides a newer timestamp
  • Existing records without updated timestamps will not refresh coordinates

Recommended Solution (Clean Reset) #

To ensure coordinates are fetched correctly:

  1. Go to Agile Store Locator → Import / Export
  2. Delete all existing stores
  3. Delete the existing Agile Sync job
  4. Create a new Agile Sync job
  5. Ensure:
    • Latitude & longitude are not mapped
    • Google Server API key is properly configured
  6. Run the new sync

This forces all records to be reprocessed and coordinates to be generated correctly.