Solved

IP/country mapping of website's visitors

Posted on 2013-01-03
5
611 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:Chris Sandrini
Chris Sandrini 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

The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

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.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
Suggested Courses

626 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