But the advantages outweigh the disadvantages. As a developer you need to track down your visitors IP address this way you may know the origin of your user and how can you improve your service by just knowing their location. This is an important factor to consider when doing a marketing campaign to your users. By just knowing their IP address you will know what to target, where to target and when to target.
On this tutorial we will provide you a simple code snippet that you can easily paste on your website source code and it will work automatically. You don’t need to rework any code it; you may remove my website link but that’s up to you. Putting it there would be a good idea for my backlinking purposes.
Here's a full code demoDEMO
Pros and Cons
- This method is free of use. Unlike most of the GEO location IP services which requires upfront payment to use their API - this one doesn't
- Very easy to use. Coder friendly and does not require a lot of work.
- Kinda slow reponse. When you notice the IP address does not displayed immediately when the page loads.
- Limited use, like most of the IP services that you can use for free - this one has its limitation as well.
- You can only use the IP address variable. Most of the IP services provides more data such as the Country, Region, City, Currency and more. With ipify you can only use the IP data.