Show IP Address & Geolocation Of Website Visitors Via JavaScript |
Show IP Address & Geolocation Of Website Visitors Via JavaScript Posted: 14 Feb 2018 04:57 AM PST Privacy and freedom are two things no one can compromise for anything. From anonymous web browsing using VPN or proxy servers to anonymous electronic transactions via cryptocurrencies, online freedom is the biggest quest of internet users today. Achieving complete anonymity online is difficult but not impossible thanks to developers working hard to introduce new tools and apps every other day. I am sure you all know how to hide your IP address using a VPN server, Tor browser or any proxy server but what may seem more appealing to you would be understanding how can you find out your website visitor's IP addresses and geolocation using plain client-side JavaScript and HTTP API. What is IP address?IP address stands for Internet Protocol address which is a unique string of numbers separated by full stops that identifies each computer using the Internet Protocol to communicate over a distributed network. IP address is a unique numerical address assigned to your computer by your Internet Service Provider (ISP). Every computer connected to internet has a unique IP and its internet activity can easily be tacked through its IP address. At present you can easily retrieve useful client IP addresses using WebRTC that is supported by browsers such as Firefox, Chrome and Opera. But to fetch full details of a user's IP address there are tons of free services that provide a public HTTP API. These APIs uses a database of IP addresses that are associated to cities along with other relevant information like time zone, region, zip code, latitude and longitude. How To Show Site Visitor IP address and Geolocation?I am using the free HTTP API provided by freegeoip.net site. We will make a simple ajax call to freegeoip to fetch the JSON data and parse JSON as text in plain JavaScript. The data is requested from the server using XMLHttpRequest(). DEMO: A Yellow load bar will appear followed by a table displaying full details of your public IP address and geographical location.
Loading your location details, please wait......... Liked it? Let's learn how to add this cool JS tool to your blogger blog or wordpress blog to show visitors data in real time. You can show this IP table anywhere you want, may it be your blog post, a static page or blog sidebar.
Feel free to use it in your development projects or apps. Do share your queries or feedback in the comment box below. Stay tuned for our biggest research paper on anonymous peer-to-peer electronic currencies i.e. Bitcoin on our coming posts. A lot of exciting tutorials are on its way. :) |
You are subscribed to email updates from My Blogger Tricks. To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google, 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States |
0 comments:
Post a Comment