# Firebase Analytics in 30 Seconds

Original: https://swyx.io/firebase-analytics-in-30-seconds-6pp
Published: 2017-12-02

> title: Firebase Analytics in 30 Seconds

---
title: Firebase Analytics in 30 Seconds
published: true
tags: inthirtyseconds, firebase, analytics
---

[Stacy Devino](https://twitter.com/doesitpew) gave an excellent talk on Firebase Analytics today ([slides here](https://docs.google.com/presentation/d/1akpEegWCXHkMjU-GBS-3yZ1wHvO7YATU_zHP0kuqDhU/edit#slide=id.p), [github here](https://github.com/childofthehorn/AndroidFirebaseAnalyticsWorkshop), [youtube intro here](https://www.youtube.com/watch?v=8iZpH7O6zXo)). There were a lot of aha moments:

1. Integrating the Firebase SDK ([Android](https://firebase.google.com/docs/android/setup) and [iOS](https://firebase.google.com/docs/ios/setup) and [web](https://firebase.google.com/docs/web/setup)) is just a few lines of code!

There are **pre-configured** events (send standard stuff like login attempts):

```
Bundle bundle = new Bundle();
bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, name);
bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "image");
mFirebaseAnalytics.logEvent(
    FirebaseAnalytics.Event.SELECT_CONTENT, bundle);
```

and **custom** events (send whatever you want)

```
Bundle bundle = new Bundle();
bundle.putString("image_name", name);
mFirebaseAnalytics.logEvent("profile_image_select", bundle);
```

2. User grouping (so you can study how different groups of your users behave differently) is similarly just a few lines:

```
mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
mFirebaseAnalytics.setUserProperty("preferred_pet", 
    petSelector);
mFirebaseAnalytics.setUserId("userIdString");
```

3. Once your app is out in the wild, head to the [Dashboard](https://console.firebase.google.com) to see insights!

4. Within the Dashboard, [Streamview](https://support.google.com/firebase/answer/7229836?hl=en) is particularly awesome as you can see the "clickstream" of user actions in sequence and visualize what they are doing (or failing to do) on your app!

5. Everything above is completely free and unlimited for you to use. To do -really big- number crunching, you'll have to export the data outside of [Firebase Analytics to Google BigQuery](https://cloud.google.com/solutions/mobile/mobile-firebase-analytics-big-query). There you will be able to query all your historical user data with plain SQL!

BigQuery is a freemium product so you'll have to have a credit card attached but the financial risk is low for most use cases: "[Realistically, most people wouldn’t burn through the free GCP $ in the first year. 20k users and normal use <$5/month](https://youtu.be/Ki_F6VCOtXU?t=86)".

Having messed around with a few analytics products in my time as a product manager this looks extraordinarily easy to setup and get insights on, and I am looking forward to deploying this in ALL my [Firebase hosted](https://firebase.google.com/docs/hosting/) and [serverless function](https://firebase.google.com/docs/functions/) projects!
