Skip to content

Geo IP

Quick Start

The Geo IP Extension for Magento 2 enhances your online store by automatically detecting the geographical location of website visitors. Accordingly, it will enable managers to block or allow access to the website, change the language or currencies depending on customer location, apply special restrictions for certain groups of customers, etc.

This powerful tool ensures a personalized and efficient shopping experience, increasing customer satisfaction and conversion rates.

Installation

See Installation Guide for more install details.

Max Mind provider configuration

First of all, before starting to use extensions, the administrator must register with Max Mind service and generate a special API token to use the IPs databases.

  1. To create an account in this IP data provider, go to the Sign Up page. Max Mind sign up page view
  2. Then, go to Account page ➔ Manage License Keys tab. Max Mind account page view
  3. Click on Generate new license key button.

How to use

GeoIP extension for Magento 2 uses Max Mind databases to locate customers. Consequently, managers need to download databases for the extension to work properly.

Almost the entire functionality and configurations are located on Stores ➔ Settings ➔ Configuration ➔ Profstep tab.

Basic extension setup

To enable the module, select Yes value for field Enable Module in Stores ➔ Settings ➔ Configuration ➔ Profstep ➔ GeoIP settings ➔ General fieldset.

Option to enable the module in settings

When the module is enabled, the manager needs to select a database provider. If the website uses CloudFlare as a cdn, you can choose Cloudflare IP geolocation to determine the country code from the cdn headers.

CloudFlare IP geolocation option in database selection field

If managers want to use Max Mind and have received a license key, they need to set up credentials for the database API. To perform this, go to Stores ➔ Settings ➔ Configuration ➔ Profstep ➔ GeoIP data ➔ GeoIP DB settings and enter the key in the Max Mind License key field.

Max Mind data provider configuration settings

In addition, choose one of the available DB types for more accurate customer location:

  • Country - detect the user’s country by analyzing their IP address.
  • City - more accurate detection of the customer’s country based on regions and cities.

For database updates or the first download, go to Stores ➔ Settings ➔ Configuration ➔ Profstep ➔ GeoIP data ➔ Download Data and click on the button labeled “Download DB”. Then, the entire fetching process for new databases will be displayed.

Overview of the database load action

If managers want to save a copy of the current database, check the Create backup of downloaded files option.

How to configure

Redirect pop-up settings options

  • Show popup - Choose “Yes” to show a popup if the visitor follows the selected rules.
  • Popup type - Choose one of the following window types:
    • Notification window - a window that informs users about redirection to another page. Example of notification window
    • Confirmation window - an info window with “Ok” or “Decline” buttons to confirm redirection to another site. Example of confirmation window
  • Confirmation/Notification popup content - Content that will be shown inside the redirect window. Managers can put images and variables here. The field supports Magento 2 directives.

Conditions

Overview of redirect condition group settings

  • Ignored User Agents - A dynamic row to ignore redirects based on client user agents. This field can be helpful if you want to apply restrictions for customers with specific browsers.
    • User Agent - user agent label, e.g., Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.6527.189 Safari/537.36
  • IP Whitelist - A dynamic row to ignore redirects based on IP addresses. This field contains IP addresses which will ignore restriction conditions.

Overview of settings for applying customized rules

  • Apply restrictions to - Select one of the options below to apply the redirect to:
    • Specific URLs - All restrictions will only apply to the mentioned URLs.
    • Except URLs - All restrictions will be applied to every page except the specified URLs.
    • Home Page - Restrictions will only apply to the home page.
  • Specific/Excepted URLs - URLs that will be used with the previous configuration.
  • Redirect For the First Visit - Select “Yes” to apply restrictions only to the first visit to the site.

Ignore Lists

Overview of settings for permanently ignoring and redirecting customers

  • IP Blacklist - A list of IP addresses that will be redirected to the page chosen below.
  • Country restrictions - A list of blocked countries.
  • CMS page for restricted customers - Select the CMS page to which users are redirected, who meet the conditions in this group.

Country switch and redirect actions

Overview of country change and redirection action group settings

  • Change store view depending on the country - Select “Yes” to enable redirection to the selected store view based on the visitor’s country. This can be configured in Stores ➔ GeoIp ➔ Store View to Countries and the Store View to Countries link will be shown if the “Yes” option is selected.

  • Change currency depending on the country - Select “Yes” to change currency depending on the country using created mappings. This can be configured in Stores ➔ GeoIp ➔ Currency to Countries and the Currency to Countries link will be displayed if the “Yes” option is selected.

  • Redirect to URL depending on the country - Select “Yes” to redirect users to specific URL depending on country mappings.

  • Country to URL redirections - Mappings to redirect customers from specific countries to other URLs.

Overview of redirects to other URLs depends on country settings

Administration and Debug

Overview of settings for debugging customized rules

  • Disable condition - Enter the value that users must enter for the _store_switcher URL GET parameter to disable redirections.
  • Enable debug IP address - Choose “Yes” to show the Debug IP address field.
  • Debug IP address - Enter the IP address that will be used instead of the visitor’s URL address. This field is used only for debug purposes!
  • Debug Country - Replaces your determined location country with the value from this field.

Currency to Country Mappings

Overview of Currency to Country Mappings table

This mappings table is both a list and editor for currency mappings. Administrators can create mappings or edit them to change currency depending on the country. To edit mappings, click on the appropriate row and change countries.

Editing a mapping for the Ukrainian hryvnia

When managers want to add a new currency and relative mapping, they need to click on the Add new Mapping button. Then, they can choose one of the following currencies that don’t have mappings and appropriate countries for them.

Overview of adding a new currency to the country mapping

Store View to Countries Mappings

Overview of Store View to Countries Mappings table

This mappings table is both a list and editor for store view mappings. Administrators can create mappings or edit them to change store view depending on the country. To edit mappings, click on the appropriate row and change countries. When managers want to add a new store view redirect and relative mapping, they need to click on the Add new Mapping button. Then, they can choose one of the following store views that don’t have mappings and appropriate countries for them.

Overview of adding a new store view to countries mapping

Have any problems?

Ask for help on our email support@profstep.com, check our blog for answers blog.