In determining the geography of a person, we focus on different signals starting from the most accurate. The scheme is the same for mobile applications and browsers, but depending on the presence or absence of each of the sources, we get different accuracy:
1. The most accurate source is the current GPS signal from the user. For example a user opened a mobile application and shared geolocation. If the GPS signal is absent, we focus on the wi-fi or the nearest cell towers. In some cases we can determine the coordinate of the static IP-addresses so that we can accurately determine the city even when the user logs in the browser.
2. If there is no fresh signal then we try to determine the city or region by the points at which the user regularly happens (home to work). If all these points are in the same city - we consider that the user is from this city. The points themselves are regularly recalculated.
3. If we are unable to determine c. 1 and c. 2, then only the region of Russia from which the request came from can be accurately determined by the IP-address. At this level, we no longer distinguish between residents of the administrative center and residents of the region. For mobile IP-addresses, it is impossible to determine the region within the country; all belong to Russia.
4. For those users for whom we can not determine the region by IP-address - we are trying to see from what the last known region the user went to the network and use, in case of the ip-address still belongs to Russia.
5. If we could not determine the geolocation of the user with accuracy to the region, we determine from which country he is.
, regions are listed as codes: use the table of correspondence: Correspondence table: id - name of the region