• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

I want to reorder page content based on country location does anyone have a solution for this?

New Here ,
Mar 25, 2015 Mar 25, 2015

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>

Views

667

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Employee , Nov 26, 2015 Nov 26, 2015

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

Votes

Translate

Translate
Community Beginner ,
Nov 11, 2015 Nov 11, 2015

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Nov 11, 2015 Nov 11, 2015

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 11, 2015 Nov 11, 2015

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Nov 26, 2015 Nov 26, 2015

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines