How to add Firebase Analytics in iOS App

Updated 12 December 2023

Save
How to add Firebase Analytics in iOS App

Firebase Analytics

Google Analytics for Firebase provides free, unlimited reporting on up to 500 distinct events. The SDK automatically captures certain key events and user properties, and you can define your own custom events to measure the things that uniquely matter to your business. Let’s see How to add Firebase Analytics in iOS app

Use of Firebase Analytics

Sometimes we need to track our application like (Most view page, most like the product, the number of logins, and places), etc. for that Google fireBase provides functionality.

Google Analytics helps you understand how people use your web, iOS, or Android app.

The SDK automatically captures a number of events and user properties and also allows you to define your own custom events to measure the things that uniquely matter to your business.

Once the data is captured, it’s available in a dashboard through the Firebase console.

This dashboard provides detailed insights about your data — from summary data such as active users and demographics to more detailed data such as identifying your most purchased items.

Firebase Dashboard

 

Getting Started with How to add Firebase Analytics in iOS app

Google Analytics collects usage and behavior data for your app. The SDK logs two primary types of information:

Step 1: Before you begin, add Firebase to your iOS project. You can check here to add a firebase to your project.

Step 2: Now, add analytics SDK to your project.

Step 3: Then open AppDelegate file in your project and import Firebase.

Step4: Configure a FirebaseApp shared instance, typically in your app’s application:didFinishLaunchingWithOptions: method:

Step5: After you have configured the FirebaseApp  instance, you can begin to log events with the LogEvent method.

Please check the following example, how to log an event to check how many times particular Product Details are viewed.

You can also check the code in Objective-C here.

Step6: To view this event in the Xcode debug console, enable Analytics debugging:

  1. In Xcode, select Product > Scheme > Edit scheme…
  2. Select Run from the left menu.
  3. Select the Arguments tab.
  4. In the Arguments Passed On Launch section, add -FIRAnalyticsDebugEnabled.

Thanks for reading 🙂

author
. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

Start a Project


    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home