Skip to content

Flutter Developers Should Care About Analytics

Probably more than non-engineering staff

Posted on:August 4, 2023
4 minutes

This week I want to talk about why developers should start caring about product usage analytics.

It gives you additional insights into how your code is being used, which can help you make decisions on the code to focus on vs remove. Code bases should not grow forever, this is a quick path to maintenance hell.

You should have periods where you focus on removing code and reducing code complexity.

Less code = Less maintenance cost = Less cognitive load

“But all our code is required and useful”

That’s often the reasoning I hear when I bring this up with teams I consult with. But this is not true. There are abstractions you’ve made that were never used past the one instance, there are features you’ve built that aren’t used that often by users. These unused features often require other parts of your code to be more complicated to accommodate them.

By tracking analytics you have proof that the effort of maintaining that feature brings no value to your product, your code, your users or the business.

There are 3 main reasons that I like to look at analytics as a software developer:

Can I delete this code?

To answer this question is one of the reasons that I look at analytics, even if it’s not a part of what my client wants me to do.

Deleting code has multiple positive benefits:

It’s common that developers and teams won’t want to remove features or code because “a user might need it”. In this case, given that there are objective indicators that very few users are using the features, you should at least reduce the complexity of that feature into something easy to manage and update (if it’s not already)

What code should I make more robust?

If you see a part of your codebase being used the most, it’s a very clear sign that you should spend a lot of time on that code to make it more robust. The process of doing this is simple, you simply make your code testable.

The process of making your code testable creates a more robust piece of code. To achieve this what you’ll do is:

The highest level of robustness you can have here is:

The code with the most amount of usage should be where we focus our efforts. It should take priority over underutilized code.

Help me solve a bug

The more data we have the better chance we have of reproducing and fixing bugs.

When users experience bugs in production, we should be getting stability reports for them. These reports are often stack traces, call logs, and mostly confusing error messages that don’t really give us a clear idea of what happened.

With analytics events, you’ll be able to see exactly how the user used the app, what screen they were on, and which buttons they tapped. With all this data, reproducing a bug is much easier. You have an increased chance of finding and fixing a bug.

Getting more tools to solve bugs is always a good investment to make.

I have personally assigned weeks to remove dead code or improve highly utilized code. It’s worth the investment of spending a day or two convincing a client or your team that you should delete some code from the code base to reduce the burden of maintaining it for no benefit.

It’s a task you can do, as a developer, where you write little new code, but have a massive impact.

I hope you enjoyed this post.

Subscribe to make sure you don’t miss out on next week.

If you want to get these in your inbox, for our newsletter.

Also check out