Google Analytics is Firebase's analytics engine that gives you access to powerful insights into your data. Google Analytics provides the same features you had in Fabric Answers and allows you to integrate your events data with other powerful services, such as Firebase Crashlytics and Firebase Cloud Messaging. This page describes how to add Google Analytics to your app after migrating it to Firebase.
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 (
GoogleService-Info.plist).You can download your Firebase iOS config file again at any time.
Make sure the config file is not appended with additional characters, like
(2).
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
its own GoogleService-Info.plist file.
Step 2: Add the Analytics SDK to your app
- Add the dependency for Firebase to your Podfile:
pod 'Firebase/Analytics'
- Run
pod installand open the created.xcworkspacefile. - Import the Firebase module in your
UIApplicationDelegate:Swift
import Firebase
Objective-C
@import Firebase;
- Configure a
FirebaseAppshared instance, typically in your app'sapplication:didFinishLaunchingWithOptions:method:Swift
// Use Firebase library to configure APIs FirebaseApp.configure()
Objective-C
// Use Firebase library to configure APIs [FIRApp configure];
Your app is now set up to use Google Analytics.
Next steps
- Use the DebugView to verify your events.
- Explore your data in the Firebase console.
- Explore the guides on events and user properties.
- Learn how to export your data to BigQuery.
- Learn how to switch your Fabric Answers events to Google Analytics events.

