Solved

IP/country mapping of website's visitors

Posted on 2013-01-03
5
609 Views
Last Modified: 2013-01-19
I'm currently looking for ways to automatically identifying my website's visitor's country location through their originating IP address using JavaScript/jQuery.  I'm sure there is a way but I'm not sure how.
0
Comment
Question by:snajalm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 12

Assisted Solution

by:sivagnanam chandrakanth
sivagnanam chandrakanth earned 125 total points
ID: 38742779
Just create a php file with the following code:

echo ' [ { "ip" : "$_SERVER['REMOTE_ADDR']" } ]';

and then ping that with get JSON

see this

http://stackoverflow.com/questions/1641868/how-to-get-client-ip-address-using-jquery
0
 
LVL 11

Assisted Solution

by:un1x86
un1x86 earned 100 total points
ID: 38742784
Hi

You could make use of the geoplugin api.

http://www.geoplugin.com/quickstart#how_to_geo-localize_your_visitors

For instance

http://www.geoplugin.net/json.gp?ip=<your ip here>&jsoncallback=<suitable javascript function in your source>
0
 
LVL 36

Assisted Solution

by:Loganathan Natarajan
Loganathan Natarajan earned 75 total points
ID: 38742786
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 38742905
I don't think you can do it with just JavaScript/jQuery.  Here's an API I use with PHP on several sites.  http://dev.maxmind.com/geoip/geolite
0
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 200 total points
ID: 38742909
It looks like they do have a javascript based service.  http://dev.maxmind.com/geoip/javascript
0

Featured Post

Report: Liquid Web beats Amazon, Rackspace & More

A study by performance analyst firm Cloud Spectator finds that Liquid Web beats rivals Amazon, Rackspace and DigitalOcean when it comes to website and cloud application performance.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question