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
Some Times we need to track our application like (Most view page, most like the product, the number of logins, 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.
Google Analytics collects usage and behavior data for your app. The SDK logs two primary types of information:
Step1: Before you begin, add Firebase to your iOS project. You can check here to add a firebase to your project.
Step2: Now, add analytics SDK to your project.
Step4: Configure a FirebaseApp shared instance, typically in your app’s
Please check the following example, how to log an event to check how many times particular Product Details are viewed.
var jeans: [String: Any] = [
var productDetails: [String: Any] = [
// Add items array
productDetails[AnalyticsParameterItems] = [jeans]
// Log view item event
Analytics.logEvent(AnalyticsEventViewItem, parameters: productDetails)
You can also check the code in objective-C here.
Step6: To view this event in the Xcode debug console, enable Analytics debugging:
Thanks for reading 🙂
Be the first to comment.