App proxy locale redirects

I am having an issue that a customer just brought up where the app proxy page is always being redirected to the US market on the first visit. If you visit their site and then go to the app proxy page, everything works fine. However, if your browser has no session with the store and you go directly to the app proxy page, it will do a 301 redirect to the US market.

I’ve tried looking everywhere for what could be triggering this to happen, and I’m at a loss. The only difference I can see is that requests from other store pages have a referrer URL. Has anyone else experienced this issue?

Hey @DIW, this does sound odd, my hunch is that this might be the shop-level automatic market redirection kicking in.

Can you check if the shop has automatic country/region redirection enabled in Settings → Markets, and confirm whether your app proxy relies on cookies or session data?

App proxies strip all cookies for security, so when users hit the URL directly without an existing session, what I think might be happening is that the shop’s market detection redirects them based on geolocation.

If they do have auto-redirections enabled, if you can ask the merchant to disable automatic redirection if possible to test to see if that’s the issue that might help narrow down the issue. If they do need to keep that auto-redirect on, you should be able to use URL parameters though to automatically direct them to the right country like this:

shop.com?country=DE

Let me know if you encounter any other issues though - happy to help look into this!

Thanks, Alan. I will test that out. It does seem like the automatic redirection might be using the server IP as the customer IP in this scenario. That’s the only place I can see it getting a clue for en-us.

1 Like

No worries @DIW - feel free to ping me here if I can help out further!

Hi @Alan_G, I’ve checked with the shop and they do have automatic redirection on. I have recommended they append the country param for now, as that does stop it from redirecting. It is, however, not good as a permanent solution.

I was also able to test turning off automatic redirect based on customer location and that did stop it from redirecting to the wrong market. It was a bit difficult to find as all the documentation points to Settings > Markets, but it was actually moved to Online Store > Preferences > Automatic Redirection.

It seems like this is a bug that got missed. Is there any way to get the Shopify team to take a look at it?

Hey @DIW :waving_hand: - thanks for following up, glad things are working somewhat for you/your merchant now! Happy to take a look at the proxy geolocation issue for you internally to confirm expected behaviour (and I’ll see if we can update the Help Centre docs as well) - I’ll loop back with you here once I have more info :slight_smile:

Hey @DIW - we’re looking into the Proxy GeoLocation behaviour as a possible issue on our end now. I don’t have a turnaround time to share, but just wanted to touch base to let you know that we are looking into this further.

Awesome, thanks for the update!