# Detect the visitor's language and country (no redirect)

> Overview The module detects the visitor's country (IP address) and browser languages, then shows a banner suggesting the same page in the store or language that suits them. It never…

- Page: <https://www.datafirefly.com/en/documentation/language-country-geolocation-prestashop/>
- Language: en
- Last updated: 2026-10-07
- Other languages: [fr](https://www.datafirefly.com/documentation/language-country-geolocation-prestashop/index.md), [es](https://www.datafirefly.com/es/documentation/language-country-geolocation-prestashop/index.md), [de](https://www.datafirefly.com/de/documentation/language-country-geolocation-prestashop/index.md), [it](https://www.datafirefly.com/it/documentation/language-country-geolocation-prestashop/index.md), [pl](https://www.datafirefly.com/pl/documentation/language-country-geolocation-prestashop/index.md), [nl](https://www.datafirefly.com/nl/documentation/language-country-geolocation-prestashop/index.md), [pt](https://www.datafirefly.com/pt/documentation/language-country-geolocation-prestashop/index.md)
- Index: <https://www.datafirefly.com/en/documentation/llms.txt>

## Overview

The module detects the visitor's country (IP address) and browser languages, then shows a banner suggesting the same page in the store or language that suits them. It never redirects: crawlers do not see the banner and your hreflang tags stay intact.

Compatible with PrestaShop 8.0 to 9.x, single store and multistore. The banner only appears when at least two destinations are active (two languages, or two stores).

## Installation

1. In **Modules > Module Manager**, click **Upload a module** and send the ZIP file.
2. The module automatically creates one destination per active store and language pair.
3. Open the module page with the **Configure** button or the **International > Language & country suggest** menu.

On multistore, install the module in the "All stores" context and make sure it is enabled on every destination store. A "Module not enabled on this store" badge warns you in the Destinations tab.

## Turn on country detection

The country is read, in this order:

- from your CDN header (Cloudflare, CloudFront, Vercel);
- from a MaxMind GeoLite2 file if you have one (configurable path);
- from the built-in free public-domain database.

To install the built-in database, click **Install the database** on the dashboard or in **Rules and detection**. The file (about 8 MB, IPv4 and IPv6) is downloaded to `var/dflocalesuggest/` and read locally: no visitor IP is sent to a third party. The status shows its date and recommends an update after 45 days.

If your host blocks outgoing connections, the download fails with a clear message. Place a .mmdb file on the server and enter its path in **Rules and detection**.

## Destinations

Each row is a store and language pair the banner can suggest.

- **Label**: replaces the store name in the banner (for example "USA").
- **Countries**: ISO codes separated by commas (FR, BE, CH). Empty means any country. Another store limited to other countries is never suggested to a visitor whose country is known.
- **Browser languages**: codes such as de, de-at, en-gb.
- **Order**: drag the rows to break ties between two destinations with the same score.

**Add missing pairs** creates rows for new stores or languages without touching existing rows. If the DataFirefly Hreflang module is installed, **Import from DataFirefly Hreflang** reuses your codes (es-US gives the language es and the country US).

## Appearance

Choose a theme, the four colors, the corner radius, the text size and the frosted glass effect. Placement is set separately for desktop (top or bottom bar, left or right card) and mobile (floating card, bar). The live preview on the right shows the result on desktop and mobile before you save.

- **Compact reminder**: if the visitor ignores the banner and keeps browsing, the following pages only show a pill.
- **Display delay**: the banner appears after the page has loaded, plus this delay.
- **Hide after a refusal**: how long a visitor who clicked "Stay here" is left alone.

## Texts

The banner is written in the suggested language: a German visitor reads it in German on a French store. Each language has its own texts, with one-click variables: `{language}`, `{country}`, `{store}`, `{currency}`. An empty field falls back to the built-in text.

## Rules and detection

- **When country and language disagree**: the country wins (store that ships to the visitor) or the language wins.
- **Respect multilingual visitors**: no language suggestion when the current language is among the browser languages.
- **Hide for logged-in customers**.
- **Pages without banner**: excluded controllers, cart and checkout by default. Wildcards are accepted (module-mymodule-*).
- **Wait for the cookie banner to close**: the main consent managers are detected and the CSS selector list can be edited.

## Test before going live

The **Simulator** tab tells you, for a given country and browser languages, whether the banner shows, with its text, its link and each destination's score. To see the real banner on your store, add your IP in **Test IP addresses**, then open a page with `?dfls_country=DE&dfls_lang=de`. The simulator's "See it on the store" link does it for you.

## Statistics

The dashboard shows banners displayed (once per visit), clicks, refusals, click rate, daily activity, and rankings per destination and per country over 7, 30, 90 days or one year. **Export CSV** downloads one row per day, origin store, destination and country. Counters are aggregated: no IP, no cookie and no customer identifier is stored.

## Visitor-side behavior

- A visitor who clicks the suggestion or switches store or language on their own is no longer asked on the chosen destination.
- The banner is never shown to crawlers (Googlebot, Bingbot, Lighthouse) and carries `data-nosnippet`.
- Page HTML stays identical for everyone: the module works with LiteSpeed Cache, Varnish and CDNs.

## For developers

DOM events on `document`: `dfls:shown`, `dfls:accept`, `dfls:dismiss`. With the option enabled, `dfls_shown`, `dfls_accept` and `dfls_dismiss` events are pushed to the `dataLayer` for Google Tag Manager. The `actionDflocalesuggestResponse` PHP hook receives the response by reference to change the text, the link or the destination.

## Troubleshooting

### The banner does not appear

Check that the banner is active, that at least two destinations are valid, that the page is not excluded and that you have not already declined or accepted a suggestion in this browser (clear the site's local storage). The simulator tells you why a destination is discarded.

### The country shows as "Unknown" in the back office

This is expected when you test from a local or private IP. Use the simulator or the test parameters.
