Configuring WooCommerce geolocation

WooCommerce includes geolocation by IP feature. This function calculates the user’s country using his IP before the user sets the address on the checkout or cart page.
Configuring this WooCommerce feature is essential to display the correct price, taxes, and currency to the new users visiting your store.

Setup wizard

“Price Based on Country” includes a setup wizard to help store owners configure the geolocation in a guided way. It runs automatically for new installations after the plugin activation.

GeoIP database

The geolocation function requires the MaxMind GeoIP database GeoIP.  You need a free MaxMind license key to access the GeoIP database download and update it periodically.

The GeoIP database is not required if your hosting provides geolocation info.

WooCommerce geolocation wizard step 1

Create a MaxMind license key

If you do not have an account on MaxMind.com, create one from https://www.maxmind.com/en/geolite2/signup

  • On the registration page, complete the form with your information. If you’re not sure what to choose as “Industry” and “Intended use” fields, fill them with “eCommerce” and “Price localization,” respectively.
  • After submitting, you’ll get an email shortly after submitting with a link to set your password.
  • Click on that link and choose a password.

After creating the account, go to: https://www.maxmind.com/en/account

  • Select the “Manage License Keys” tab in your user account dashboard.
  • Select “Generate new license key.” In the form:
    • Add a description (just like the name of your store)
    • Choose “No” next to “Will this key be used for GeoIP Update?”
    • Select “Confirm.”

Confirm MaxMind license key generation

Copy the key and paste it into the setup wizard field.

Cache support

The geolocation does not run on cached pages. So the store may display an incorrect price if you use a cache plugin. The plugin includes a function that refreshes the prices using AJAX and Javascript to solve this problem.

This step of the setup wizard enables this option automatically if a cache plugin is installed. Do not change it if you aren’t sure what you are doing.

WooCommerce geolocation wizard step 2

Reusing the setup wizard

If you want to rerun the Geolocation Setup Wizard, you can do it from WooCommerce > Settings > Pricing zones > Options > Advanced.

Run the geolotion setup wizard of WooCommerce

Check the WooCommerce System Report

Go to WooCommerce > Status and scroll down until the “Geolocation debug info” section. Check if there is some problem that could cause the geolocation function not to work correctly.

Price Based on Country - Geolocation debug in the system report