How to program different welcome pages based on country IP?

0

2

How can I create different landing pages based on the country of the IP? For example, people from USA should get landing page 1 and people from Spain should get landing page 2.

Jonas L. Nilssen

Posted 2011-10-15T15:46:37.007

Reputation: 4

Answers

1

use http://freegeoip.net/json/64.34.119.12 64.34.119.12 being ip address, you will have not only country but also those field:

    public string ip { get; set; }
    public string country_code { get; set; }
    public string country_name { get; set; }
    public string region_code { get; set; }
    public string region_name { get; set; }
    public string metrocode { get; set; }
    public string city { get; set; }
    public string zipcode { get; set; }
    public string latitude { get; set; }
    public string longitude { get; set; }

asdf_enel_hak

Posted 2011-10-15T15:46:37.007

Reputation: 6 030

0

Try this php code

  <?php  $ip = $_SERVER['REMOTE_ADDR'];
    $json = file_get_contents("http://api.easyjquery.com/ips/?ip=".$ip."&full=true");
    $json = json_decode($json,true);
    $timezone = $json[localTimeZone];?>

pckabeer

Posted 2011-10-15T15:46:37.007

Reputation: 616

0

Page tab is really just regular web page loaded in iframe within Facebook Page.

Default landing tab can only be defined to all non fan visitors of Facebook, but you can use country and locale for user part of signed_request passed to Page tab application canvas and provide different content for users from different locations/language-groups.

P.S. Mind that you cannot really ensure that country passed by Facebook is real user country, so use detection of country based on IP.

Juicy Scripter

Posted 2011-10-15T15:46:37.007

Reputation: 23 311