You integrated Firebase into your app, you jumped in joy when you shipped out that feature in such a short time because of Firebase! Everyone is happy and you keep telling others how fast firebase speeds up development! And after a week, you want to get some data from Firebase for a report, you want to see how users are using your app ! BAM !!!!! Things change! You feel like a cruising Tesla S has come to a sudden halt!! Now, you curse yourself or the developer who chose Firebase to build that feature ! “Reporting would have been easier if only we din’t choose Firebase” – you tell yourself again and again….
Reporting can be simple with Firebase, and need not be super complicated. In a few minutes, I’ll show you how to get your Firebase data onto google sheets (the fun way), like eating a creamy fluffy cupcake!
Without writing a single line of code you can automatically pull the latest data from Firebase Cloud Firestore to Google Sheets. All this without sacrificing data security, with our encrypted Google setup and data stored in your private Google Sheet, you can be confident that you are safe. Let me show you how.
If you want something quick and light here is a video to help you through the entire setup process
Let’s get started, first we are going to create a new google service account and give it access to your Firebase Cloud Firestore database. We then add the service account into Two Minute Reports. This allows you to set clear permissions and have full control over the access to your Firebase Firestore.
Step 1 – Create a service account
- Click “+ Create Service Account”
- Under the “Grant this service account access to project”, make sure to select “Cloud Datastore Viewer” permission and then click continue.
- Your Service Account account is now created
- Now select your newly created service account, create JSON keys and download them
- Keep the .json file safe, we will need it in the next step
You can adjust the permissions in the IAM section to give more fine-grained access to your new service account if desired.
Step 2 – Add a new Data Source
After installing Two Minute Reports go to the Data Source section. We will connect your service account with Two-Minute-Reports here.
- Go to the Data Sources section
- Select Firebase from the drop-down
- Copy & paste the values of the .json file we received from the previous step in the text area
- Press Test Connection and you are now ready to start pulling data
Step 3 – Fetch Firestore Data onto Google Sheet
Now that your data source has been connected, you can write your own Firestore queries and start fetching data onto the Google Sheets
- Go to the Data Queries section and press Add
- Select your newly added Data Source and write your query
- Firebase queries are called Structured Queries and you can learn more about them – here
- Once a query runs successfully, you should see the data populate on your spreadsheet
Step 4 – (Optional) Schedule and e-mail reports
Once you have fetched data once, you might want to update Google Sheet with the latest data from your FIrebase Cloud Firestore database at periodic intervals. You can do this by creating a new schedule under the “Schedule Refresh” section. You can schedule hourly, daily, weekly, or monthly based on your needs.
You could also create a report and ask Two Minute Reports to email that report with updated data automatically. Under the email section enter the email Id of the recipients and save your new schedule.
When the time comes, Two Minute Reports will automatically fetch new data from your Firestore queries, and email your report to the said recipients.
Congratulations! You have now freed a lot of your time from mundane reporting tasks.
Try Two Minute Reports for Free by installing from the GSuite marketplace, and start managing your SEO tasks in a breeze within Google Sheets. Cheers!