Learn how to log events to Firebase using a set of predefined event types that Firebase provides out of the box.
- [Instructor] Earlier, we learned about how Firebase will…automatically log certain analytics events for your app,…without you having to write any code,…but those events are generic to every application,…and while they're valuable,…to get real insight out of your analytics,…you'll have to log your own events for scenarios…that you decide are important.…In this example, we'll see how to log our own events…using some of the ones that Firebase pre-defines for us.…In Android Studio, you can see I've got the start version…of the project open,…so let's open the MainActivity.java file for the project.…
So, to begin collecting our own events,…we have to initialize the analytics object…by adding it to our activity.…So, let's start by declaring a member variable,…and I'll write private FirebaseAnalytics,…and you can see I'm getting some code completion there,…so I'll do that,…and I'll call it mFBAnalytics,…and that, you can see, has added the FirebaseAnalytics…import for me.…Alright, so now I've added the member variable,…
- Why use analytics?
- Reviewing the Google Analytics for Firebase feature set
- Adding Analytics support to an application
- Using DebugView to see Analytics events in real time
- Logging events to Firebase using a set of predefined event types
- Event collection
- Gaining insight into the behaviors of specific types of users