Back
Discover Woosmap
Get the newsletter
Why and How to Get a User's Geolocation
24/03/2021

-

10 min read
Woosmap Geolocation API

A user’s geolocation refers to an approximate latitude and longitude describing the geographic location of his device, whether that’s a home computer, laptop, smartphone, or any connected device. In web applications, this geolocation is helpful for providing better browsing experience to your users such as automatically selecting the closest store from them or display personalized information relevant to their location. Usually, to gather a device position, we talk about the OS or browser’s built-in geolocation capabilites.

What is Geolocation from Device?

According to the W3C, Geolocation API defines a high-level interface to location information associated only with the device hosting the implementation.

When a user opens a location-aware app or website, a modal popup is triggered to let him share his location. If the location access is allowed, the browser or app gathers information about all available sources of location information including Global Positioning System (GPS), nearby Wi-Fi hotspots, cell towers and IP Address. This information is sent to the default geolocation service provider for augmenting their crowd-sourced database.
The main service providers are:

  • Google Location Services for Android devices and Chrome or Firefox browsers.
  • Apple Location Services for iOS devices and Safari browser.
  • Windows Location Services for Microsoft browsers.

The service returns a location object eventually associated with a radius, or accuracy, around this location.

{
  "location": {
    "lat": 43.7828123,
    "lng": 4.091632
  },
  "accuracy": 20
}

Privacy Issues

Collecting and processing Geolocation Data enable to gain a very accurate overview of user habits and patterns. The built profiles may include highly sensitive categories of data. Since May 26, 2018, the GDPR Regulation has significantly altered how providers of geolocation-based services gather location from users.

To address such changes, we’ve developed an API to leverage location of your users. Woosmap Geolocation API, focused on the IP Geolocation. It can be used in a far broader range of use cases as you are able to query this API in real time when users access your website and app, or in background process as long as you are aware of their IP addresses. It opens up new opportunities to drive your online business.

What is Woosmap Geolocation API

Woosmap Geolocation API, provides the location of your users thanks to the public IP address of their devices. An IP address is an identifier representing a device connected to a network. We’ve built our API upon a database of lookup tables mapping IP Addresses to locations. The API accepts both IPv4 and IPV6 addresses.

A call to the API will give you a formated JSON containing the keys: country_code, country_name, continent, city, region_state, latitude, longitude, accuracy and viewport. The accuracy field represent an approximate accuracy radius, in kilometers, around the latitude and longitude associated with the IP address.

Our Store Locator Widget and Store Locator JS API embed this feature so you can seamlessly integrate with Woosmap Geolocation API in your integration. You’re able to open the widget with an initial state set for displaying the nearby stores. In the following sample, if the returned position include the city field, we display nearby stores, otherwise we zoom to the country level.

Privacy

Our API doesn’t reveal users’ personally identifiable information. It’s non-invasive. We only process the user’s anonymous IP to return an approximate location. We don’t store any information in cookie and we don’t gather any information relative to the user device. Therefore the use of this API doesn’t require the user’s approval. With growing concerns about consumer privacy, people are becoming more selective in sharing their location data. A recent global benchmark study1 about mobile app user permissions has revealed that, on average, opt-in rate for use of location data declined from 9.3 percent to 7.7 percent worldwide.

  2019 Location Opt-In Rate % Change Year Over Year
Northern America 9.7% -25.4%
Northern Europe 4.4% -36.2%
Western Europe 2.1% -61.8%
Southern Europe 7.4% -6.3%
Southern Asia 7.3% -25.5%
Eastern Asia 0.7% -63.2%
Latin America / Caribbeans 20.3% +116%

As more users opt to withhold their consent for sharing location, Woosmap Geolocation API can make a big difference!

Sample for your IP

 

Here is a sample of a Woosmap Geolocation API call using Javascript. The fetched location is used to generate a Google static map.

Accuracy

The API Response provide an approximate accuracy radius, in kilometers, around the latitude and longitude associated with the IP address. This radius is calculated by checking proved locations for given IP Addresses against the data within Woosmap Geolocation Database.
Our API is usually more accurate for broadband IP addresses and less accurate for cellular networks. Compared to the Geolocation returned from the built-in browser geolocation capability, it is less accurate, but it has the potential to be much more broadly applied.

Use Cases for Woosmap Geolocation API

Personalize Content

Online businesses need to provide relevant and personalized content for better visitor engagement. The first personalization that comes to mind is the store selection. Depending on the location accuracy and the coverage of your stores, the closest store could be wisely selected without requiring end user action, and your Store Locator initially focused on the nearby stores.
By combining the user position with your stock data, you may even like to automatically give your users the nearby Click and Collect outlets where a desired product is available.

Worldwide companies that have different stores and website could automatically redirect users to landing pages with suitable language and currency.

The checkout process can be optimized as well. The billing and shipping fields like country or postal code could be pre-populated and tax fees or delivery cost automatically calculated.

Last but not least, Maketers and Advertisers can use this API to show more accurate messages to consumers based on their location. For example, a DIY store might want to show special offers for its next sale to the people who are living in that area. This can be achieved in real time when a visitor arrives on your website, or by building users lists organized by region for an email campaign.

Comply with the Regulations

Every country has its own data privacy laws. The General Data Protection Regulation (GDPR) of the European Union or the California Consumer Privacy Act are perfect examples. These regulations aim to protect the consumers’ personal data. Every company must comply with the regulations of the countries they sell their products and services to.

Woosmap Geolocation API can help. Businesses can use it to know the visitors’ specific locations and submit them the right privacy disclosures, ensuring that they do not violate privacy laws.

But it’s not just a matter of user privacy. Content and Service providers need to comply with region-based legal restrictions such as copyright, digital rights protection or censorship. A good use case could be the gambling market. There are quite a few countries that have banned online gambling. To address this, online betting websites perform a geolocation at the country level to check if the visitor is allowed to access the service (sample screenshot below comes from a denied access to www.pointsbet.com due to country restriction).

Example of an Access Denied due to a country restriction when trying to open a website which is not authorized in the user country.

banned

You may have come across sites that say “This content has been blocked in your region”.
The field of digital media is particularly involved here. Contents like videos, music, e-books are almost always subject to country-based digital rights or censorship. With Woosmap Geolocation API, you can grant or restrict who gets access to your content according to the visitors’ countries.

Prevent Online Fraud

Knowledge of the location of your users can help you in confirming client identity and thus preventing online impersonation and identity theft. In a more proactive approach, you might want to block any access from a location classified as a risky zone. Woosmap Geolocation API can also help to validate the transaction process. For example, orders with a billing country different from the buyer country can be detected and automatically flagged for manual review.
Along the same lines, transactions with a shipping address located far away from the user’s Geolocation might be tagged as fraudulent.

Enhance Analytics

User analytics is a strong tool to drive efficient marketing operations. It plays an important role in understanding the success of your marketing actions. Adding a local context to your data lets you segment and gain deeper insight into customer behaviour. You will be able to better understand regions of high and low customer engagement and drive real time change within your online marketing process. You can integrate the geolocation layer in every components of your marketing activities to trigger measures relevant to real-world metrics.

Final Thoughts

Geolocation is a true key to business success. Knowing the location of every incoming users or visitors strongly contributes to meet your online business needs, including:

pros

Content Personalization

pros

Regulatory Compliance

pros

Online Fraud Preventing

pros

Augmented User Analytics

pros

Targeted Advertising

We provide you with the tailored solution for your particular business requirements : Woosmap Geolocation API.
We’re always happy to help with code or other questions you might have so if you interested in , feel free to contact us.


  

If you want to go further

x

Subscribe to our newsletter

and don't miss a single one of our news

Subscribe to our newsletter

and don't miss a single one of our news