Set up a Shopify geolocation popup in ten minutes
By Beacon Wave Studio · · 7 min read
Most geolocation setups fail in one of two boring ways: the app is on but the theme embed is not, or the embed is on but there is no rule for the country being tested. Neither is a bug, both waste an afternoon. This is the setup order we recommend for GeoBeacon, with what each screen is for and the one test that proves it works, so the afternoon becomes ten minutes.
Before you start, you need at least one active market in Shopify besides your primary one, or another storefront URL to send people to. GeoBeacon decides where visitors go; Shopify's Markets decides what they see when they get there.
Step 1: Rules, which countries go where
After installing, the app opens on the Rules page. A rule is a list of countries and a destination: either one of your markets, or a URL on another site. There are two ways to fill the page.
- Generate rules from markets. The Your markets panel on the right lists every active region based market with its country count and domain. The button under it creates one rule per market, with the target set to Detected country and the label set to the market's name, and adds each market's domain to the known hosts list at the same time. For a store whose markets already describe where people should shop, this is the whole step.
- Add rule. For anything the markets do not say: a country you want to send to a distributor's website, a group of countries that should see one specific market, or a single Detected country catch-all that covers everyone, which the detected country post argues is the simplest setup of all. Type two letter country codes separated by commas (EU stands for the European Union and * for everyone else), pick the target, and leave the language field empty unless you have a reason to force one.
Rules are read top to bottom and the first match wins. A banner headed Overlapping rules appears if a country is in two enabled rules; fix it before moving on. A second banner, GeoBeacon is switched off, is expected at this point and is the reminder for step 4.
Step 2: The theme app embed
GeoBeacon runs on your storefront as a theme app embed, the mechanism Shopify built so apps can add a script to a theme without editing its files (the theme app extensions documentation describes it). Until the embed is on, nothing you do in the app reaches a visitor.
The Help page has a link labelled Open the theme editor that opens your current theme with GeoBeacon already selected in the App embeds panel; all you do is click Save. Without the link, open Online Store, Themes, Customize, the App embeds icon in the left sidebar, switch GeoBeacon on and save. Repeat for every theme you publish, because the embed belongs to the theme, not the store: a redesign published next month starts with the embed off.
Themes created or duplicated in Shopify's Canvas editor show a Canvas badge on the Themes page and cannot have app embeds yet. Use a theme without the badge, which is covered in the Canvas post.
While you are in the theme editor, the embed has a few settings of its own: colours, corner radius, backdrop, whether the flag emoji shows, a Preview popup in the editor checkbox that renders a sample popup so you can see the styling, and Log decisions to the console for debugging. Texts and position are not here; they are in the app, in step 3.
Step 3: Behaviour, what happens on a match
The Behaviour page in the app holds everything that is not a rule. Go through it top to bottom.
- Mode. Popup asks the visitor; redirect moves them without asking. Start with popup. The mode comparison explains when redirect is the right call.
- Remember the visitor's choice for. Days. The default is 30, which means a visitor who clicks Stay here is not asked again for a month. Zero asks on every visit, with a thirty minute grace period so the popup does not reappear on every page.
- Also switch language. On by default. When the destination market offers the visitor's browser language, the switch includes the language.
- Ignore bots and crawlers. Leave it on. It keeps Google, social previews and monitoring tools on the page they asked for.
- Popup texts. Title, message, the accept button and the stay button, plus the position: centre, bottom or top. The defaults read Shopping from {country}? and Go to the {target} store, where the placeholders are filled with the visitor's country and the rule's label. The copy examples post has wording for different kinds of store.
- Exclusions. Paths where the script stays quiet, one per line. Checkout, cart, account, password and app pages are always excluded, so this is for your own additions such as a wholesale page.
- Your other store domains. Filled for you if you generated rules from markets. Visitors arriving from a listed host already chose a store and are left alone.
Save. If anything you typed is outside the app's limits, a banner lists what was corrected and what was refused; the saved state is always a valid one.
Step 4: Switch it on
At the top of Behaviour is the switch labelled GeoBeacon is on. Flip it and save. The app points out that there are two switches, this one and the theme embed, and both must be on. The app switch is the one to use when you want to pause GeoBeacon for a day: it stops every decision while leaving the embed, the rules and the texts in place.
Step 5: Test without a VPN
Open your storefront in a normal browser window and add ?geobeacon=DE to the URL, using any two letter code that one of your rules covers. GeoBeacon treats that page view as a visitor from that country, ignores any remembered choice, and writes nothing back, so your own browser is unchanged afterwards. You should see the popup with the right country name and the right target label, or, in redirect mode, land on the destination. Try a second code that no rule covers and confirm that nothing appears. Then try ?geobeacon=off, which disables GeoBeacon for that one page view.
If a test shows nothing, turn on Log decisions to the console in the embed settings and read the reason: the decision log post lists every one. The two most common at this stage are country-not-offered, meaning the market for that country is not active in Shopify, and a disabled embed, meaning step 2 was saved on a different theme. The testing post goes further, including how to test from a real device.
What to check in the first week
- Visit the Rules page once: a new Overlapping rules banner means someone added a rule that conflicts with an earlier one.
- Add any new market you activate. A Detected country catch-all covers it automatically; fixed rules need Generate rules from markets pressed again.
- Watch your own analytics for the destination markets. If visitors from a country keep choosing Stay here, the market may be missing something they want, which is a Shopify question rather than a GeoBeacon one.
- Publish a new theme? Enable the embed on it first. It is the single most common reason a working setup stops working.
That is the whole setup. Rules, embed, behaviour, switch, one test URL. GeoBeacon does not add a server call to your storefront, so there is nothing to monitor afterwards beyond the rules themselves.
Frequently asked questions
Do I need to add code to my theme to set up GeoBeacon?
No. GeoBeacon is a theme app embed. You switch it on in the theme editor under App embeds and save; nothing is pasted into theme files, and switching the embed off removes it completely.
In what order should I do the setup steps?
Rules first, then the theme app embed, then the GeoBeacon is on switch under Behaviour. Doing it in that order means nothing is shown to visitors until the rules and texts are ready, and the test URL works from the moment the embed is saved.
Why does nothing happen on my own storefront after setup?
Usually because your own country has no rule, or because you already answered a popup and the choice is remembered. Add ?geobeacon=DE (or any country code with a rule) to a storefront URL to be treated as a visitor from that country; nothing is remembered in that mode.
Should I start with popup or redirect mode?
Popup. It leaves the choice to the visitor, which is what Shopify's guidelines ask for, and it is safer for search traffic. Switch to redirect mode later, for specific stores and reasons, once you have watched the popup work for a while.