Why is everyone afraid of Geolocation?
Do you know the UC browser?
UC Browser, the fourth largest browser App in the world with more than 500 million downloads on Android alone, was recently revealed to collect data and send it back to the server, even in “traceless mode”.
Data security researcher Gabi Cirlig found that the UC browser, whether on Android or iOS, keeps track of the user’s web history, detailed computer data, and even searches for content and location. UC Browser gives each user a unique ID code to help identify each user. The survey also found that by focusing on IP location, they could even infer users’ geographical location to specific neighborhoods and streets.
All this attention continues in the browser’s built-in “traceless mode,” where data is sent to UC Browser’s servers in the United States. It is impossible to know how the data is being used, but GabiCirlig points out that it is clearly a deliberate effort to collect data, regardless of privacy concerns.
UC browser is the fourth most popular browser App on mobile phones with a market share of 2.36%, following Chrome (63.03%), Safari (23.94%), and Samsung Internet (5.86%). It is popular in some Asian countries.
Where is Geolocation applied
1) Improve the user experience
Most businesses today are taking personalization to a whole new level. In addition to monitoring customers’ purchasing behavior to make reasonable product suggestions, they will also provide customers with location-based delivery services.
2) Accurate advertising and marketing
Now there are so many online stores that it is difficult to attract customers’ attention by natural selection alone. So selling is quite a challenge. Many stores are now adapting to this change by using geolocation to increase conversion rates. At the same time, some businesses are trying to ramp up their spending on social media advertising to get an edge on their rivals.
However, location-based marketing, like location-based marketing, is impossible without the help of powerful solutions like IP geolocation APIs.
Geolocation is now becoming a part of most People’s Daily lives. Whether it’s improving your purchasing experience or making your life easier, we should not ignore that Geolocation is a way to give away your privacy. So what is the Geolocation API?
Geolocation API
What is geolocation API in HTML5?
Geolocation is one of the most important features of HTML5. It provides the ability to determine the location of the user, which can be used to develop location-based applications. Based on this feature, location-based service applications can be developed. Before obtaining the location information, the browser will first ask the user if they want to share their location information, and only after the user agrees to use it.
Html5 obtains location information through the Geolocation API, using its getCurrentPosition method, which has three parameters, namely, the callback function executed when the location information is successfully obtained, the callback function executed when the location information is failed, and the optional attribute configuration item.
How does the HTML5 Geolocation API work?
Depending on the browser you’re using, the HTML5 Geolocation API implementation depends on a number of factors, including your public IP address, cell tower ID, GPS information, a range of wireless access points, signal strength, and MAC address (Wifi/ Bluetooth).
It then passes that information to a location service provider over HTTPS and attempts to match the information with a number of relevant databases. It then returns an approximate location that is passed to the code via javascript callback functions.
- Which methods are provided by Geolocation API?
1) access to current location: navigator.geolocation.getCurrentPosition
After the user’s permission is obtained, the user’s information can be obtained using the getCurrentPosition method under Geolocation.
Java code:navigator.geolocation.getCurrentPosition( getPositionSuccess , getPositionError )
In the above code, the first argument is the callback to successfully get location information, which is the only required argument for the method; The second parameter is used to catch errors in obtaining location information, and the third parameter is the configuration item.
When the browser successfully retrieves the user’s location, the first function type argument of getCurrentPosition is called, and a Position object containing the data returned by the browser is passed to the called function.
Java code:
function getPositionSuccess( position ){
var lat = position.coords.latitude;
var lng = position.coords.longitude;
document.write(” your location: longitude “+ lat +”, latitude “+ LNG);
}
The Position object contains information about the user’s geographical location, and the coords subobject below this object contains information about the user’s latitude and longitude. Latitude can be accessed through position.coords.latitude, and position.coords.longitude stores longitude information. The more accurate the user’s location information, the longer the decimal point after the two numbers.
In fact, in Firefox, the Position object is accompanied by another Address object that contains the name of the country, city, and even street at that latitude and longitude.
2) continue to obtain location: navigator.geolocation.watchPosition
3) remove continued access to location: navigator.geolocation.clearWatch
When does Geolocation become invalid?
Geolocation is not about watching you all the time. If your users are traveling to a rural location, Geolocation becomes less reliable.
Because the network signal in remote places is not very good, for the positioning technology that depends on IP address and signal, even if you turn on wifi, if the user is not near the WIFI access point, geolocation service will still try to use other methods to locate the user.
But it’s hard to triangulate in remote locations, and if the browser doesn’t use GPS, accuracy will suffer.
Also, geolocation isn’t as good when you’re on the move. The Geolocation API provides a more precise location in a static city area. When driving around town, precise location information can be hard to get from a browser.
Is geolocation API free?
The Google Geocoding API is completely free to the average user using Google Maps, but the number and speed of requests it provides are limited. However, if the request rate (QPS) limit is exceeded, the corresponding API returns an error message. If you repeatedly exceed the quota, you will be temporarily blocked from using the API.
So, if you don’t exceed the limit, or if you don’t use your business, the free service is basically enough.
How do I find my geolocation API key?
What is an API key? When the API is called, it is used to sign your request parameters in accordance with the specified rules. When the server receives your request, it will carry out signature verification, which can define your identity and prevent others from maliciously tampering with your request data by some means. These rules take the form of API keys.
So how do you find your Geolocation API key in Google Maps? Open your browser, type https://developers.google.com/maps/documentation/javascript/get-api-key in the address bar, you can open the Google map platform. Of course, if you don’t have a Google account, you’ll need to sign up for one.
Then go to the Google Cloud Platform Console and create a project, select the type of map you want, and click Enable. On the credentials page, click Create Credentials and select the API key. In the dialog box that displays the API key, select the Restricted key to set the browser limit for the API key.
Manually control your geolocation
How can I manually control my geolocation in the browser?
1) Denied access to location
Today’s major browsers, such as Google Chrome and Firefox, follow privacy protocols and ask websites about your location when they want it. When you open a TAB, a pop-up box asks you if you want to accept geolocation, which you can refuse manually if you really mind. It’s worth noting that some sites try to get your information, so pop-ups can be hidden from view.
2) Close cookies
Another way to block site tracking is to clean up cookies on your computer. Because cookies may not only reveal your browsing history and preferences, they may also reveal your geographic information to others. Although cleaning cookies does not solve the root cause of geolocation threats, taking action is more proactive than leaving them alone.
3) Change location from the browser
Have trouble checking your location requests over and over again? You can set geolocation directly in the browser. Internet Explorer, Google Chrome, Firefox, Microsoft Edge, and Safari now support setting access requests directly in the browser TAB.