Shopify geolocation redirect loop: 5 causes and the fix

A Shopify geolocation redirect loop looks dramatic: the page flickers, the URL keeps changing, and the shopper never sees a product. Merchants describe it as "the country redirect keeps redirecting" and blame whichever app they installed last. In practice a Shopify Markets redirect loop with a translation app, or between two stores, is almost always one of five configuration problems. This article goes through each cause, how to confirm it in your browser, the manual fix, and how GeoBeacon is built to avoid it.

How to see what is happening

Before changing anything, open the storefront in a private window with the developer tools open, go to the Network panel and tick "Preserve log". Reload the page. A loop shows up as a repeating sequence of document requests, each one either a 301/302 response or a full page that immediately requests another page. Write down the URLs in order. The moment the sequence repeats, you have found the two participants; everything below is about deciding which of them should stop.

Cause 1: two redirectors fighting

Shopify has its own redirect. Under Online Store > Preferences > Automatic redirection, the Country/region setting detects the shopper's location and, for markets with a dedicated domain, subdomain or subfolder, sends them to the URL of their resolved market. Shopify's documentation on localization for markets adds that this happens on the first page of a visit and that a preference the customer set manually is respected afterwards. Now install a geolocation app with a rule that sends the same shopper somewhere else, and you have two systems with different opinions. Shopify moves the visitor to example.com/en-ca, the app moves them to ca.example.com, the Canadian store has Shopify's redirect turned on as well, and round it goes.

This is not hypothetical. One Cozy Country Redirect reviewer on the app's one- and two-star review page wrote on July 1, 2021 that they were "using the app on a Shopify Plus store with automatic redirection turned on" when things went wrong. The fix is a decision, not a setting: pick one system to own country routing. If every destination is a Shopify Market with its own domain or subfolder, Shopify's setting may be all you need. If you route to separate stores or want a consent popup, switch Shopify's setting off and let the app do it.

Cause 2: a translation app that also redirects

Translation apps commonly offer "redirect visitors to their browser language". That feature rewrites the URL to a language path such as /fr. A geolocation app that redirects to a country or a market then sees a page it did not expect and acts again, often landing on the market's default language, which the translation app promptly corrects back. The oldest low-star Geo:Pro review on its review page (April 30, 2020) describes exactly this: a bilingual store that "ended up going in a reload loop forever together with my translation app."

Manual fix: give one app the language decision. Either disable the translation app's language redirect, or configure the geolocation app so it never changes language and only changes country. Then test with a browser whose language differs from the destination market's default, because that is the combination that loops.

Cause 3: the destination sends the visitor back

When a rule sends German shoppers from your main store to a separate EU store, the EU store needs to know that this shopper has already been routed. If it runs its own geolocation rules and they say "Germans go to the main .com store" because that is where the German market lives now, the visitor bounces between domains. The same thing happens when the EU store's Shopify automatic redirection resolves the shopper's country to a market that lives on the .com domain. Redirect loops between two stores are almost always a rule on the second store that nobody remembers writing.

Manual fix: on every destination store, list the hosts of your other stores and make sure nothing redirects visitors who arrived from them. The referrer header tells you where a shopper came from; a redirect that ignores it will bounce.

Cause 4: nobody remembers the shopper's choice

A well-behaved redirect acts once. A badly behaved one evaluates every page view from scratch, so a shopper who clicked "Stay on this store", or picked a different country in the theme's selector, gets pushed away again on the next page. From the shopper's point of view the store "keeps redirecting" even though there is technically no loop. Shopify's own country selector saves the preference and uses it on later visits, as described in the localization documentation above; an app that redirects with its own logic and never stores a decision undoes that.

Manual fix: look for a "remember choice", "cookie duration" or "ask once" setting in the app and switch it on. If the app has no such setting, it will keep interrupting returning customers; that is a reason to change apps rather than something you can configure away.

Cause 5: an update or a duplicated script

Redirects that worked for years and then break usually changed on the vendor's side. A Cozy Country Redirect merchant wrote on November 26, 2022 that "the update has now scrambled the languages and checkout" just before Black Friday. On your side, the common equivalent is two copies of the same script: an old snippet pasted into theme.liquid years ago plus the app's new theme app embed, each redirecting independently. Shopify's theme app extension documentation explains why modern apps use embeds: merchants do not edit theme code, and the app's assets are versioned and served by Shopify.

Manual fix: search your theme code for the app's name or script URL, remove hand-pasted copies, and keep only the app embed in the theme editor. Then clear the site data for your domain, because the old script may have left cookies that the new one interprets differently.

How GeoBeacon avoids the loop

GeoBeacon's storefront script is a single theme app embed, and its decision logic is a small pure function with a short list of reasons to do nothing. Each of the five causes maps to one of them:

  • Already there. If the shopper is browsing the country the rule points to, or is already on the target domain, GeoBeacon does nothing. That is what stops the ping-pong in causes 1 and 3.
  • Came from your own store. You list your other store domains in the Behaviour settings ("Your other store domains"); a visitor whose referrer is one of them has already chosen a store and is left alone. Generating rules from your Markets fills this list in for you.
  • Remembered choice. Whether the shopper accepted, declined or was redirected automatically, the decision is stored in their browser's local storage for the number of days you set. Setting it to zero still keeps the choice for about 30 minutes so a popup cannot reappear on every page. Test visits with ?geobeacon=XX ignore and do not write this memory, so testing never pollutes a real shopper's state.
  • Language only when offered. A market rule can switch language, but only to a language that market actually publishes; otherwise GeoBeacon leaves the language alone. Switching is done through Shopify's own localization form, the same request the theme's country picker sends, so Shopify records the preference and your theme, your translation app and GeoBeacon all see the same country and language.
  • Out of the way when it should be. Checkout, cart, account, password and app-proxy pages are always excluded, crawlers are ignored, and the theme editor never triggers a real redirect. ?geobeacon=off disables the embed for a single page view while you debug something else.

What GeoBeacon cannot do is stop another app or Shopify's own setting from redirecting; the "pick one owner" advice above still applies. Our guide to country redirects that do not hurt SEO covers which owner to pick for each domain layout, and Markets vs separate stores covers the multi-store case where cause 3 lives. You can see the full flow on the GeoBeacon landing page.

Frequently asked questions

Why does my Shopify store keep redirecting between two countries?

Two things are each trying to put the shopper somewhere different, and neither remembers that the other already acted. The usual pairs are Shopify's own automatic redirection plus a geolocation app, a geolocation app plus a translation app that also redirects, or two stores whose redirect rules point at each other. Turn off one redirector per hop and the loop stops.

Can a translation app cause a redirect loop?

Yes, when the translation app redirects to the visitor's browser language (for example /fr) while the geolocation app redirects to a country or market whose default language is different. Each redirect changes the URL the other one reacts to. Keep exactly one of them in charge of language, or let the geolocation app switch to a language only if that language is offered in the destination market.

Does GeoBeacon redirect on every page view?

No. GeoBeacon does nothing when the shopper is already browsing the target country or the target domain, when a visit arrives from one of your other store domains, on checkout, cart and account pages, when the shopper's earlier choice is still remembered in their browser, and when Shopify cannot tell where the shopper is. Only a first visit that matches a rule triggers a popup or redirect.

Should I use Shopify's automatic redirection and a geolocation app at the same time?

Not for the same job. Shopify's setting under Online Store > Preferences already redirects shoppers to the domain, subdomain or subfolder of their market. Use an app when you need something Shopify does not do, such as sending countries to a completely separate store, showing a consent popup on EU country domains, or writing your own message. If you keep both, make sure they agree on where each country goes.

How do I test the fix without a VPN?

With GeoBeacon, append ?geobeacon=DE (or any two-letter country code) to a storefront URL to simulate a visit from that country, and ?geobeacon=off to switch the embed off for one page view. Watch the Network panel of your browser's developer tools for the chain of redirects; a healthy setup shows one hop and then stays put.