Search code examples
androidfirebasegoogle-analyticsanalyticsfirebase-analytics

Getting statistics (analytics) about number of users with root


How can I get statistics about how many of my users have rooted phone? Does the Google/Firebase analytics produce such reports?

Update: I know how to check root permissions. The question is how can I get statistics? I can add check for root in Application onCreate() and send it to analytics. But I will get so many events as the number of starts of applications, what is not what I am looking for. Of course, I could write my own backend and send some device id and and root status there but I think I am not the first and it is not needed to write my own bicycle.

I want to be able to see something like: "In last month, 30% of active users had rooted phones."

P.s. I do not have experience with google analytics, so if it is possible to somehow specify such type of event (for example, I already have value "isRooted = false" in my application), show me an example or give a link to manual, please.


Solution

  • Rather than using events, I would use Firebase Analytics user properties.

    1. Define the property "is_rooted" in Firebase console > Analytics > User properties > New
    2. Set the property in your code (Your main activity's onCreate() sounds good) :

      FirebaseAnalytics.getInstance(this).setUserProperty("is_rooted", true|false);
      
    3. Then you can use this property in filters, and even create audiences, etc. in the console.

    Hope this helps.