How to Install and Use the Geolocation Addon with WPForms

Would you like to learn more about the location of your visitors? With the Geolocation addon from WPForms, you can easily collect geographical data on each of your leads.

In this article, we will show you how to install and use the Geolocation addon for WPForms.

Requirements: You will need a Pro license level or higher to access the Geolocation addon.

Setting Up the Geolocation Addon

Before getting started, you’ll first need to make sure that WPForms is installed and activated on your WordPress site.

Once you’ve got WPForms installed and your license is verified, you’ll be able to quickly install and activate the Geolocation addon.

After you’ve activated the addon, you can configure the addon’s settings under WPForms » Settings and selecting the Geolocation tab.

Geolocation settings in WPForms

From here, you’ll have the option to choose which provider you’d like to receive your geolocation information from in the Places Provider section.

Choose a places provider for Geolocation

You can also optionally allow your user’s location to be pre-filled into a form by checking the Current Location checkbox.

Allow users current location to be filled

Google Places

Note: Google Places requires your site to have an SSL certificate (e.g., load over HTTPS). If you’d like more information on how to get an SSL certificate for your site, be sure to check out WPBeginner’s guide on how to get a free SSL certificate for more details.

To set up Google Places within your forms, you’ll need to generate an API Key from within your Google Developer Console. To do this, select the project you’d like to enable this key on from the Select a Project menu.

Select a project

If you haven’t previously created a project, click New Project to create a new one.

Create new project

Note: Google will require you to enable billing on your account in order to use the Places feature. For more details on cost, be sure to check out Google’s pricing page.

Once you’ve opened up your project, you’ll need to click ENABLE APIS AND SERVICES.

Enable APIS and services

Here are the APIs you’ll need to enable:

  • Places API
  • Maps JavaScript API
  • Geocoding API

Once you’ve enabled the APIs on your site, navigate to the Credentials tab in your Google Console. From here, click the Create Credentials button and select the API key option to generate an API key.

Create API key in Google Console

After your key has been created, click the pencil icon to open up the key’s settings.

API key settings

From here, you’ll need to configure the following options:

Application Restrictions

To allow your API key to be used within WPForms, you’ll need to select the HTTP Referrers option. This will allow your key to be used within websites.

Website Restrictions

Once you’ve allowed your key to be used on websites, it’s recommended that you restrict which domains your key can be used on. To do this, add the domain(s) you’d like to use your key on. If you’d like to allow the key to be used across an entire domain, you can use the * (asterisk) symbol.

API Restrictions

Once you’ve restricted your key by Application and Website, you’ll need to restrict your key by API. To do this, click the Restrict key option.

Restrict API key

This will reveal another dropdown, where you’ll need to select the specific APIs you’d like to restrict your key to.

Applications restrictions dropdown

From this dropdown, you’ll need to select the following APIs:

  • Places API
  • Maps JavaScript API
  • Geocoding API

Once you’ve selected these APIs, go ahead and click the Save button to save your settings.

Save API settings

After saving your settings, you’ll be redirected to an overview of all available API keys. Go ahead and copy the value under the Key heading and head back over to your WPForms settings.

Within your WPForms settings, paste the API Key you just copied into the API Key field and save your settings.

Algolia Places

To generate an API Key specific to Algolia Places, you’ll first need to create a new app within your Algolia account.

Once you’ve created your new app, open up your API Key settings by clicking the API Keys option in the left menu.

Open API keys in Algolia

From here, copy your app’s Application ID.

Copy Algolia API key

Back in your WPForms settings, you’ll need to add the pl- prefix to the Application ID field, followed by your Application ID.

Application ID Settings in Algolia Settings></p>
<p>Then, head back over to your Algolia settings and copy your app’s <strong>Search-Only API Key</strong>.</p>
<p><img src=

Then, go ahead and paste this value into the Search Only API Key field within your WPForms settings and click the Save Settings button.

Algolia Places API Credentials

Adding Address Autocomplete to Your Forms

Now that you’ve configured your Geolocation settings, you’re ready to enable the Geolocation addon’s autocomplete feature within your forms.

To add autocomplete, you’ll first need to create a new form or edit an existing form.

Then, within your form builder, you’ll need to add either an Address field, or a Single Line Text field.

If you’d like the address to be displayed on multiple lines, select the Address field.

Address field in WPForms

If you’d prefer the address to appear on a single line, choose the Single Line Text field.

Single Line Text field

Then, within the Field Options, click on the Advanced tab to open up additional settings. From here, you can turn on the address autocomplete feature by selecting the Enable Address Autocomplete option.

Enable address autocomplete in WPForms

If you’d like, you can also choose to display an interactive map on the frontend of your site by selecting the Display Map option. You can choose to display the map either above or below your form field.

Display map option in Address Field

Once you’ve got everything set up, be sure to save your form.

Here’s how our form looks now, with the map and address autocomplete options enabled:

Address autocomplete frontend example

Viewing Entry Location Data

To view an entry’s geolocation data, go to WPForms » Entries and choose the form you’d like to see geolocation details for, then click View to open an individual entry page.

View individual entry page in WPForms

In addition to an interactive Google Map, you’ll see details such as city, state, country, and zip code, as well as an approximate latitude/longitude for the user’s town.

Geolocation Data in Entry

Including Geolocation in Form Notification Emails

If you’d like, you can also include geolocation data in automatic notification emails for your forms.

Note: For extremely large websites or those with a large volume of form submissions, it is not recommended to include geolocation data in notification emails as it could impact server speed.

To set this up, open the form builder and go to Settings » Notifications. Then scroll to the Email Message section and add the {entry_geolocation} Smart Tag.

Note: For more details on how to use entry data in your notifications, check out how to use Smart Tags in WPForms.

Add geolocation smart tag to notification email

When the notification email is sent out, it will now include location data for the user.

WPForms Geolocation in notification email

Note: Geolocation data is stored in entries and can be displayed in notification emails. However, the {entry_geolocation} Smart Tag is not currently able to be sent to third party integrations such as Zapier.

That’s it! You can now collect geolocation data to learn more about your users.

Next, would you also like to send out different notification emails depending on the user’s form selections? To learn how, be sure to check out our tutorial on conditional form notifications.