Documentation
How do I enable the plugin?
Install the zip on your WordPress site. Gravity Forms must already be active.
Step 1: Installation
Log in to WordPress and go to Plugins → Add Plugin → Upload Plugin. Install the zip and activate it.
Step 2: Settings
Go to Geofence → Settings, or Forms → Settings → Geofence. Same screen.
Keys are optional. Skip this if you are only using postal codes.
- Google API Key – needed to draw areas on the map. Turn on the Maps JavaScript API, and restrict the key to your site. Postal code areas do not need a key. If you already use Address Autocomplete for Gravity Forms, we can use that key until you enter one here.
- Look Up Coordinates and a Geocoding API Key – only if you want us to place a map-drawn area from a typed address. This must be a different key from the one above, with the Geocoding API on, and no HTTP referrer restrictions. Restrict it by IP instead. Postal code areas never use this.
Step 3: Create your areas
Go to Geofence → Geofences, or Forms → Geofences. Add one, give it a title, choose postal codes or a map shape, and set Order. Put smaller areas above bigger ones.
Step 4: Turn it on for the form
Open the form, then Settings → Geofence.
- Turn on Enable Geofencing.
- Select the areas that apply.
- Pick the Address Field (an Address field or a Single Line Text field).
- Choose Block the submission or Warn, but allow the submission.
- Change the Out of Area Message if you want. The default is “Sorry, we do not currently service that address.”
- Optional: set Store Matched Zone In to a Hidden or Single Line Text field. That is the field notifications and conditional logic will read.
Save Changes.
Step 5: Prices (only if you sell products on the form)
On the same form, open Settings → Geofence Pricing. Save the Geofence tab first so your areas show up here. For each product with a set price, choose whether it is sold in every area on the form or only in some, and type a different price where it is not the base price. Under When the address matches no geofence, choose Block the order (the default) or Charge base prices.
Step 6: Notifications
Open Settings → Notifications. Add one notification per area, and set conditional logic on the zone field. If that field is Little Rock, send to littlerock@…
That’s it. Repeat Step 4 on any other form that needs it.
Feature details
Postal code areas
Paste postal or ZIP codes, one per line or separated by commas. Blank lines are ignored. A line starting with # is a note to yourself.
- Exact –
90210matches that code. - Starts with –
606*matches any code beginning with606. - Range –
10001-10005matches every number in that range, including the ends. Both ends need the same number of digits.
Capital letters do not matter. Spaces and hyphens are ignored on exact and “starts with” patterns, so 90210-1234 matches 90210, and SW1A 1AA matches SW1A1AA. Ranges are read before that cleanup, so a hyphenated range is never treated as a hyphenated postcode.
Postal areas are checked against the address they submitted. They never call a mapping API.
Areas drawn on a map
Draw the area on a Google map when you edit the geofence. These areas match a point on the map, not the postal code alone.
That point comes from Address Autocomplete for Gravity Forms if it is on the same address field, or from a lookup if you turned on Look Up Coordinates and added a Geocoding API key. You do not have to use Address Autocomplete.
Order: first match wins
If a form has more than one area, we test them in the Order shown under Form Settings → Geofence. The first one that matches is the zone. Put the smaller area first so a wide catch-all does not swallow it. The same Order picks the prices when two areas overlap.
Settings on each form
Each form has its own Geofence tab. Nothing runs until you turn on Enable Geofencing for that form.
You pick the areas, the address field, whether to block or warn, the out-of-area message (plain text, shown next to the address), and an optional field to store the area name.
Save the area name, then route the email
Store Matched Zone In writes the area title into a Hidden or Single Line Text field. Hidden is the usual choice. Number fields are not offered, because the value is a name, not a number.
If they are in an area, the field holds that title (for example Little Rock). If they are outside every area you picked, the field is empty. Point conditional logic at that field to show or hide parts of the form, and build one notification per area.
Gravity Forms reads that field like any other, so its own merge tag works in a notification too, alongside the {pb_geo:*} tags below.
The live check and the submit check
The check while they type is for them. It updates the area field, the warning, and the prices.
When they submit, we check the address again from the areas saved on the form. We do not trust what the browser sent. Block and warn follow that second check.
Postal areas are always checked from the submitted address. Map-drawn areas are checked the same way when Look Up Coordinates is on. If the map point comes only from the browser (Address Autocomplete, with the lookup off), someone could change it. Add a postal area as well, or turn the lookup on, if you need a hard stop.
When we cannot place the address
If the areas need information the address does not have (only map-drawn areas, and no location on the map) or a lookup fails, we let the submission through. That entry is recorded as unchecked, not as outside.
Forms that sell products are the exception. There, When the address matches no geofence decides, and it is set to block by default, so an address we could not place cannot place an order until you change that setting.
The “inside” value is No both when they are outside every area and when we could not check. The reason is what tells those apart. If we never checked the entry at all, “inside” is left blank so it does not look like a confident No.
Different prices per area
Form Settings → Geofence Pricing works on Gravity Forms product fields that have a set price (single product and hidden product). It does not change dropdown products, calculated prices, or fields where the customer types the price.
The price on the product field is the base price. For each of those products you choose:
- Sold in every geofence on this form, or
- Sold only in selected geofences
Then add a Price override on the areas that charge something else. Areas with no override keep the base price. A product that area does not offer is left out of the total and rejected if they try to submit it. To hide it from the form as well, point conditional logic at the saved area field.
When the address matches no geofence (outside every area, or we could not place it) you can Block the order or Charge base prices. Block is the default, and it applies whether you chose Block or Warn on the Geofence tab.
Prices and the form total update as the address changes. The price we actually charged is saved on the entry, so an old order still shows what they paid after you change a price. Test an address on the same screen checks a typed address against the settings you last saved.
Entries, tags, and who can see what
Geofence → Entries lists submissions from the areas assigned to that person, across every form that uses a geofence. You can filter by area and by tag. Opening an entry shows where it landed, what was ordered at the charged prices, and what they typed.
Set the tag list once under Geofence → Settings → Entry Tags (one per line). People apply those tags on the entry screen, so the same words work across every area.
Two roles appear on the Users screen:
- Geofence Manager – sets up the areas assigned to them, and the prices (including Geofence → Pricing, which does not need Gravity Forms access).
- Geofence Entry Viewer – reads, tags, and notes entries from the areas assigned to them.
Assign people in the Assigned Users box when you edit an area. The Google keys stay with the site administrator.
A worked example
Five postal areas. Two services are sold in all five, each at its own price. A third is sold in only three of them, again at its own price. The customer picks any mix the matched area offers, and an address you do not cover cannot place the order.
The area name is saved on the form. One notification fires when that field is North Little Rock. Another fires when it is Lake County.
Merge tags
These pull the values saved on the entry. Use them in notifications, confirmations, and any other Gravity Forms merge-tag field.
{pb_geo:fence_title} – the area name (the same text written to Store Matched Zone In). Empty when no area matched.
{pb_geo:fence_id} – the area ID. Empty when no area matched.
{pb_geo:inside} – Yes or No. Empty if we never checked the entry, so it does not read as a confident “outside.”
{pb_geo:reason} – why we decided that:
- Inside a geofence
- Outside every geofence
- Could not be checked — the address had no postal code or coordinates to match on
- Could not be checked — no usable geofences were selected for this form
- Rejected — the submitted address was not in a form this plugin could read
FAQs
Do I need a Google API key?
Only to draw areas on the map, or to look up a typed address. Postal code areas need no key and do not call Google. The Maps key is for the editor. The Geocoding key is only used when Look Up Coordinates is on.
What postal code formats work?
Exact codes, prefixes like 606*, and number ranges like 10001-10005. One pattern per line, or commas. See postal code areas under Feature details.
What if more than one area matches?
We use the first one in Order. That area’s prices are the ones that apply.
Can I warn people without blocking them?
Yes. Choose Warn, but allow the submission. Your message still shows next to the address, and the area name still fills in when they match, so emails and hidden fields still work. One exception: on a form that sells products, When the address matches no geofence is set to block by default, and that setting is what decides whether an unmatched address can order.
How do I send different emails per area?
Save the area name in a Hidden or text field, then add a notification for each area with conditional logic on that field.
Is the check while they type enough to block someone?
No. That check is for the person filling the form. We decide whether to block when they submit.
What if you cannot tell where the address is?
On a form without products, we let it through and mark the entry as unchecked rather than outside. On a form that sells products, the When the address matches no geofence setting decides, and it blocks by default. Either way the reason on the entry tells you what happened.
Does it work on multi-page forms?
Yes. We only check the page they are submitting, so Next on page one will not fail because of an address or a product on a later page.
Which products can have a different price per area?
Product fields that have a set price (single product and hidden product). Not dropdown products, calculated prices, or “name your price” fields.
Do I need Address Autocomplete for Gravity Forms?
No. If both plugins are on the same address field, we reuse the location they already picked, so a map-drawn area does not need a second lookup. Postal areas never need it. Map-drawn areas can use Look Up Coordinates instead.
Can I use it on more than one form?
Yes. Areas are reusable. Each form has its own on/off switch, area list, address field, block-or-warn choice, message, saved-area field, and prices.
The warning disappeared on a cached page. Is the form still checked?
Yes. The live warning can go quiet if a page sits in cache for more than a day. We still check the address when they submit, and we still block if you set it to block. If your cache keeps pages longer than a day, leave geofenced form pages out of that cache, or shorten how long they stay there.