Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to export data from Firebase Crashlytics to another application?

Tags:

I am interested in fetching the Crash-free users statistics and the user affected by Crashes trend from the Google firebase Crashlytics.

Is there any API using which I can call using my application to export the data from Firebase Crashlytics?

I looked at a few other similar questions like theses:

, but none of them actually mention a solution to export data out of Crashlytics.

As suggested in one of the questions above, I could export the data into Big Query and then calculate the crash-free statistic myself, but I haven't used Big Query before and I'm not sure if I will be able to export that data from Big Query either?

Is it possible to get that data out of Crashlytics somehow?

UPDATE

Upon looking a bit more closely at the networking console in Google Chrome, while loading the Crashlytics data for my App, I can see that Crashlytics makes a POST call to the following endpoint (along with its auth/cookies):

https://***.google.com/v1/projects/***/clients/ios:abc.def.MyApp:getDailyRealtimeCrashUsersReport?alt=json&key=xyz

and the response to this contains the exact data that I am looking for:

{
  "report": {
    "dailyUsers": [
      {
        "dateMs": "xxxx",
        "totalUsers": 1234,
        "crashUsers": 12
      }
      ...
      ...
    ],
    "totalUsers": 12345,
    "totalCrashUsers": 123
  }
}


Is there a way I could directly call this API along with a proper auth (OAuth2 maybe?) through my (Java) code, and skip having to go to BigQuery and do all those extra steps? It would be easier to make a direct call to this endpoint and get the data directly instead of first exporting it to BigQuery and the running a custom query (/queries?) there and the exporting the data through another API.

And,

If such a solution is not possible, then is there a way to get a similar kind of data from BigQuery and export similarly in JSON it via a BigQuery API call?

from the BigQuery API link given in the answer below, I can see some APIs which support exporting models/projects/jobs/datasets/tables etc.. but couldn't figure out if there is a way to export data based on a custom queries that I would need to run to get the data I want?

like image 943
Sumit Avatar asked Jan 10 '20 01:01

Sumit


2 Answers

It seems that Crashlytics doesn't support this kind of API you're searching for.

About exporting from Crashlytics to BigQuery, I've found the following information here

Enabling BigQuery export

  1. Go to the Integrations page in the Firebase console.
  2. In the BigQuery card, click Link.
  3. Follow the on-screen instructions to enable BigQuery.

When you link your project to BiqQuery:

  • Firebase exports a copy of your existing data to BigQuery.
  • Firebase sets up daily syncs of your data from your Firebase project to BigQuery.
  • By default, all apps in your project are linked to BigQuery and any apps that you later add to the project are automatically linked to BigQuery.

What data is exported to BigQuery?

Firebase Crashlytics data is exported into a BigQuery dataset named firebase_crashlytics. By default, individual tables will be created inside the Crashlytics data set for each app in your project. Firebase names the tables based on the app's bundle identifier, with periods converted to underscores, and a platform name appended to the end. For example, data for an app with the ID com.google.test would be in a table named com_google_test_ANDROID.

To export data from BigQuery, you can use the BigQuery API or use the BigQuery SDK for some programming language.

Does it help you? If it doesn't, please provide me more information so I can provide you a better answer.

like image 153
rmesteves Avatar answered Sep 29 '22 14:09

rmesteves


The Google Analytics Data API is a solution to export crashAffectedUsers & crashFreeUsersRate data from Crashlytics. crashAffectedUsers is number of users that logged a crash, and crashFreeUsersRate number of users without crash events divided by the total number of users. The Data API schema page contains more details about these metrics.

An example request to the RunReport method looks like the following:

{
  "dateRanges": [
    {
      "startDate": "7daysAgo",
      "endDate": "today"
    }
  ],
  "dimensions": [
    {
      "name": "date"
    }
  ],
  "metrics": [
    {
      "name": "crashFreeUsersRate"
    },
    {
      "name": "crashAffectedUsers"
    },
    {
      "name": "totalUsers"
    }
  ]
}

An example response row looks like the following. This row means: on 2021-11-13, the crash free users rate was 99.836%, 2 users were affected by crashes, and 1220 total users used your app.

    {
      "dimensionValues": [
        {
          "value": "20211113"
        }
      ],
      "metricValues": [
        {
          "value": "0.99836"
        },
        {
          "value": "2"
        },
        {
          "value": "1220"
        }
      ]
    },
like image 39
Brett Avatar answered Sep 29 '22 14:09

Brett