Things To Gather
- CocoaPods
- A good text editor. I use Sublime Text, but you can use Brackets, XCode, or even TextEdit if you like.
- A terminal/emulator. I use the native Terminal.app
- The sample app from our previous post (or your own app)
- Cheat Sheet: This post’s updated sample app if you like (plus your own
GoogleService-Info.plist
file)
- Cheat Sheet: This post’s updated sample app if you like (plus your own
Let’s start off by making sure we have a new Google Analytics property since it takes a bit for the data to show up when making a new property (maybe I’m just impatient). Then head on over to https://console.firebase.google.com/ and create a new project.

On the next step, I made sure to enable Google Analytics as this will give me access to “A/B testing, user segmentation & targeting across Firebase products, predicting user behavior, crash-free users, event-based Cloud Functions triggers, and free unlimited reporting“. I chose the property I built earlier, and I’m off and running.
Once that hurdle is cleared, I chose the iOS option up top.

Adding Firebase
The remaining parts all focus on getting it set up on the app now.
After registering it with the details from by sample app, it prompts you to download a config file named GoogleService-Info.plist
and import it to XCode.

Head on over to your terminal now.
If you have never installed CocoaPods, it is a dependency manager that we will use to pull the Firebase files down with. Stop here, and head over to https://guides.cocoapods.org/using/getting-started.html to run that install first.
If you have already installed CocoaPods, continue below.
From a terminal screen, head over to the folder you have the app in initialize the podfile.
pod init

Next, add the pods we will pull just below the use_frameworks!
line.
# add the Firebase pod for Google Analytics
pod 'Firebase/Analytics'
# add pods for any other desired Firebase products
# https://firebase.google.com/docs/ios/setup#available-pods

Now we are ready to call the pods down and install them to our folder.
pod install

This next step is key to being able to proceed; I’ve skipped it many times and couldn’t figure out why it was failing to compile so make sure you follow this step:
Close the XCode project if it is open and make sure you open the newly created .xcworkspace
file instead of the .xcodeproj
file.

Head over to the AppDelegate.swift
file and let’s a) import Firebase, and b) register it with the appDelegate class.
import Firebase
FirebaseApp.configure()

Now, just build and run the app! If you head back over to the Firebase page where you were going through the steps, you should see a success message at the bottom now that you ran the app!

Done!
Thoughts
As I’ve mentioned on my initial post here, I work for Adobe as an architect, and one major difference I will call out here is that Google Analytics automatically collects and logs some events and user properties, including screen views. This is helpful because, at this point in this demo, we appear to be tracking anytime a user engages with our app without doing anything other than adding the SDK.
I can think of at least one reason for this: this version of Google Analytics is free. What I mean is that the developer doesn’t have to decide whether or not to expend a server call against their yearly contract, so why not tag everything? In my personal opinion, this is helpful if you are a small, non-enterprise size company, but it would seem to me hard to scale when you are a larger business, in particular because it is sesquipedalian, what I mean is the “view/page names” while OOTB, are able to be so because it collects the screen_class
name as the view name
Ok, let me be more clear. This means that your analysts would be sifting through things like main_screen_controller
and funnelStep4NewFlow-Android-Upgrade-User_Details
instead of Gil App : Home
and Funnel : Personal Details
.
Not to say you can’t manually change the viewname to something more friendly in Firebase (you can), it is just something we should understand before lauding the “OOTB-ness” of Firebase.

Thanks
Well, that’s our first walkthrough! Thanks for hanging in there, and I would appreciate any feedback, amendments, corrections, or encouragement in the comments! 👇🏼