When you develop an app, being able to track analytics like app installations is incredibly helpful for mobile attribution, improving your app rank, or tracking campaigns. For that reason, companies have created tools that compile a bunch of useful data from your app, with one of the most successful being Google’s Firebase. While setting Firebase up takes some work, the wide variety of services and analytics it provides make it very worthwhile. This wikiHow article will teach you how to set up Firebase for your iOS app and use it to track new users.

Method 1
Method 1 of 4:

Preparing to Use Firebase

  1. 1
    Install Xcode and CocoaPods on your Apple computer. On the Apple computer you are using for app development, install Xcode 12.2 or later, then install CocoaPods 1.10.0 by running the command sudo gem install cocoapods in Terminal.[1] [2]
    • Unfortunately, Xcode is only available for macOS. While it is possible to run Xcode using a virtual machine, it will certainly run more slowly than it would on a physical Mac, and VM-specific issues may arise that are difficult to debug.
    • Be sure your app is designed for these operating system versions or later: iOS 10, macOS 10.12, tvOS 12, and watchOS 6.
  2. 2
    Run your app on a physical or simulated Apple device. To test data collection and the functionality of your app as a whole, set up a physical Apple device or use a simulator.
    • If you would like to use Cloud Messaging, a feature that allows you to receive notification and data payloads of up to 4,000 bytes, you have to run the app from a physical Apple device.[3]
    Advertisement
  3. 3
    Sign into Firebase with a Google account. Signing in will take you to the Firebase console, where you will eventually be able to manage a number of settings and view analytics for your app.
  4. Advertisement
Method 2
Method 2 of 4:

Creating a Firebase Project for Your App

  1. 1
    Open the Firebase console and click Create a project. After opening the console, create a new project for your app with the white Create a project button.
  2. 2
    Name your project and click Continue. Once you have typed in a name, click the blue Continue button to continue setting up your project.
  3. 3
    Enable Google Analytics and click Continue. Google Analytics is necessary to track your app installs, so be sure to enable it before moving to the next step.
    • In addition to tracking app installs, Google Analytics also provides a number of useful features including crash analytics, cloud messaging, A/B testing, and more.
  4. 4
    Adjust your Analytics location and data sharing. Use the dropdown menu to select your country, then decide what Analytics data to share with Google by either accepting their default settings or changing it yourself by unchecking the blue checkbox.
  5. 5
    Accept the Google Analytics terms and create your project. Click the blue checkbox to accept the Google Analytics terms, then press the blue Create project button.
  6. 6
    Click Continue once your project is done loading. After you click the blue Continue button, you will be brought back to the Firebase console. The top of the page will now display the name of your project, and a variety of management options will appear on screen.
    • Firebase has both a free model called the “Spark plan” and a pay-as-you-go model called the “Blaze plan”. Determine which is right for your app by comparing the features each plan offers.
  7. Advertisement
Method 3
Method 3 of 4:

Adding Firebase to Your App

  1. 1
    Open the Firebase console and click iOS+. When you open the console, click the white, circular button labelled iOS+ under “Get started by adding Firebase to your app”.
  2. 2
    Find the bundle ID of your app in Xcode and enter it in the “Apple button ID” box. Your app bundle ID will be listed next to “Bundle Identifier” in the General tab of your app.
  3. 3
    Enter a nickname and the App Store ID for your app. If you choose to enter a nickname for your app, it will be used to identify your app in your Firebase project. Including an App Store ID will allow Firebase Dynamic Links to send users to your app page on the App Store and Google Analytics to import and measure conversion events in Google Ads.
    • Your App Store ID is the series of numbers after “id” at the end of your app’s URL.
    • If your app does not have an App Store ID yet, you can input one later in your project settings.
  4. 4
    Click Register app and download the config file. After clicking the blue Register app button, the next step will appear. Click the new Download GoogleService-Info.plist button to download the necessary config file.
  5. 5
    Add the config file into your Xcode project. Move the “GoogleService-Info.plist” file into the root of your Xcode project.
  6. 6
    Open a Terminal window and select the directory of the Xcode project for your app. To navigate to your project directory, move through higher level directories by typing cd (directory name) until you reach the folder containing your project’s directory, then type cd (project name).
  7. 7
    Create a Podfile through Terminal with pod init. Podfiles are used by CocoaPods, a dependency management software used by Firebase.
  8. 8
    Open the Podfile and write pod ‘Firebase/Analytics’, then save the file. This will import the Analytics software development kit (SDK), allowing you to track and manipulate data from your app.
  9. 9
    Run pod install in the Terminal, then open your newly created .xcworkspace file with open (project name).xcworkspace. You should use the new “.xcworkspace” file for all future development on your app.
  10. 10
    Import the Firebase module in your AppDelegate class. The Firebase module should be imported with import Firebase if you are coding in Swift or @import Firebase; if you are using Objective-C.
  11. 11
    Configure an instance of FirebaseApp. For Swift users, do so with FirebaseApp.configure(); for Objective-C users, write [FIRApp configure];. Typically, these instances will be configured in your application:didFinishLaunchingWithOptions: method.
  12. 12
    Verify your successful installation of Firebase by running your app. Once you have run the app, check the Firebase console to ensure you have installed Firebase correctly.
  13. Advertisement
Method 4
Method 4 of 4:

Using Firebase to Track Installations of Your App

  1. 1
    Open your Firebase project from the console. Go to the Firebase console, then open the project labeled with your app’s nickname.
  2. 2
    Click Dashboard under “Analytics” on the sidebar. Once the Analytics Dashboard is open, you will see a variety of stats about user activity and engagement.
  3. 3
    Find the graph titled “Users by App version” and filter it by user type. Click the arrow at the top right of the graph to open a dropdown menu that will allow you to make a graph detailing all users, new users, or returning users. The new users graph will show you how many users opened your app for the first time over a certain time period, essentially tracking new installations.
  4. Advertisement

About This Article

Sam Browning
Written by:
wikiHow Technology Writer
This article was co-authored by wikiHow staff writer, Sam Browning. Sam Browning is an Emerging Technology Writer for wikiHow. Sam has not only written countless step-by-step articles for social media and tech, but he also has experience writing instructional articles on technology for Davidson College and reviewing video games. He is currently pursuing a degree in English with a minor in Digital Studies at Davidson. This article has been viewed 10,189 times.
How helpful is this?
Co-authors: 2
Updated: November 22, 2021
Views: 10,189
Categories: Apple iOS
Article SummaryX

1. Install Xcode and CocoaPods on your Apple computer, run your app on an Apple device, and sign into Firebase with a Google account.
2. Create a Firebase project for your app from the Firebase console.
3. Click the iOS+ button on the Firebase console and register your app.
4. Download the "GoogleService-Info.plist" config file and add it to the root of your Xcode project.
5. Create a Podfile through Terminal in the directory of your app project with pod init.
6. Open your Podfile, write pod ‘Firebase/Analytics’, save the file, and run pod install in Terminal.
7. Run open (project name).xcworkspace in Terminal, then import the Firebase module in your AppDelegate class and configure an instance of Firebase App.
8. Return to the Firebase console, then open the Analytics Dashboard and filter the "Users by App Version" graph to track your app installations.

Did this summary help you?
Advertisement