User Geolocation Tracking and Statistics

Remember my old project for one Russian company? The NMCK Calculator? Well, not so long ago, I’ve been asked to make a simple web app for processing the log data from it and generating some reports with statistics.

Map of the clients active over the Jan 2017

Map of the clients
active over the Jan 2017

When we were making the “Calculator” (a subscription-based web app for state funded organizations, that allow users to search contracts and generate some docs), we’ve also added some logging in it (database-based), to keep track of some of the user actions.

Back then, we didn’t do much with that data, though – one could check it in the admin panel and search through it, but it wasn’t very informative or handy.

Some user stats (private data has been blurred)

Some user stats
(private data has been blurred)

Now I’ve made some simple, but fun app that processed the log data and displayed structured info on them.

Admin could check the report for some time period – that would display all the users that were active in that period, or check the report on some particular user – that would display data on that user only.

Some users were from pretty big companies, with offices in several cities

Some users were from
pretty big companies,
with offices in several cities

Among the other, it displayed: date and time of the last user activity, what did he or she searched in the contract base, and the list of IP addresses from which the user connected to the app.

Moreover, the IP list were grouped by their geolocation (country, province\state and city) and contained the level of activity from each location (how many different actions the user made from that place in the selected period).

The geolocation was also used to plot some markers on the world map. I’ve used Leaflet and OpenStreetMap for that, since their Terms of Service were the most permissive and allow using them in the “closed”, private projects.

It was actually interesting – and impressive – to see how many users from dozens of different cities and towns were using the app, even just over the last month! I’ve knew that there should be a lot of clients, but this map showed me that we had clients all over the country, and even abroad.

I’ve also made a simplified, anonymized version of this app as a widget for the website, since the client wanted to show the map of the existing clients to the potential clients. The widget was set to update every 15 minutes (to reduce the server load) and showed the client map and some stats for the last month (~30 days) activity, without showing the real usernames (for privacy).

The management has found another interesting way of using the app. They could easily find the users that were clearly giving access to some other organizations - and violating the Terms of Service.

Web app like that is very simple and easy to make - yet has a lot of uses.