{"id":19914,"date":"2025-07-12T11:15:56","date_gmt":"2025-07-12T09:15:56","guid":{"rendered":"https:\/\/www.welaunch.io\/en\/?post_type=faq&p=19914"},"modified":"2025-07-12T11:18:17","modified_gmt":"2025-07-12T09:18:17","slug":"country-selector-debugging","status":"publish","type":"faq","link":"https:\/\/www.welaunch.io\/en\/knowledge-base\/faq\/country-selector-debugging\/","title":{"rendered":"Country Selector Debugging"},"content":{"rendered":"
\n

Sometimes your users country may not match your current country. In this case use this guide to find out why the wrong country was detected in our wp country selector plugin.<\/p>\n

Step-by-step guide<\/h2>\n
    \n
  1. \n
      \n
    1. Launch Chrome DevTools
      \n<\/strong>Windows \/ Linux: F12 or Ctrl + Shift + I
      \nmacOS: \u2325 Option + \u2318 Cmd + I<\/li>\n
    2. \n

      Open your page in debug mode<\/strong>
      Open your domain with the extra parameter ?country=debug<\/strong> into the address bar and press Enter<\/strong>:<\/p>\n

      https:\/\/yourdomain.com?country=debug<\/span>
      \n<\/strong><\/code><\/li>\n

    3. \n

      View the JSON output<\/strong><\/p>\n

        \n
      • \n

        Switch to the Console<\/strong> tab.<\/p>\n<\/li>\n

      • \n

        Reload the page (F5<\/code> or Ctrl \/ \u2318 + R<\/code>).<\/p>\n<\/li>\n

      • \n

        The plugin prints one formatted JSON object\u2014the debugging data.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n

          \n
        1. \n

          Alternative method<\/strong>
          In DevTools > Network<\/strong>, select the page request, then open the Preview<\/strong> or Response<\/strong> sub-tab to see the same JSON payload.<\/p>\n<\/li>\n<\/ol>\n

          \"\"<\/p>\n


          \n

          2 Field glossary (what each key tells you)<\/h2>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
          Key<\/th>\nMeaning<\/th>\n<\/tr>\n<\/thead>\n
          users_url<\/code><\/td>\nThe URL the visitor is currently on.<\/td>\n<\/tr>\n
          users_country<\/code><\/td>\nTwo-letter ISO country code detected for the visitor.<\/td>\n<\/tr>\n
          users_language<\/code><\/td>\nBrowser language of the visitor (e.g. de<\/code>).<\/td>\n<\/tr>\n
          target_URL<\/code><\/td>\nDestination URL the plugin would redirect to.<\/td>\n<\/tr>\n
          force_redirect<\/code><\/td>\n1<\/code> = immediate redirect, 0<\/code> = show modal first.<\/td>\n<\/tr>\n
          force_redirect_seconds<\/code><\/td>\nDelay (seconds) before redirect, if force_redirect = 1<\/code>.<\/td>\n<\/tr>\n
          force_redirect_exclude_logged_in<\/code><\/td>\n1<\/code> = logged-in users are never redirected.<\/td>\n<\/tr>\n
          logged_in<\/code><\/td>\nIndicates whether the current visitor is logged in.<\/td>\n<\/tr>\n
          modal_header<\/code><\/td>\nText shown as the modal\u201fs headline.<\/td>\n<\/tr>\n
          modal_text<\/code><\/td>\nBody HTML of the modal (localised message).<\/td>\n<\/tr>\n
          modal_buttons<\/code><\/td>\nFull HTML for the \u201cGo to country\u201d and \u201cStay here\u201d buttons.<\/td>\n<\/tr>\n
          modal_countries<\/code><\/td>\nOptional custom list of countries in the modal (blank = default list).<\/td>\n<\/tr>\n
          show_popup<\/code><\/td>\n1<\/code> = show modal, 0<\/code> = suppress modal.<\/td>\n<\/tr>\n
          is_default<\/code><\/td>\ntrue<\/code> if this market configuration is the global fallback.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
          \n

          3 Troubleshooting<\/h2>\n\n\n\n\n\n\n\n\n
          Symptom<\/th>\nLikely cause<\/th>\nFix<\/th>\n<\/tr>\n<\/thead>\n
          No JSON appears<\/strong><\/td>\nWrong URL or parameter cached<\/td>\nClear the browser cache or use an incognito window; double-check ?country=debug<\/code> is at the very end of the URL.<\/td>\n<\/tr>\n
          Redirect fires before you can open DevTools<\/strong><\/td>\nforce_redirect = 1<\/code> without delay<\/td>\nTemporarily set force_redirect<\/code> to 0<\/code> in the plugin settings, or quickly hit Esc<\/code> to stop the page, then open DevTools and reload.<\/td>\n<\/tr>\n
          Output truncated or minimised<\/strong><\/td>\nChrome collapses long objects<\/td>\nClick the small \u25b6 triangle next to the object to expand it.<\/td>\n<\/tr>\n
          Security \/ optimisation plugin strips the query string<\/strong><\/td>\nServer-side caching or firewall<\/td>\nAdd country=debug<\/code> to the cache-exception list, or disable optimisation plugins briefly while testing.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
          \n

          Tip:<\/strong> Once you have the raw JSON, you can copy it from the console and paste it into a JSON formatter (e.g. jsonlint.com) for prettier inspection or share it with your support team.<\/p>\n<\/article>\n","protected":false},"author":1,"featured_media":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","product_cat":[],"class_list":["post-19914","faq","type-faq","status-publish","hentry","faq_topics-country-selector","faq_topics-country-selector-faq"],"_links":{"self":[{"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/faq\/19914","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/faq"}],"about":[{"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/types\/faq"}],"author":[{"embeddable":true,"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/comments?post=19914"}],"version-history":[{"count":4,"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/faq\/19914\/revisions"}],"predecessor-version":[{"id":19919,"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/faq\/19914\/revisions\/19919"}],"wp:attachment":[{"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/media?parent=19914"}],"wp:term":[{"taxonomy":"product_cat","embeddable":true,"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/product_cat?post=19914"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}