Géolocalisation des utilisateurs : comment obtenir la position actuelle ?

Sommaire
privacy-first

La géolocalisation utilisateur désigne une latitude et une longitude approximatives décrivant la position géographique d'un appareil — ordinateur de bureau, laptop, smartphone ou tout autre objet connecté. Pourquoi est-elle utile dans les applications web pour améliorer l'expérience de navigation ? Parce qu'elle permet, par exemple, de sélectionner automatiquement le magasin le plus proche ou d'afficher des informations personnalisées en fonction de la localisation.

Pour obtenir la position d'un appareil, les applications et sites web s'appuient généralement sur les capacités de géolocalisation intégrées au système d'exploitation ou au navigateur. Mais accéder à la position actuelle des utilisateurs implique également de respecter les réglementations en matière de protection de la vie privée. Cet article explique comment cela fonctionne avec Woosmap Geolocation API et son approche par géolocalisation IP.

Qu'est-ce que la géolocalisation par l'appareil ?

Selon le W3C, une « API de géolocalisation » définit une interface de haut niveau permettant d'accéder aux informations de localisation associées à l'appareil qui héberge l'implémentation.

Lorsqu'un utilisateur ouvre une application ou un site web géolocalisé, une fenêtre modale s'affiche pour lui demander de partager sa position. S'il l'autorise, le navigateur ou l'application collecte les informations disponibles depuis toutes les sources de localisation : GPS, bornes Wi-Fi à proximité, antennes relais et adresse IP. Ces données sont ensuite transmises au fournisseur de service de géolocalisation par défaut pour enrichir sa base de données participative.

Les principaux fournisseurs de services de géolocalisation sont :

  • Google Location Services pour les appareils Android et les navigateurs Chrome ou Firefox.
  • Apple Location Services pour les appareils iOS et le navigateur Safari.
  • Windows Location Services pour les navigateurs Microsoft.

Le service retourne un objet de localisation, éventuellement associé à un rayon ou à une précision autour de cette position.

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

How collecting geolocation data can comply with privacy standards?

Collecting and processing user Geolocation Data enable to gain a very accurate overview of user habits and patterns. But the built profiles may include highly sensitive categories of data. Especially if you are able to get current location data. That is why since May 26, 2018, the GDPR Regulation has significantly altered how providers of geolocation-based services can gather location from users.

How to manage privacy issues with user geolocation?

To address such changes, we’ve developed an API to leverage the location of your users. Woosmap Geolocation API is focused on IP Geolocation. This means that it can lookup the geolocation of an IP address. 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 the background process as long as you are aware of their IP addresses.

Knowing the current location of users opens up new opportunities to drive your online business.

What is the Woosmap Geolocation API?

This 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 includes the city field, we display nearby stores. Otherwise, we zoom to the country level.

The benefits of Woosmap Geolocation IP

Respect privacy with user geolocation

Our API doesn’t reveal users’ personally identifiable information. Because Woosmap’s approach to user geolocation is non-invasive. We only process the user’s anonymous IP to return an approximate location.

We don’t store any information in cookies and we don’t gather any information relative to the user device. Therefore, based on the rulings of the European data protection authority, 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 study 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.

privacy-first

À mesure que davantage d'utilisateurs refusent de partager leur localisation, Woosmap Geolocation API peut faire toute la différence !

Exemple pour votre IP

Votre IP identifiée est : 113.0.0.0

Voici un exemple d'appel à Woosmap Geolocation API en JavaScript. La position récupérée est utilisée pour générer une carte statique Google.

Get more accuracy

The API Response provides an approximate accuracy radius, from 1 to 20 kilometres, 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 (more than 20 kilometres). Compared to the user Geolocation returned from the built-in browser geolocation capability, it is less accurate, but it has the potential to be much more broadly applied.

Woosmap Geolocation API use cases

With user geolocation based on Woosmap Geolocation API, you can provide a better browsing experience to your users. Because customers can directly benefit from** content customisation that respects privacy regulations. Ip lookup geolocation also contributes to the prevention of online fraud and improves analytics** to build more relevant marketing campaigns.

Content customisation

Online businesses need to provide relevant and personalised content for better visitor engagement. The first personalization that comes to mind with user geolocation 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 optimised 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, Marketers 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 organised by region for an email campaign.

Regulations compliance

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 where they sell their products and services.

Our Geolocation API can help. Because 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 user geolocation is 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 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).

privacy-first

Vous avez probablement déjà vu ce message sur certains sites : «Ce contenu est bloqué dans votre région». Les médias numériques sont particulièrement concernés : vidéos, musique, e-books sont presque toujours soumis à des droits numériques ou à une censure par pays. Avec Woosmap Geolocation API, vous pouvez autoriser ou restreindre l'accès à vos contenus selon le pays des visiteurs.

Prévention de la fraude en ligne

Connaître la localisation de vos utilisateurs vous aide à confirmer leur identité et à lutter contre l'usurpation d'identité en ligne. Dans une approche plus proactive, vous pouvez bloquer tout accès depuis une zone identifiée comme à risque. Woosmap Geolocation API permet également de détecter un écart entre le pays de facturation et le pays de l'acheteur, et de signaler la transaction pour une vérification manuelle.

Améliorer l'analyse des données

L'analyse des comportements utilisateurs est un levier efficace pour des actions marketing performantes. Elle joue un rôle important dans l'évaluation des résultats de vos campagnes. En ajoutant un contexte géographique à vos données, vous pouvez segmenter votre audience et approfondir votre compréhension des comportements clients. Vous identifiez ainsi les régions à fort et faible engagement, et pouvez adapter vos actions marketing en temps réel. La couche de géolocalisation s'intègre à chaque composante de votre activité marketing pour déclencher des actions alignées sur des métriques du monde réel.

Conclusion

La géolocalisation est un levier concret pour la performance en ligne. Connaître la localisation de chaque visiteur contribue directement à répondre à vos objectifs business, notamment :

  • Personnalisation du contenu
  • Conformité réglementaire
  • Prévention de la fraude en ligne
  • Enrichissement de l'analyse utilisateur
  • Ciblage publicitaire

Si vous souhaitez implémenter cette solution de géolocalisation pour votre activité : Créez un compte Woosmap gratuit (vous obtiendrez une clé API pour chacun de vos projets).

Nous sommes toujours disponibles pour vous aider sur le code ou toute autre question. N'hésitez pas à nous contacter.