Any way to detect the real customer's country code in the storefront?

I have a theme app extension, and I noticed that Shopify will give you the primary country code if it detects that you’re navigating from any country outside your available markets (via liquid’s localization.country.iso_code or javascript window.Shopify.country).

For example if your markets are configured to only support US and CA, and you navigate in the store from France, both liquid and javascript variables will fallback to the US.

Is there any way to detect that the customer was actually navigating from France without needing to implement an ip api or something similar?

Any insight is appreciated!

Not sure if helpful but take a look at Browsing Context Suggestions:

1 Like