1

The first display in the Analytics Dashboard on Firebase shows total active users.

My understanding is that this is showing the amount of users who use the app within a given period. However, some of these users may have since uninstalled the app. Is there a separate number which shows the number of total installs? I simply need to know the number of users who have my app actively installed at any given time.

Active installs of the app, not necessarily the number of authenticated users.

Cin88
  • 425
  • 2
  • 6
  • 20

1 Answers1

1

Looking through the firebase API, this webpage will be you're best bet

https://firebase.google.com/docs/auth/admin/manage-users

Scrolling down it has a section labled "List all users" not for sure what language you're using but in Node.js it is

function listAllUsers(nextPageToken) {
  // List batch of users, 1000 at a time.
  admin.auth().listUsers(1000, nextPageToken)
    .then(function(listUsersResult) {
      listUsersResult.users.forEach(function(userRecord) {
        console.log('user', userRecord.toJSON());
      });
      if (listUsersResult.pageToken) {
        // List next batch of users.
        listAllUsers(listUsersResult.pageToken);
      }
    })
    .catch(function(error) {
      console.log('Error listing users:', error);
    });
}
// Start listing users from the beginning, 1000 at a time.
listAllUsers();

The above will make sure you have a list off all authenticated users. Simply combine that with

exports.appUninstall = functions.analytics.event('app_remove').onLog(event => {
  const user = event.user; // structure of event was changed            
  const uid = user.userId; // The user ID set via the setUserId API.

  // add code for removing data
});

And remove the userID and decrement the active users by 1 to have a general sense of installed apps.

hopefully this works better.

  • Pardon me.. I am re-adjusting this question to something more specific right now. I'm looking for the number of active installs of my app, not necessarily the number of authenticated users – Cin88 Feb 10 '20 at 18:41
  • https://stackoverflow.com/questions/35280233/firebase-is-there-a-way-to-see-how-many-installed-the-application describes that there is currently no automatic way of doing this. But gives an example of how to solve it. – Sean Rahman Feb 10 '20 at 18:46
  • BUT https://stackoverflow.com/questions/45744408/cloud-functions-for-firebase-can-you-detect-app-uninstall There is a way to detect if someone has uninstalled the app. You could keep a list off all people using the above mentioned code, and then if they delete the app, to then update the current users number. – Sean Rahman Feb 10 '20 at 18:48
  • Thank you very much, I'm looking into it – Cin88 Feb 10 '20 at 20:44