Geolocation FAQ

General
  • Can the country or city of the visitor be easily displayed using a shortcode?

    Certainly! With our geolocation Dynamic Keyword Insertion (DKI) shortcode, you can effortlessly achieve this.

    For instance, if you want to showcase the user’s country, you can use the following shortcode:

    [ifsoDKI type='geo' show='country']

    Similar shortcodes are available to display the user’s country flag, state, city, and event time calculated based on the user’s timezone.

    For all available DKI shortcodes

  • Do I need the Pro version of If-So to use the geolocation service?

    Nope, you don’t need the Pro version of If-So to make use of the geolocation service.

    The geolocation condition comes with the free version of the plugin, and you get 250 monthly sessions with our premium IP-to-location API for accurate results (for lifetime).

    If your website requires additional sessions, you can opt for one of our geolocation plans.

    You don’t have to buy a Pro license along with a geolocation plan if you only want to use the geolocation condition.

  • Is the Geolocation service 100% accurate?

    We strive for maximum accuracy by utilizing a premium, highly accurate IP-to-location API.

    However, it’s important to note that no geolocation service can guarantee 100% accuracy. Several factors influence the accuracy of the location data, with the ISP of the IP address being a key factor. Accuracy is generally higher for fixed lines than it is for cellular networks.

    If you come across any inaccuracies, please report them to us, and we will ensure that the database is updated accordingly.

    Gain a deeper understanding of IP-based geolocation services and their operational principles

  • Which service is used for geolocation-based content in If-So?

    If-So utilizes the ipinfo.io premium IP-to-location API for geolocation-based content. This database has shown high accuracy compared to similar databases.

    The database is regularly updated to ensure the most up-to-date information. If you come across any inaccuracies, please report them to us, and we will ensure that the database is updated accordingly.

    We also have plans to introduce at least one additional option for geolocation services in the future. This will allow you to switch between different options based on your preferences and requirements.

  • Can users self-select their location?

    Absolutely! You can implement a manual user location selection form (location override) that empowers users to choose a different location than the one automatically detected by our IP-to-location service.

    Dynamic content will be displayed based on the user’s selection.

    For additional information, please refer to our detailed guide.

  • Do I need to disable the geolocation service if I'm not using the geolocation condition?

    No, there’s no need to disable the geolocation service. The geolocation functionality will only be active if you set up location-based content.


Session
  • What is a geolocation session?

    A geolocation session refers to the period of time starting from when a visitor accesses a page with a geolocation trigger until either the visitor closes the browser or remains inactive for 25 minutes (the duration may slightly vary depending on the user’s browser and server hosting the website).

    To illustrate, if a visitor lands on the homepage, navigates to multiple other pages, and eventually leaves, this activity will be counted as a single session.

    The table below illustrates how different visitor interactions impact the session count on a website with geotargeted content:

    ScenarioSession Count
    A visitor only views pages without geotargeted content and then leaves0
    A visitor views a page with conditional content, the geolocation condition is not one of the conditions (other If-So conditions are used).0
    A visitor browses multiple pages within a single session1
    A visitor visits a page with geotargeted content, and then refreshes the page 1
    A visitor views a page, closes the tab, and returns to the site after 15 minutes1
    A visitor views a page with geotargeted content, but their location doesn’t match any targeted locations (default content is shown).
    *The user’s location still needs to be checked in this case.
    1
  • Will a geolocation session be counted on every page load?

    Nope!

    A geolocation session will only be counted if a user visits a page with a geolocation-based trigger.

    Moreover, if a user visits more than one page containing a geolocation trigger during the same visit, If-So will only count it as one session.

  • What happens when I run out of geolocation sessions?

    If you deplete your geolocation sessions, If-So will bypass the geolocation condition and evaluate the condition of the subsequent content version. If all dynamic versions have a geolocation condition or if none of the conditions are met, the default version will be displayed.

    If you are utilizing our Geolocation DKI shortcodes, you can establish a fallback value to be shown in such instances. Just include the parameter fallback=”your-value” to the trigger shortcode.

    [ifsoDKI type=”geo” show=”country” fallback=”your-value”]
  • Can I block logged-in users from consuming geo sessions?

    Yes! You can prevent logged-in users from using geolocation sessions by adding the following code to your functions.php file:

    phpCopyEditadd_filter('ifso_exclude_from_geo', function($exclude) {
        if (is_user_logged_in())  
            $exclude['blockme'] = true;  
        return $exclude;  
    });
    

    This ensures that logged-in users won’t consume geolocation sessions, helping you optimize usage for other visitors.

  • Can I block Search Engines and other bots from the geolocation service?

    Yes, you can. You have the option to either activate the automated “Bots Block” mode or log geolocation requests and manually block specific IPs. Learn more.

  • Where can I find information about my monthly geolocation session quota and usage?

    You can check your monthly session quota in two locations:

    1. In your WordPress dashboard, navigate to If-So > Geolocation.
    2. In your If-So account, go to the License Keys tab and view the License details.

    Screenshot – The geolocation dashboard:

    The Geolocaito dashborad

    Screenshot – Your account:

    image 1

Plans
  • Do I need to buy the Pro version along with a geolocation license?

    No, a geolocation license is sufficient if you only want to use the geolocation service.

  • Is it possible to use the same geolocation license on multiple websites?

    Absolutely! There are no limitations on the number of domains where you can activate a geolocation license.

  • Does every page view count as a session?

    Certainly not!

    1. A session is only counted when a user visits a page that contains location-based content, such as a trigger with a geolocation condition or a Geolocation DKI shortcode.
    2. If-So tracks the browser session throughout the user’s visit, so if the user navigates through multiple pages within the same visit, only one session will be counted.

    Will a session be counted in the event that the geolocation condition is not met?

    Yes. To determine the user’s location for deciding whether to display geotargeted content, we need to check the user’s location. As a result, a session will be counted irrespective of whether the geotargeting condition is met or not.

  • Is it possible to upgrade an existing Geolocation plan?

    Absolutely! You have the flexibility to upgrade your existing license at any time.

    How to upgrade my plan.

  • Is the monthly session limit applied per website or in total?

    The session limit applies to the total number of sessions across all websites where the license is active.

  • Do you offer plans with over 100,000 monthly sessions?

    Yes, we do!

    When you purchase an annual Geo Super Plan (100,000 monthly sessions), you’ll have the ability to easily upgrade your package.

    Additional packages of 50,000 monthly sessions are offered at a rate of $12.50 per month on a yearly subscription basis. You have the flexibility to purchase as many packages as you need to meet your specific requirements.

    To upgrade your package:

    1. Log in to your account.
    2. Locate your geolocation license.
    3. Click on “Upgrade license.”
    4. Select the desired package and proceed to the checkout.

Troubleshooting
  • Redirect feels slow or delayed

    If your redirect doesn’t fire immediately, the issue is usually related to how the trigger is loaded. Here’s how to ensure the redirect runs as quickly and smoothly as possible:

    Why Ajax affects redirect speed

    When a trigger loads with Ajax, the dynamic content is fetched after the static part of the page has already loaded from the cache. This means the redirect can only occur once the Ajax request finishes — resulting in a short delay.

    Strong caching paired with inefficient site construction can cause redirects to feel slower.

    How to speed it up

    To make the redirect fire instantly:

    1. Make sure to load the trigger without Ajax. The best practice is to add the parameter ajax=”no” to the trigger’s shortcode so that even if you change the Ajax settings on your site in the future, the trigger with the redirection will not be affected.

      Disabling Ajax means the page must be excluded from caching, so weigh this decision based on SEO needs, performance, your specific use case, and how well the page performs without caching
    2. Use a 301 or 302 redirect (and not a JS redirect).
    3. Consider embedding the If-So trigger to the page using a PHP code directly in the page template.
  • Communication Failure (Geolocation service)
    CURL error 1

    If the value of the “Sessions used this month” is 0/0 then it’s probably a communication failure between your server and ours. Don’t worry, we can easily solve it. Please try to activate geolocation or a free-trial license and use the form below to send us your domain:

    • Troubleshooting – The Geolocation Condition
      This is my modhfghfal content!

      ffffff

      If you have set up a geotargeted content and it doesn’t seem to be working as expected, follow the troubleshooting steps below. Each step covers a common issue and how to verify it.

      1. Are you testing the site on a local server or internal environment?

      The geolocation condition uses an external API to identify the visitor’s location. It can only work on a live, publicly accessible website. Local or internal environments do not support IP-to-location lookups.

      2. Is there a communication issue between your server and ours?

      • In your WordPress dashboard, go to If-So → Geolocation.
      • Look at the value next to “Sessions used this month.”

      If it shows 0/0, it usually means your server cannot reach our geolocation service.
      Please fill out this form and our support team will take it from there.

      CURL error 1

      3. Are you testing the site using a VPN?

      If-So’s geolocation condition may not take action when browsing the site through some VPNs. If you don’t see the geo-targeted version, it doesn’t necessarily mean the condition isn’t working properly.

      Instead, try:

      • Targeting your own actual country to verify the trigger – Set the condition to “Is” > {your country} to confirm the content displays correctly, or set it to “is not” > {your country} to verify that the fallback or default version appears.
      • Here is the corrected and polished version:
      • Try testing the page using an online proxy server or a different VPN. We use NordVPN for our testing.

      4. Are you using a caching plugin or CDN?

      Caching shows visitors a pre-rendered version of the page. If you use a caching plugin, server cache, CDN, or any type of page caching, enable If-So’s Page Caching Compatibility option to ensure your geotargeted content loads via Ajax after the cached page is served.

      • Go to If-So → Settings.
      • Enable the Page Caching Compatibility options

      Elementor users:

      In adittion to the steps above, go to Elementor → Settings → Performance (tab) → Change the Element Cache to Disable, and let me know if it solves the problem.

      For a deeper explanation of page caching and If-So’s caching compatibility.

      5. Is your location being detected inaccurately?

      No IP-to-location service is 100%. The accuracy of a location depends on many factors, the most important being the ISP of the address. The accuracy is generally higher for fixed lines than it is for cellular networks. Learn more here about geolocation accuracy.

      Below is how If-So recognizes your location. If you have set up a trigger targeting your actual location but the detected value is incorrect, the dynamic version will not be displayed as expected.

      Continent:

      Country:

      State:

      City:

      Timezone:

      Do you see the correct location in the above list?

      ✅ Yes → Double-check that your dynamic content is being loaded via Ajax (see the step above).

      ❌ No → Check out the three options below:

      1. Accuracy issues can be corrected within 24 hours – Fill out this form and we will ask our database provider to review and correct the IP record.
      2. If you are targeting users at the city level, consider using our HTML5 Geolocation API instead of, or in addition to, the IP-to-location service.
      3. Consider adding a Location Override Form to let users select their correct location manually.

      6. Do you have enough geolocation session credits?

      Unlike other If-So conditions, geolocation usage is limited by monthly sessions. If you run out of credits, the default content (fallback content) will be displayed instead of the geotargeted version.

      To view your monthly session usage, go to If-So → Geolocation in your WordPress dashboard.

      7. Are you using Cloudflare?

      From time to time we encounter conflicts between our geolocation service and Cloudflare. We can solve them! Paste the following code at the end of your functions.php file and try again. If it doesn’t solve the problem, please contact our support.

      add_filter('ifso_user_ip',function(){
      $ip = null;
      if (!empty($_SERVER['HTTP_CF_CONNECTING_IP']))      //Cloudflare
      $ip = $_SERVER['HTTP_CF_CONNECTING_IP'];
      elseif (!empty($_SERVER['HTTP_CLIENT_IP']))
      $ip = $_SERVER['HTTP_CLIENT_IP'];
      elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
      $ip = explode(',',$_SERVER['HTTP_X_FORWARDED_FOR'])[0];
      else
      $ip = $_SERVER['REMOTE_ADDR'];
      
      if(!empty($ip)){
      $ip = explode(':',$ip)[0];
      }
      
      return $ip;
      });
      
    • "Communication Error" Notice

      It appears that there is a communication issue between our server and yours. No need to worry though, we can resolve it. Kindly follow these two steps:

      1. Please attempt to activate a license on your site. Although the activation may not be successful, the information necessary for troubleshooting will be automatically sent to our team (you can get a free license here).
      2. Fill out the form below, providing us with your website’s URL.

      • I don't see the content or don't see the correct version

        Stay calm and refer to our Geolocation Troubleshooting guide for assistance.

      • The geolocation session count appears to be inaccurate.

        Inaccurate session counts can occur when bots visit the website. Learn about possible solutions to address this issue.

      • Location override form - Country flags not visible

        If you are unable to see the country flags, it is likely because your browser does not support emoji display by default (Google Chrome on a desktop for example).

        Browsers that have built-in support for displaying emojis

        Browsers that have built-in support for displaying emojis
      • Conditional redirect not working

        If your conditional redirect isn’t working as expected, don’t worry – follow the steps below to identify the issue and get it resolved quickly.

        1. Isolate the problem

        Test the redirect outside the trigger

        Paste the redirect shortcode directly into the main content field of a new test page (without using a trigger).

        1. Create a new blank test page.
        2. Paste the redirect shortcode directly in the main content area (without using a trigger or dynamic content).
        3. Visit the page and see whether the redirect works.

        Did it work?

        Yes → The redirect code works. Move on to checking your condition.
        No → The issue is likely with the redirect setup. Jump to the “Redirect shortcode issues” section.

        Verify that the condition is being met

        1. In your trigger (or dynamic content block), add a simple text indicator before the redirect — e.g., “This is a version A”.
        2. Add a text indicator to the default version — e.g., “This is the default version.”
        3. Visit the page in an incognito window (to avoid admin/existing-cookie interference).

        Does it work?

        Yes → If you the correct version the issue is either the redirect type or a caching issue.
        No → If you don’t see the correct version → The condition may be misconfigured, or caching is preventing the dynamic version from loading.

        Works? The issue is likely related to the redirect shortcode itself, or a caching conflict.
        ❌ Didn’t work? The condition may be misconfigured or the content might be blocked by caching.

        2. Check caching settings

        Caching is the most common reason redirects don’t fire as expected.

        1. Try loading the trigger with and without Ajax (Page Caching Compatibility) to determine if caching is interfering. How to enable/make sure the Ajax loading is enabled.
        2. Try switching to a JavaScript redirect by adding the parameter type=’js’ to your redirection shortcode. For example:
        [ifso-redirect url='https://example.com' type='js']
        

        If JavaScript redirection works, the issue is almost certainly caching-related.

        Try loading the content with and without Ajax (Page Caching Compatibility) to determine if caching is interfering. How to enable/make sure the Ajax loading is enabled. 

        Still not working? We’ll help!

        If the issue persists, please contact our support and share the following:

        • Where the redirect is placed (page, trigger, element, popup, etc.).
        • Which condition you’re using.
        • Whether the redirect works on a blank test page.

        We’re happy to take a look and help troubleshoot further. Contact support


      Developers
      • Can I get the geo data detected by If-So?

        If-So utilizes an IP-to-location database to determine the user’s location. You can use the geo data detected by If-So for any purpose by implementing the following code:

        require_once(IFSO_PLUGIN_BASE_DIR. 'services/geolocation-service/geolocation-service.class.php');
        $geo_data = \IfSo\Services\GeolocationService\GeolocationService::get_instance()->get_user_location();

        Keep in mind that IP-to-location services (any service, not just ours) are not always 100% accurate. Learn more about IP-to-location services and how they work.

        Want to capture the user’s location using JavaScript? Click here


      • Is there a way to capture the user's country in JavaScript?

        Yes, you can capture the user’s country in JavaScript by using the following PHP code in your theme’s functions.php file. This code fetches the user’s geolocation data and sets it as a JavaScript variable:

        phpCopy codeadd_action('wp_enqueue_scripts', function(){
            if(!defined('IFSO_PLUGIN_BASE_DIR')) return;
            require_once(IFSO_PLUGIN_BASE_DIR. 'services/geolocation-service/geolocation-service.class.php');
            $geo_data = \IfSo\Services\GeolocationService\GeolocationService::get_instance()->get_user_location();
            $ifso_country = !empty($geo_data->get('countryCode')) ? $geo_data->get('countryCode') : '';
            if(function_exists('wp_add_inline_script'))
                wp_add_inline_script('if-so',"var ifso_country = '{$ifso_country}';",'after');
        });
        

        This code will make the user’s country available as a variable named ifso_country in your JavaScript. You can customize this code to capture other geolocation data, such as city or state, by adjusting the values in the code.