Copy link to clipboard
Copied
I can see under liquid documentation I can modify the script below and edit the dom using jquery. Not sure if this is the best approach.
<script> window.location =
{% if globals.visitor.country == 'AU' %}
"/au"
{% elsif globals.visitor.country == 'US' %}
"/us"
{% elsif globals.visitor.country == 'GB' %}
"/gb"
{% else %}
"/store-unavailable"
{% endif %}
</script>
Hello Nik and Jose,
Sorry for the late reply, unfortunately as far as I know, the mapping between the IPs and country codes are out of our control.
But you could do an ajax request to freegeoip.net if you do not have more then 10k requests per day.
For example (I googled an IP from Puerto Rico): http://freegeoip.net/json/66.50.137.144
You'll get a JSON that you can use to redirect your visitor if from PR
Hope it helps,
Stoiky
Copy link to clipboard
Copied
I also looking for the same solution. But BC not reliable if interested for Puerto Rico market. IT is redirecting to US en English. I am looking for another solution. Let me know if you have come with something else. I notice there are API available to engage this task in a fee basis. One of them is IP Geolocation online API . But I have not use them personally and I am sure there are others out there.
Good luck
Copy link to clipboard
Copied
Hi Nik,
What do you mean when you say you want to reorder page content?
From your snippet I see you want to redirect your visitors, or is that just an example?
Thanks,
M.
Copy link to clipboard
Copied
I have 4 pages , 54 subdomains.. es.pr.mipermiso.com , en.pr.mipermiso.com, en.us.mipermiso.com and es.us.mipermiso.com I have set up each one to Puerot RIco Spanish, English and US Spanish and English. But wheever a client brose from Puerto Rioc, the site allways land in the US.mipermiso.com
Copy link to clipboard
Copied
Hello Nik and Jose,
Sorry for the late reply, unfortunately as far as I know, the mapping between the IPs and country codes are out of our control.
But you could do an ajax request to freegeoip.net if you do not have more then 10k requests per day.
For example (I googled an IP from Puerto Rico): http://freegeoip.net/json/66.50.137.144
You'll get a JSON that you can use to redirect your visitor if from PR
Hope it helps,
Stoiky