Geolocation popups and logged-in customers

A merchant in Madrid wrote to us with a sharp question. One of her best customers, logged in, with a Spanish address saved on his account and a dozen orders behind him, opened the store from a hotel in Lisbon and was offered the Portugal market in euros with Portuguese shipping. Why, she asked, does the popup not know who he is? This post answers that for GeoBeacon, explains what Shopify itself does with a logged-in customer's address, and sets out what you can and cannot do about it.

Detection is about the connection

GeoBeacon decides whether to show a popup by asking Shopify for a browsing context suggestion for the current visitor. Shopify answers with the country and language it thinks fit the connection the request came from. The app compares that answer with the country the page is already localized to and with your rules, and shows the popup if a rule matches. Nothing in that exchange carries the customer's identity. The embed does not read whether the shopper is logged in, does not look at the customer object in the theme, and does not know what addresses are saved on the account.

That is not an oversight we intend to fix, for two reasons. First, the saved address is not available to a storefront script in a form that a market decision could use: the theme can see that a customer is logged in and can render their default address in Liquid, but the popup runs after the page is served and makes one decision that has to work identically for guests and account holders. Second, and more importantly, the saved address is often the wrong answer. A customer travelling for a month wants to know what shipping to Portugal costs. A customer who moved and never updated their account wants the country they are in now. The connection is a better guess about where the parcel is going than an address typed years ago.

What Shopify does with the account address

It is worth separating what GeoBeacon does from what Shopify does, because the merchant in Madrid assumed Shopify would switch the market for a logged-in customer. It does not. In Shopify Markets, the market a page is served in is determined by the storefront localization the shopper is browsing with: the country in the URL or the localization selection, which the theme's country selector and GeoBeacon both set through the same form. Logging in does not move a shopper to the market of their saved address, and the account pages themselves are rendered in whatever market the shopper arrived in. The address on file comes into play at checkout, where Shopify calculates shipping and taxes for the destination the customer enters or selects, and where a customer can still pick a different saved address or type a new one.

So the Spanish customer in Lisbon would, without any popup, have browsed in whatever market his link or the default pointed to, probably Spain if he used a saved link, and then checked out with a Spanish address if he wanted the parcel sent home. With the popup, he was offered Portugal because that is where he was, and he could decline. Both are coherent; neither used the account.

What the popup remembers, and where

The other half of the question is why a customer who has already answered the popup sees it again. GeoBeacon remembers an accept or a dismiss in the browser, for the number of days set in the block (or for the rest of the session if you set zero). The record is tied to that browser on that device. It is not written to the customer account, because the storefront has no way to write to the customer account, and it would not help if it could: the decision is about the connection, and the connection changes when the customer does.

The practical consequence is that a logged-in customer on a new phone is a new visitor to the popup, and a customer who clears their browser is too. The remember duration post goes through how to set that window; for stores with many returning customers, a longer window on the same device reduces repeat prompts without pretending to know more than the app does.

Where the popup never appears

Whatever the rules say, GeoBeacon excludes a fixed set of paths: anything under /account, /checkout and /checkouts, /cart, /apps, /tools, /password and /challenge. Those exclusions are built in and sit above the ones you configure. A customer logging in, reading their order history or editing a saved address is never interrupted, and a redirect rule cannot fire in the middle of a checkout, where a market switch would empty or re-price the cart. If you want the popup kept off more pages for account holders, for example a wishlist or loyalty page served by an app under a path of its own, the excluded pages post shows how to add them.

Options if you want logged-in customers treated differently

You cannot make GeoBeacon read the account, but you can shape what the popup proposes so that a travelling customer is helped rather than confused.

  • Prefer suggest over redirect for markets your customers travel between. A suggestion with a clear decline button costs the Spanish customer one tap. A redirect moves him to Portugal prices before he has read anything, and if he wants Spain he has to find the selector.
  • Write the popup copy as a question about shipping, not identity. "Shipping to Portugal? See prices and delivery for Portugal" is true for the traveller and for the local; "Welcome, visitor from Portugal" is wrong for the customer who has ordered a dozen times.
  • Keep the footer selector visible on account pages. Since the popup is excluded there, the selector is the only way a logged-in customer changes market from inside their account. The selector post explains how the two share one choice.
  • Set a remember window that matches your repeat purchase cycle. A store whose customers reorder monthly wants the choice kept for at least that long on each device.

The honest summary for your support team

When a customer asks why the store offered them the wrong country, the accurate answer is: the store suggests the country your connection appears to be in, so travelling, hotel wifi and some mobile networks can change the suggestion; your account and saved addresses are not used for it; you can decline and the store will remember on that device; and your saved address is used at checkout regardless. Shopify documents how markets and localization work in its Markets help pages, and the theme-side mechanics of the localization selection are described in the localization object reference. Neither mentions the customer account as an input, and GeoBeacon follows the same model.

Frequently asked questions

Does GeoBeacon use the customer's saved address to pick a country?

No. It asks Shopify for a suggestion based on the shopper's connection and compares that with the country the page is already showing. Whether the shopper is logged in, and what address is saved on their account, plays no part in the decision, so a Spanish customer browsing from Portugal is treated as a visitor from Portugal.

Why does a returning customer see the popup again on a new device?

Because the remembered choice lives in the browser, not in the customer account. Accepting or dismissing the popup writes a record to that browser's storage for the number of days you configured. A new phone or a cleared browser has no record, so the first visit there is treated as a first visit, even for a customer who has ordered ten times.

Will the popup appear on the account pages or at checkout?

No. Paths under /account, /checkout, /checkouts, /cart and a few other system paths are excluded by GeoBeacon itself and cannot be enabled. A customer managing their orders or addresses is never interrupted, and a redirect can never fire while a checkout is in progress.

Can a logged-in customer end up in a different market from their saved address?

Yes, and that is Shopify's behaviour rather than the app's. The market a page is served in comes from the storefront localization the shopper is browsing with, not from the address on file. The saved address matters at checkout, where shipping and taxes are calculated for the destination the customer actually enters.