In 2014, according to Smart Insights, the number of mobile application users
exceeded the number of desktop users. One of the most popular tools for collecting application statistics on mobile devices is
Flurry . The tool is completely free, available for basic mobile platforms and has powerful functionality. Here are the main indicators that this tool provides:
- the number of new and active users;
- the number of sessions and their length;
- application frequency;
- failure statistics;
- application audience (gender, age, language, geography of use);
- information about product versions and devices;
- events inside the application;
- navigation on screens, etc.
We use Flurry in mobile versions of ICQ. But it does not provide any tools or an open API for collecting statistics for desktop applications. Therefore, we decided to adapt the features of Flurry for the desktop version of our application.

')
A
Flurry SDK for the BlackBerry platform was found on the network. Flurry provides this library on request by email. Integrating with the library for BlackBerry failed, the source codes were also not found. But another way was found.
For the “Mobile Web” application type, Flurry provides minified javascript. There was nothing left but to extract the API from it. To do this, a test application was created in Flurry to track statistics, an html page was taken from the Flurry documentation. Statistics from this html page was successfully sent and displayed on the Flurry website. We used this page as a test of javascript file performance. Note that events reach Flurry in 1–20 minutes, and summation over events lags behind reality by 2–5 hours. These circumstances complicated testing.
After setting up the tests, the minified flurry.js was refactored. In the beginning, the functions of encoding, decoding in Base64 and utf-8, the hash function Adler-32 were recognized. Further refactoring went from two sides - from the functions provided by js (setAppVersion, startSession, logEvent, and so on), since they have human names; and from requests that js sent to the Flurry website. As a result, a readable and, at the same time, a working javascript file was obtained, from which it was already possible to get an API for working with Flurry. The source code for working with Flurry, implemented in C ++, can be viewed on
github .
To use statistics, the following procedure is recommended. First you need to register on the Flurry website and get the key. Next, in the code, determine the events for which statistics will be collected, for example, we will collect statistics on the successful sending of messages:
enum class stats_events { ... message_sent, ... }
For each event there is an opportunity to add a dictionary of parameters, add the length of the message:
... event_props_type props; props.emplace_back(std::make_pair("message_length", message_length)); ...
And we just have to call the class method that manages the statistics:
... Statistics stats; stats.insert_event(stats_events::message_sent, props); ...
Real use can be viewed in our
githaba . With the help of Flurry, we have the opportunity to monitor the state of our product, below is a graph of the number of sent messages, taken from the statistics page.

Remember, we said that you can attach a property dictionary to each event? Below is a graph of statistics on language settings:

And the schedule of statistics of operating systems on which our application started:

If you already use Flurry for your mobile apps, then try using it for desktop as well. It turned out that the system perceives the desktop application as a website, but at the same time you get statistics on all versions of your application in one place.