Documentation

Geocoder Field

Last modified: September 11, 2026

Introduction

The Geocoder Field is a hidden processing and storage field. It converts addresses or coordinates into structured location data and synchronizes linked Address, Coordinates, Map, and Locator Button fields.

Add a separate Geocoder Field for each independent location in the form, such as an origin and destination.

Configuring the Geocoder Field

Gravity Forms Geocoder field options
Configuration options for the Geocoder Field.

1. Default Coordinates

Set the location that the Geocoder can process when the form loads.

Default Latitude

Enter the latitude of the default location (Example: 40.7827096).

Default Longitude

Enter the longitude of the default location (Example: -73.965309).

Geocode on Page Load

Enable this option to geocode the default coordinates when the form loads and populate every field linked to this Geocoder. When disabled, the coordinates remain available as defaults but do not automatically update the complete location group.


2. Map Marker Options

Customize the marker associated with this Geocoder on linked Map Fields.

Marker URL

Use a custom marker image (Example: https://maps.google.com/mapfiles/ms/icons/blue.png).

Marker Info Window Content

Add content displayed when the marker is clicked. Leave it blank to disable the info window (Example: Hello World!).

Hide Marker on Initial Load

Hide the marker until geocoding occurs or the user interacts with the location fields.

Disable Marker Dragging

Prevent users from repositioning the marker by dragging it.

Move Marker Using Map Click

Allow users to reposition the marker by clicking a location on the map.

Disable Address Output

Prevent marker movement from replacing the value in linked Address Fields. Coordinates and the Geocoder’s structured data can still update.

Form-Level Auto Locator

Auto Locator is configured for the entire form, not inside the Geocoder Field. In the form editor, go to Settings > Gravity Geolocation.

1. Select Geocoder Fields

Select one or more Geocoder Fields to populate automatically when the form loads.


2. IP Address Locator

  • Disabled: Use browser geolocation only (Default).
  • Default: Use the configured IP provider as the primary location method.
  • Fallback: Try browser geolocation first and use IP location only if it fails.

An IP provider must first be selected in Gravity Geolocation’s global settings.


3. Auto Locator Messages

Location Found Message

Enter the message displayed after the location is detected. Leave it blank to disable the success message.

Hide Location Failed Message

Hide the front-end alert when location detection fails. The error remains available in the browser console for troubleshooting.

Saved Data and Merge Tags

The field saves structured location data, including address components, formatted address, latitude, longitude, and Google Place ID when available. Gravity Forms displays this data in the entry and can include it in notifications, confirmations, and exports.

The normal field merge tag displays the formatted location details. Named modifiers can return individual values:

  • {Geocoder:FIELD_ID:formatted_address}
  • {Geocoder:FIELD_ID:latitude}
  • {Geocoder:FIELD_ID:longitude}
  • {Geocoder:FIELD_ID:city}
  • {Geocoder:FIELD_ID:postcode}
  • {Geocoder:FIELD_ID:map_link}
  • {Geocoder:FIELD_ID:json}

Replace FIELD_ID with the Geocoder Field’s numeric ID. Other saved location keys, such as country_code, region_name, and place_id, can also be used as named modifiers.

Setting Up and Using the Geocoder Field

  1. Add a Geocoder Field for each location group.
  2. Optionally configure default coordinates and Geocode on Page Load.
  3. Link the group’s Address, Coordinates, Map, and Locator Button fields to this Geocoder.
  4. Configure form-level Auto Locator only if the form should locate the visitor when it loads.
  5. Preview, submit, and review an entry to verify synchronization and saved data.
menu-circle