Intro to Android Development
  • Welcome
  • Syllabus
  • Hack Challenge
  • Resources
    • Lecture Videos
    • Ed Discussion
    • Git & GitHub Help/How-To
    • Setting up Android Studio
    • Starting an Android Studio Project & Making an Emulator
    • Importing, Exporting, & Submitting Your Projects to CMS
  • SP25 Course Material
    • Week 1 | Course Logistics, Kotlin, & Basic UI
      • Relevant Links
      • Demo/Lecture: Eatery Card
      • A0: Eatery Card (Follow-Along)
    • Week 2 | States, Components, LazyColumn
      • Relevant Links
      • Demo: Todo List
      • A2: Shopping List
    • Week 3 | Navigation & Animations
      • Relevant Links
      • Demo: Onboarding
      • A3: Stock Trading (RobbingGood)
    • Week 4 | MVVM and Flows
      • Relevant Links
      • Demo: Eatery Card 2
      • A4: Chat of a Lifetime
    • Week 5 | Dumb Components & UIEvents
      • Relevant Links
      • Demo: Music Player
      • A5: Rate My Vibe
    • Week 6 | Coroutines, Networking, JSON
      • Relevant Links
      • Demo: Retrofit
      • A6: You Should Even Lift, Bro.
  • Bonus Week | Android Job Search
    • Relevant Links
    • Android Technical Interview Question!
  • Textbook
    • 1. Introduction to the Editor and Views
      • 1.1 Introduction to the Editor
      • 1.2 SDK Management
      • 1.3 Kotlin Overview
      • 1.4 Views
      • 1.5 Android Studio Project Demo + Understanding The Editor
    • 2. Jetpack Compose
      • 2.1 Introduction
      • 2.2 Layouts
      • 2.3 Modifiers
      • 2.4 Animations
      • 2.5 Lazy Lists
      • 2.6 Reactive UI
    • 3. Intents and Manifest
      • 3.1 Activities
      • 3.2 Implicit Intents
      • 3.3 Explicit Intents
      • 3.4 Manifest
      • 3.5 Permissions
      • 3.6 Summary
    • 4. Navigation
      • 4.1 Types of Navigation
      • 4.2 Implementation of the Bottom Navigation Bar
    • 5. Data and Persistent Storage
      • 5.1 Singleton Classes
      • 5.2 Shared Preferences
      • 5.3 Rooms
      • 5.4 Entities
      • 5.5 Data Access Objects
      • 5.6 Databases
    • 5.5 Concurrency
      • 5.5.1 Coroutines
      • 5.5.2 Implementation of Coroutines
      • 5.5.3 Coroutines with Networking Calls
    • 6. Networking and 3rd Party libraries
      • 6.1 HTTP Overview
      • 6.2 3rd Party Libraries
      • 6.3 JSON and Moshi
      • 6.4 Retrofit
      • 6.5 Summary
    • 7. MVVM Design Pattern
      • 7.1 Key Idea
      • 7.2 Implementation Ideas
    • 8. Flows
    • 9. The Art and Ontology of Software
    • 10. 🔥 Firebase
      • 10.1 Setting up Firebase
      • 10.2 Authentication
      • 10.3 Analytics
      • 10.4 Messaging
      • 10.5 Firestore
  • Additional Topics
    • Git and GitHub
    • Exporting to APK
  • Archive
    • Archived Native Android Textbook Pages
      • 1. Layouts and More Views
        • 1.1 File Structure and File Types
        • 1.2 Resource Files
        • 1.3 Button and Input Control
        • 1.4 ViewGroups
        • 1.5 Summary + A Note On Chapter 2 Topics
      • 2. RecyclerViews
        • 2.1 RecyclerViews
        • 2.2 RecyclerView Performance
        • 2.3 Implementation of a Recycler View
        • 2.4 Implementation with Input Controls
        • 2.5 Filtering RecyclerViews
        • 2.6 Recyclerview Demo
      • 3. ListViews and Searching
        • 3.1 ListView vs. RecyclerView
        • 3.2 ListView Performance
        • 3.3 Implementation of a ListView
        • 3.4 Searching in a List View
      • 4. Fragments
        • 4.1 What are Fragments?
        • 4.2 Lifecycle of a Fragment
        • 4.3 Integrating a Fragment into an Activity
        • 4.4 Sharing Data Between Fragments
        • 4.5 Fragment Slide Shows
      • 5. OkHttp
      • 6. Activity Lifecycle
      • 7. Implementation of Tab Layout
    • Fall 2024 Course Material
      • Lecture 1 & Exercise 1: Introduction to Android
      • Lecture 1.5: Beauty of Kotlin
      • Lecture 2 & HW 2: Modifiers, Lazylists and Reactive UI
      • Lecture 3 & HW 3: Animations, Intents and Manifest
      • Lecture 4 & HW 4: Coroutines & Navigation
      • Lecture 5 & HW 5: Persistent Storage, Networking, and JSON Parsing
      • Lecture 6 & HW 6: MVVM, Flows
      • Bonus Lectures & Bonus HW
      • Bonus Lecture: Industry Practice
    • Spring 2024 Course Material
      • Lecture 1 & Exercise 1: Introduction to Android
      • Lecture 4 & HW 4: LazyLists
      • Lecture 6 & HW 6: Networking, Data, and Persistent Storage
    • Spring 2020 Course Material
      • Week 1: Intro to the Editor
      • Week 2: Views and Layouts
      • Week 3: Intent and Manifest
      • Week 4: ListView and RecyclerView
      • Week 5: Fragments
      • Week 6: Networking
    • Spring 2021 Lecture & HW 8: Networking & 3rd Party APIs
    • HackOurCampus Workshop
Powered by GitBook
On this page
  • Setting up Analytics
  • Using Analytics
  • Seeing data
  • Audiences
  • Conclusion
  • Things to explore next

Was this helpful?

  1. Textbook
  2. 10. 🔥 Firebase

10.3 Analytics

Previous10.2 AuthenticationNext10.4 Messaging

Last updated 7 months ago

Was this helpful?

Google Analytics is a free app measurement solution that provides insight on app usage and user engagement. Analytics reports help you understand clearly how your users behave, which enables you to make informed decisions regarding app marketing and performance optimizations. Maybe you want to know how often users are clicking a certain button on your app or how much they are using a new feature you just released. Analytics can help with that and it's super easy to set up! Think of it as having a low skill floor but a moderate skill ceiling.

Setting up Analytics

Make sure your Firebase project is set up, the steps of which are covered in the first section 11.1!

Declare the dependency for the Analytics Android library in your module (app-level) Gradle file:

implementation 'com.google.firebase:firebase-analytics-ktx'

When accessing most Analytics services, you need the appropriate FirebaseAnalytics object.

private lateinit var firebaseAnalytics: FirebaseAnalytics

You can then initialize it in the onCreate method of your activity:

firebaseAnalytics = Firebase.analytics

Using Analytics

The core of analytics is the function, which allows you specify the event and any additional parameters you may want to store with that event (i.e. maybe the specific article someone clicks on if your app is a news aggregator for a college campus such as Cornell Google also provides some predefined events/parameters that you can explore also (and I recommend taking a look at first)! Here's an example:

firebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_ITEM) {
    param(FirebaseAnalytics.Param.ITEM_ID, SOME_ID)
    param(FirebaseAnalytics.Param.ITEM_NAME, SOME_NAME)
    param(FirebaseAnalytics.Param.CONTENT_TYPE, "image")
}

Seeing data

Right off the bat, the dashboard tells you a lot of things:

  1. You can see what the demographic information of your users are,

  2. How regularly they use your app,

  3. How much time they spend there, and

  4. How much they have spent on your app.

The data captured on your app can be viewed from the dashboard in the Firebase console from here on. You’ll see predefined events that have automatically been captured by the SDK, such as active users, demographics and app engagement.

If you have both an iOS and Android version you will see the data for both of them on the dashboard. You can look at the data for just one version by clicking on ‘filters’. Filters also allow you to analyze the data for different audiences you have set up.

By default, the dashboard will show you the last 30 days of data, but you can change this by using the date picker control.

There’s a lot of different data and information on the dashboard to help you understand your app. It starts with active users i.e. how many users are in your app on a daily, weekly and monthly basis. As well as how many users are active in the last 30 minutes.

It shows user engagement, such as how much time people spend within your app. It also shows conversion metrics. If you have in-app purchasing you see this data along with information on Admob if you’re generating revenue.

There’s a section on the stability of your app. It shows the percentage of crash-free users.

Another card on the dashboard shows the latest release of your app along with the status of that release. The status allows you to click into it to investigate any issues.

Audiences

Once the data within your app is captured via these events you've logged, you’re able to create audiences, and group users based on certain attributes like ‘purchasing users’.

Audiences are particularly useful when used in conjunction with other Firebase features. For example, you can send custom notifications using Firebase Notifications. Notifications can even be used to target users with Google’s ad platform. Maybe you want to target users prone to cart abandonment and send them a notification to egg them on to complete a purchase.

The events data captures the overall performance of your app, but ‘user properties’ and ‘audiences’ drills down further into specific behavior. By using user properties and audiences you can segment the data captured for better insights into how your app is being used.

When you click the ‘user properties’ table you can register a property, such as the profession of your users. You then use the API to call that specific information.

You can create audiences of users who meet certain criteria and user property criteria. Once you set up the audience it will start to accumulate users who meet these criteria. You can then target these audiences with particular campaigns.

Conclusion

And this is just the tip of the iceberg of what Google Analytics for Firebase can do for you and a good baseline as to where you can go next. I truly implore you to look into the powerhouse that is Google Analytics, as it could take your app to the next level in terms of audience and reach!

Things to explore next

  • BigQuery

  • Firebase Remote Config

The code above logs event when a user clicks on a specific element in your app.

Google has a lot of baseline events that can be tailored according to your needs. They cover vertical markets and business types like Retail/E-commerce, Games, etc. Check some out !

Google Ads (using Firebase data in combination to help with targeting ads) &

https://firebase.google.com/docs/analytics
logEvent()
).
SELECT_CONTENT
here
Audiences
A Guided Tour of the Firebase Analytics Dashboard - Techotopia
Example Google Analytics dashboard
Firebase Analytics dashboard
Logo