docs
  1. SCAYLE Resource Center
  2. Developer Guide
  3. Features
  4. Country Detection

Country Detection

Overview

The country detection feature enhances the user experience by suggesting the most relevant shop based on the user’s geolocation. This feature automatically detects a user's country and displays a pop-up offering to switch to the local or global shop, providing a more personalized shopping experience. The default country detection implementation uses the browser's timezone to infer the user's country.

The country detection functionality detailed below is accessible starting with version SFB 1.3.0. We encourage you to explore this enhancement to fully leverage its capabilities and improve your user experience.

Country Detection Pop-up

Display Logic

Single Shop Configuration

If you have only one shop, geolocation logic is not activated, and no pop-up will appear. The assumption is that this single shop serves all users, regardless of their location.

Multiple Shop Configurations

When you have multiple shops, the country detection logic becomes active.

  • One Shop per Country:
    • If you have a shop that matches the user’s detected country and they visit a shop for a different country, a pop-up will appear.
      • For example, if you have shops for Germany, the UK, and the US, and a user in Germany visits the UK shop, the pop-up will suggest switching to the German shop.
  • Multiple Shops per Country:
    • If you have more than one shop for the user’s country, the pop-up will offer choices for each available shop.
      • For example, if you have two shops for Germany (one in German and one in English) and a user in Germany visits the UK shop, the pop-up will suggest both German shops. The options will be "Switch to Germany shop (English)" or "Switch to Germany shop (German)," with an additional option to stay on the current shop.
  • No Local Shop Available:
    • If there is no shop for the user’s detected country, and you do not have a global shop, no pop-up will be shown. However, if you do have a global shop, the pop-up will suggest switching to it.

Pop-up Behavior & Localization

The pop-up appears only once per browser session unless the user’s location changes. Logged-in users will not see the pop-up, as their preferences are already established.

If a user clicks outside the pop-up, it will close, and it will not reappear during the same session if the user dismisses it. The content of the pop-up is localized to match the website’s language, providing a seamless experience for users in different regions.

Customizing the Default Implementation

The country detection process is designed to be flexible and easily configurable. If you prefer to use a third-party provider or an alternative browser-based solution, you can adjust the setup with ease. For detailed instructions on customizing the country detection logic, configuring region-based shopping, or managing country codes and translations, please refer to our Customization Guideline.