Country not detected: what GeoBeacon does and does not do

Most of what a geolocation app does starts with one fact: the country the visitor is in. Most of the time Shopify supplies it. Occasionally it does not, and what an app does in that moment says a lot about how it was designed. GeoBeacon does nothing. No popup, no redirect, no fallback to a default country, and no use of the catch-all rule you may have set up for everyone else. This post explains where the country comes from, what causes it to be missing, exactly what the script does when it is, why the catch-all rule does not fire, and how to see the case for yourself.

Where the country comes from

GeoBeacon never looks up an IP address itself and never sends a visitor's details to its own server. The storefront script asks Shopify, from the shopper's browser, using the same endpoint Shopify's own country selector relies on: /browsing_context_suggestions.json on your store domain, with country and language suggestions enabled. Shopify works out the country from the request on its side and answers with a suggested country and language for that visitor, drawn from the countries your Shopify Markets actually serve.

The script reads the country handle from the answer, upper-cases it, and that two-letter code is the detected country for the rest of the decision. When the answer has no country in it, the detected country is null. That single null is what the rest of this post is about.

Why Shopify sometimes returns no country

The honest answer is that Shopify does not publish the list, so this section is inference from what the endpoint does. Three situations produce an empty country in practice.

  • Shopify could not place the request. Some corporate network exits, satellite connections, privacy relays and freshly allocated IP ranges do not resolve to a country in the data Shopify uses. A VPN is usually not one of these: a VPN exit has a country, just not the shopper's, and GeoBeacon will happily offer that country's store.
  • Shopify answered with something other than a success. The script treats any non-success status as no suggestion and records an empty result.
  • The request did not complete at all: a flaky connection, a content blocker that interferes with fetches on the page, or the shopper navigating away before the answer arrived. The script catches the failure and treats it as no country too.

The first two are cached. A completed answer, with or without a country, is stored in the browser's session storage for six hours, so pages opened in the same tab do not ask again. The third is not cached, because a network hiccup on one page is no reason to give up for the rest of the visit; the next page simply asks again.

What the script does with a missing country

The decision function runs after the cheap checks have passed: the embed is on, it is not the theme editor, the visitor is not a known bot, the page is not excluded, no previous choice is remembered and at least one rule is enabled. Those checks are described in the console log post. Only then does detection happen, and the very first line of the decision is: if there is no detected country, return no action with the reason undetected.

That return happens before rules are consulted. It is not that the rules were checked and none matched; they were never read. Nothing is written to local storage either, because there was no choice made and nothing to remember, so a visitor who is detected properly on their next visit gets the normal popup or redirect as if this visit had not happened. With the embed's debug setting on, the browser console shows a single line: a decision with action none and reason undetected.

Why the catch-all rule does not fire

This is the question that prompted the post. A store sets up a rule for Germany, one for France, and a last rule for Everyone else that sends remaining visitors to the international store. Then a visitor with no detected country sees nothing, and the merchant asks why the Everyone else rule did not catch them. The answer is in the name of the rule as the app understands it. Everyone else means every detected country that no earlier rule claimed. It is a rule about a country, with a wildcard where the country code goes, and the detected-country target post explains how it pairs with the Detected country target. A visitor with no country is not an unclaimed country. They are an unknown, and the script treats unknown as a reason to stay out of the way.

Consider what the alternative would look like. The popup text uses a country placeholder: Shopping from France? A missing country would render as Shopping from undefined?, or the app would have to invent a label such as your region, which sounds evasive to a shopper who knows exactly where they are. A silent redirect would be worse: a shopper in Germany whose connection happened to be unplaceable would be sent to the international store with no explanation and no way to know why. Doing nothing leaves them on the store they chose to open, where Shopify's own country selector still works if they want to change it.

Language suggestions go quiet too

The same answer from Shopify carries a suggested language, and the Also switch language setting uses it when a rule targets a market without a fixed language. When the country is missing the decision never gets that far, so no language switch is suggested either, even if the language suggestion itself was present. A rule with a fixed language, as the language switch post describes, needs a matched country to apply, which also needs detection.

How often it happens

Rarely, for most stores. The merchants who notice are the ones with a large share of corporate or institutional traffic, or who test from an office network and wonder why the popup never appears for them while it does at home. If you suspect it is affecting a meaningful share of visitors, the debug line is the measurement: count undetected decisions against popups shown over a few days of your own testing from the networks your shoppers use. GeoBeacon keeps no visitor analytics of its own, so there is no dashboard figure for it, by design.

Testing the two sides

You cannot make Shopify forget your country on demand, so the undetected case is observed rather than forced: turn on debug, open the store from a connection you suspect, and read the console. The other side is easy. Add ?geobeacon=DE or any two-letter code to a store URL and the script skips Shopify's answer and uses that country instead, without caching or remembering anything. The testing without a VPN post goes through that and the ?geobeacon=off switch. If the forced country produces the popup you expect and your real visit produces an undetected line, the app is behaving correctly and the gap is in the connection, not the configuration.

One last distinction, because it comes up in the same support threads. A detected country that none of your markets serve is not undetected. In that case the country is known, a rule may match it, and if the target market does not offer that country the decision returns country-not-offered instead. The countries you do not ship to post covers that path, which is the one the Everyone else rule is for.

Frequently asked questions

Why did a visitor see no popup even though I have an Everyone else rule?

Because the Everyone else rule is still a rule about a detected country, just any detected country. When Shopify returns no country for the visitor, GeoBeacon stops before rule matching with the reason undetected, so no rule, including the catch-all, is consulted. The visitor stays on the page they opened.

Does GeoBeacon guess the country from the browser language when detection fails?

No. The browser language says what the shopper reads, not where they are, and a wrong guess produces a popup addressed to the wrong country. The script uses only the country Shopify derives on its servers for that request, and when that is missing it does nothing.

Is the undetected result cached, so the visitor never gets a second chance?

For six hours in that browser tab, yes, when Shopify answered but without a country. The result is stored in session storage and reused for pages opened in the same tab; a new tab or a return visit later asks again. A failed request, such as a network error, is not cached and is retried on the next page.

How do I reproduce the undetected case to see what shoppers get?

You cannot force it with a query parameter, since ?geobeacon=XX forces a country rather than removing one. Turn on the embed's debug setting and watch the console: a visitor with no country logs a decision with reason undetected and nothing else happens. To confirm the rest of the flow works, use ?geobeacon=DE or another code to force a detected country.