Help with country redirect script

New Member
5 0 0

I would like to redirect traffic from certain countries to another store.

I added the script from here, under “Redirect to another store” into the end of my theme.liquid file. However it is not working. Please help!

<script> jQuery.ajax( { url: '//', type: 'POST', dataType: 'jsonp', success: function(location) { // If the visitor is browsing from Canada. if (location.country_code === 'CA') { // Redirect him to the Canadian store. = ''; } } } ); </script>

Shopify Expert
36 1 8

Please be reminded that free geo ip services usually have quota on the number of request. Another recommendation is not to "force" redirect to another website base on your customer's country, this is adhered to Google guideline and running Google Ads would probably get rejected. Instead, we should show a banner/pop-up to let customer confirm whether to switch the site.


We have an app doing the redirection base on customer's ip location, check out GeoIP Redirect Manager:


Find more about apps for your store.
★ Geo IP Redirect Manager:
★ Connected Inventory:
★ Theme Save:
We're really good at consulting and customization:

Shopify Partner
22 0 0

An easy way to accomplish this would be through the Country and Currency Redirect app