Firebase provides tools in the Firebase console to explore and analyze your project's historical data. These tools can help you answer many questions about how your apps are being used. Sometimes, though, you also want to set up your own queries to answer your own questions.
You can do this by exporting your project data from Firebase into BigQuery. With BigQuery, you can analyze your data with BigQuery SQL or export the data to use with your own tools.
You can configure Firebase to export data to BigQuery from the following Firebase products:
- Analytics
- Cloud Messaging
- Crashlytics
- Performance Monitoring
- A/B Testing
- Remote Config personalization
Required permissions and suggested roles
To view or manage settings for data export to BigQuery, you must have the required level of access.
If you don't have the necessary Firebase access, you can ask a Firebase project Owner to assign you the applicable role via the Firebase console IAM settings. If you have questions about accessing your Firebase project, including finding or assigning an Owner, review the Permissions and access to Firebase projects FAQs.
The following table applies to the top-level linking of a Firebase project to BigQuery.
Action in Firebase console | Required IAM permission | IAM role(s) that include required permissions by default | Additional required roles |
---|---|---|---|
Link a Firebase project and BigQuery | firebase.links.create |
none | |
Unlink a Firebase project and BigQuery | firebase.links.delete |
none | |
View the existing links for BigQuery | firebase.links.list |
|
none |
The following table applies specifically to the export of Google Analytics data to BigQuery.
Action in Firebase console | Required IAM permission | IAM role(s) that include required permissions by default | Additional required roles |
---|---|---|---|
Enable export of Google Analytics data to BigQuery | firebase.links.update
AND serviceusage.services.enable
AND resourcemanager.projects.getIamPolicy
AND resourcemanager.projects.setIamPolicy
|
|
|
Enable export for specific Firebase apps | firebase.links.update |
|
|
Disable export for specific Firebase apps | firebase.links.update |
|
The following table applies to any of the Firebase products for which you can export data to BigQuery, for example, Crashlytics or Performance Monitoring.
Action in Firebase console | Required IAM permission | IAM role(s) that include required permissions by default | Additional required roles |
---|---|---|---|
Enable export of a product's data to BigQuery | firebase.links.update
|
none | |
Enable export for specific Firebase apps | firebase.links.update |
none | |
Disable export for specific Firebase apps | firebase.links.update |
none |
Enable export to BigQuery
In the Firebase console, go to the Integrations page.
In the BigQuery card, click Link.
Follow the on-screen instructions to enable export to BigQuery.
What happens when you enable export?
You select the dataset location. After the dataset is created, the location can't be changed, but you can copy the dataset to a different location or manually move (recreate) the dataset in a different location. To learn more, see Change the location for existing exports.
This location is only applicable for the data exported into BigQuery, and it does not impact the location of data stored for use in the Firebase console.
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. You can manage which apps send data.
Firebase exports a copy of your existing data to BigQuery. The initial propagation of data for export may take up to 48 hours.
Firebase sets up daily syncs of your data to BigQuery.
After you link your project, you usually need to wait until the next day's sync for your first set of data to be exported to BigQuery.
The daily sync happens once per day, regardless of any scheduled export that you might have set up in BigQuery. Note that the timing and duration of the sync job can change, so we don't recommend scheduling downstream operations or jobs based on a specific timing of the export.
To deactivate exports to BigQuery, unlink your project in the Firebase console.
Change the location for existing exports
After you enable a product for BigQuery export and create a dataset, you can't change the location of that dataset. However, you can copy your existing dataset to a new dataset that has a different location and reset your data export to that new location. Learn about BigQuery dataset locations.
Select the product for which you want to change the location for data export
To change the location of an existing Google Analytics export to BigQuery, follow these instructions:
In the Firebase console, go to the Integrations page. Then do the following:
- In the BigQuery card, click Manage.
- Toggle off the Google Analytics slider to disable BigQuery.
In the Google Cloud console, go to the BigQuery page. Then do the following:
- Create a temporary dataset to store a copy of the existing data from your original dataset. Assign the temporary dataset a different name than the name of the original dataset.
- Copy or move the data from your original dataset to the temporary dataset.
- Delete the original dataset.
- Create a new, permanent dataset with the same name as your original
dataset
(
), then select the new region.analytics_ANALYTICS_PROPERTY_ID
- Copy or move the data from the temporary dataset to the new dataset, then delete the temporary dataset.
Go back to the Firebase console and the BigQuery card. Then do the following:
- Toggle on the Google Analytics slider to re-enable the BigQuery integration.
- Select the apps for which you want to enable the export.
Pricing and the BigQuery sandbox
If your Firebase project is on the no-cost Spark plan, you can link Crashlytics, Cloud Messaging, Google Analytics, and Performance Monitoring to the BigQuery sandbox, which provides no-cost access to BigQuery. Refer to Using the BigQuery sandbox for information on the BigQuery sandbox's capabilities.
If your Firebase project is on a paid plan, you can link A/B Testing, Crashlytics, Cloud Messaging, Google Analytics, and Performance Monitoring to BigQuery. Your use of BigQuery is subject to normal BigQuery pricing, which includes limited no-cost use.