Client analytics systems

Imagine that you are an aspiring entrepreneur who has just made a website and a mobile application (for example, for a donut shop). You want to connect custom analytics on a small budget, but don't know how. Everyone around uses Mixpanel, Facebook analytics, Yandex.Metrika and other systems, but it is not clear what to choose and how to use.

Client analytics systems

What are analytics systems?

First of all, it must be said that a user analytics system is not a system for analyzing the logs of the operation of the service itself. Monitoring how the service is running focuses on stability and performance, and is maintained separately by the developers. User analytics, on the other hand, was created in order to study exactly the behavior of the user: what actions he performs, how often, how he reacts to push notifications or other events in the service. Globally, user analytics has two areas: mobile and web analytics. Despite the different interfaces and capabilities of web and mobile services, working with the analytics system in both directions is approximately the same.

Why do it?

User analytics is needed:

  • to monitor what happens while using the service;
  • to change the content and understand where to develop, what features to add / remove;
  • to find what users don't like and change it.

How does it work?

To study user behavior, you need to collect a history of this behavior. But what exactly to collect? This question is up to 70% of the complexity of the entire task. Many members of the product team should answer it together: product manager, programmers, analysts. Any mistake at this step is costly: you can not collect what you need, and collect what does not allow you to draw meaningful conclusions.

After deciding what to build, you need to think about the architecture of how to build it. The main object that analytical systems work with is an event. An event is a description of what happened that is sent to the analytics system in response to a user action. As a rule, for each of the actions selected for tracking in the previous step, the event looks like a JSON packet with fields that describe the action taken.

What is a JSON package?

The JSON package is a text file that describes what happened. For example, the JSON packet might contain information that the user Mary completed the Started game action at 23:00 pm on November 15th. How to describe each action? For example, the user clicks on a button. What properties need to be collected at this moment? They are divided into two types:

  • super properties - properties characteristic of all events that are always present. This is the time, device id, api version, analytics version, OS version;
  • event specific properties - these properties are arbitrary and the main difficulty is how to choose them. For example, for the “buy coins” button in the game, such properties will be “how many coins the user bought”, “how much the coins cost”.

An example of a JSON package in a language learning service:
Client analytics systems

But why not just collect everything?

Because all events are created manually. Analytics systems don't have a "save all" button (and that would be pointless). Only those actions from the service logic that are of interest to some part of the team are collected. Even for each state of a button or window, not all events are usually of interest. For lengthy processes (e.g. game level) only the beginning and the end may be important. What happens in the middle may not be collected.
As a rule, the logic of services consists of objects - entities. It can be the “coin” entity, the “level” entity. Therefore, it is possible to compose events from entities, their states and actions. Examples: “level started”, “level ended”, “level ended, the reason is eaten by a dragon”. It is desirable that all entities that can be “opened” are closed so as not to violate the logic and not complicate further work with analytics.

Client analytics systems

How many events in a complex system?

Complex systems can process several hundred events that were collected from all customers (product manager, programmers, analysts) and carefully (!) Entered into a table, and then into the service logic. Preparing events is a big interdisciplinary work that requires everyone to understand what needs to be collected, attentiveness and accuracy.

What's next?

Let's say we came up with all the interesting events. It's time to collect them. To do this, you need to connect client analytics. We go to Google and look for mobile analytics (or choose from the well-known ones: Mixpanel, Yandex metric, Google Analytics, Facebook analytics, Tune, Amplitude). We take the SDK from the site and embed it in the code of our service (hence the name "client" - because the SDK is built into the client).

And where to collect events?

All JSON packages that will be created need to be stored somewhere. Where will they be sent and where will they be collected? In the case of a client analytical system, it is responsible for this itself. We don't know where our JSON packages are, where they are stored, how many there are, and how they are stored there. The entire collection process is done by the system and is irrelevant to us. In the analytics service, we get access to a personal account, where we already see the results of processing the initial behavioral data. Further, analysts work with what they see in their personal account.

In free versions, the source data is usually not downloadable. The expensive version has such features.

How long will the connection take?

The simplest analytics can be connected in an hour: it will be App Metrika, which will show the simplest things without analyzing custom events. The time to set up a more complex system depends on the selected events. Difficulties arise that require additional development:

  • Is there an event queue? For example, how to fix that one event cannot come before another?
  • What to do if the user has changed the time? Changed the time zone?
  • What if there is no internet?

On average, you can set up Mixpanel in a couple of days. When a collection of a large number of specific events is planned, it can take a week.

Client analytics systems

How to choose which one I need?

General statistics in all analytical systems works fine. Well suited for marketers and salespeople: you can see the retention, how long users spent in the application, all the basic high-level metrics. For the simplest landing page, Yandex metrics will be enough.

When it comes to non-standard tasks, the choice depends on your service, analytical tasks and events that need to be processed to solve them.

  • In Mixpanel, for example, you can run A/B tests. How to do it? You create an experiment in which there will be several samples and make a selection (you assign such and such users to A, others to B). For A the button will be green, for B it will be blue. Since Mixpanel collects all the data, it can find the device id of each user from A and B. Tweaks are created in the service code using the SDK - these are places where something can change for testing. Next, for each user, the value (in our case, the color of the button) is pulled from the Mixpanel. If there is no Internet connection, the default option will be selected.
  • Often you want to not only store and study events, but also aggregate users. The same Mixpanel does this automatically, in the Users tab. There you can view all permanent user data (name, email, facebook profile) and user log history. You can look at user data as statistics: 100 times eaten by a dragon, bought 3 flowers. On some systems, user aggregation can be downloaded.
  • What is the main cool Facebook analytics? It connects the service visitor with his Facebook profile. Therefore, you can find out your audience, and most importantly, then convert it into an advertising audience. For example, if I visit a site once, and its owner has enabled ads (autofillable audience in Facebook analytics) for visitors, then in the future I will see ads for this site on Facebook. For the site owner, it works simply and conveniently, you just need to remember to put a daily cap on the advertising budget. The disadvantage of Facebook analytics is that it is not particularly convenient: a rather complex, not immediately understandable site, it does not work very fast.

Almost nothing needs to be done and everything works! Perhaps there are some downsides?

Yes, and one of them is that usually, it's expensive. For a startup, it could be around $50k a month. But there are also free options. Yandex App Metrica is free and suitable for the most basic metrics.

However, if the solution is inexpensive, then the analytics will not be detailed: it will be possible to see the type of device, OS, but not specific events, and it will not be possible to create funnels. Mixpanel can cost 50k dollars a year (for example, an app with Om Nom can eat that much). In general, in all access to data is often limited. You don’t invent your own models and you don’t run them. Payment is usually carried out monthly / periodically.

Any more?

But the worst thing is that even the Mixpanel considers the data volumes inherent in the active mobile application as an approximation (openly indicated directly in the documentation). If you compare the results with server-side analytics, the values ​​will diverge. (For how to create your own server-side analytics, read our next article!)

The big disadvantage of almost all analytical systems is that they limit access to raw logs. So, running your own model on seemingly your own data will not work. For example, if you look at the funnels in the Mixpanel, you can only calculate the average time between steps. More complex metrics, such as median time or percentiles, cannot be calculated.

Also, the possibility of complex aggregations and segmentations is often lacking. For example, the tricky group-buy “bring together users who were born in 1990 and bought at least 50 donuts each” might not be available.

Facebook analytics has a very complex interface and is slow.

What if I turn on all the systems at once?

Great idea! It often happens that different systems produce different results. Different numbers. In addition, some have one functionality, the second - another, and the third are free.
In addition, several systems can be turned on in parallel for testing: for example, to familiarize yourself with the interface of a new one and gradually switch to it. As in any business, here you need to know the measure and connect analytics in such a volume that you can follow (and which will not slow down the network connection).

We connected everything, and then released new features, how to add events?

Just like when connecting analytics from scratch: collect a description of the necessary events and insert it into the client code using the SDK.

I hope that the answers to frequently asked questions will be useful to you. If they helped you understand that client-side analytics are not suitable for your application, we recommend that you try your server-side analytics. I will talk about it in the next part, and then I will talk about how to implement it in my project.

Only registered users can participate in the survey. Sign in, you are welcome.

What customer analytics systems do you use?

  • Mixpanel

  • Facebook Analytics

  • Google Analytics

  • Yandex Metrica

  • Other

  • With your system

  • By nothing

33 users voted. 15 users abstained.

Source: habr.com

Add a comment