Google Analytics is Firebase's analytics engine. When you use Analytics and Crashlytics together in your app, you get features that help you produce issues and keep track of crash data with more granularity, such as crash-free users, breadcrumbs that track specific events prior to a crash, and BigQuery, where you can visualize your app's key metrics. This guide describes how to add Analytics to an app that has Crashlytics set up (if you haven't already, add Crashlytics to your app).
If you previously used Fabric Answers, find out how to switch from Answers to Analytics instead.
Step 1: Add a Firebase configuration file
- Open your Project Settings. In the Your apps card, select the bundle ID of the app for which you need a config file.
Click Download GoogleService-Info.plist to obtain your Firebase iOS config file (
You can download your Firebase iOS config file again at any time.
Make sure the config filename is not appended with additional characters, like
Move your config file into the root of your Xcode project. If prompted, select to add the config file to all targets.
If you have multiple bundle IDs in your project, you must associate each bundle
ID with a registered app in the Firebase console so that each app can have
Step 2: Add the Analytics SDK to your app
- Add the dependency for Firebase to your Podfile:
pod installand open the created
- Import the Firebase module in your
- Configure a
FirebaseAppshared instance, typically in your app's
// Use Firebase library to configure APIs FirebaseApp.configure()
// Use Firebase library to configure APIs [FIRApp configure];
Your app is now set up to use Google Analytics.