Showing posts with label Santa Tracker. Show all posts
Showing posts with label Santa Tracker. Show all posts

Wednesday, 3 May 2017

Five Firebase I/O Sessions I'm Excited About

Todd Kerpleman
Todd Kerpelman
Developer Advocate

Over the last few weeks, I've had many of you approach me with questions like, "Hey Todd! I'm super excited to be going to I/O this year! What sessions should I go to?" And my answer has always been the same: "Who are you, and how did you get into my apartment?"

But yeah, I can understand that picking sessions at I/O can feel overwhelming. Between the VR awesomeness and the new Android O stuff, Google I/O has a lot to offer. And while the Firebase VR Data Viewer is still a work-in-progress, there's still plenty of great Firebase content for you to check out this year.

Of course, asking me to pick my favorites among all the sessions is like asking me to pick my favorite child -- I love all of them equally1. But with that said, here's a few Firebase sessions that I'm certainly looking forward to next month:

Supercharging Firebase Apps with Machine Learning and Cloud Functions -- This combines two of the most intriguing (for me, anyway) technologies happening in cloud-land. First, you've got Cloud Functions for Firebase, which essentially allows you to run server-side code based on events happening within your app, and then there's Machine Learning, which is still basically, "We're living in the future" kind of wizardry as far as I'm concerned. Combine them together, and you can pull off some really cool features to enhance your mobile app. Or, in this case, a giant crowdsourced game.

Firebase Analytics: Overview and Updates -- Apparently, launching StreamView wasn't enough for the Analytics team. They've got a whole bunch of other new features popping up, including what might be the most commonly-requested feature since they launched last year. (No, it's not changing all the fonts to Papyrus. That's just my most-requested feature.) What is it? You'll just have to swing by the session to find out.

Zero to App: Develop with Firebase -- This is one of our most popular sessions from last year, and it's been brought back for 2017! We're gonna bring up four Firebase engineers for a realtime cross-platform app development deathmatch! But… uhhh... without the "death" part. HR wouldn't allow it. I've been told this year, there will be some Cloud Functions involved and possibly some other new twists and turns to keep things interesting. Will they end up with a real app by the end of the session? Or will Mike be unable to compile his code because he forgot a semicolon? Only time will tell!

AdMob and Firebase Analytics: Better Together -- Remember those Reese's commercials from the 80's, when people apparently walked around with open jars of peanut butter all the time? Well, this talk is a little like that, but instead of resulting in a delicious candy, you end up with some solid ad-driven analytics-backed monetization strategies for your app. Which you can then use to go and buy your own peanut-butter cups.

Shipping Santa Tracker: Carefully Rolling Out a Feature to a Million Users -- What happens when you've essentially got one day to launch an app to millions of people around the world with a whole slew of features that you've never really tested before in front of a large audience? You would think "mass chaos and hysteria", but in Santa Tracker land, things were as smooth a baby elf's bottom. Come by and listen to Sam and Dan tell you how they were able to pull it off. I know it's an early session, but they promised me there'd be costumes. So that might be worth rolling out of bed for.

So there ya go! Five Firebase sessions you should definitely keep an eye on. Not able to make it to I/O in person? Don't worry! All of our presentations will be available either in the livestream that day, or in the Firebase YouTube channel a few days later.


  1. Well, except you, Janice. Are you really going to use emacs over vim? You're breaking your mother's heart. 
Share:

Tuesday, 27 December 2016

Monitoring Santa Tracker with Firebase

Doug Stevenson
Sam Stern
Developer Programs Engineer

The Santa Tracker app for Android is a Google holiday tradition. Every year, millions of people around the world use the app to play games with elves and reindeer and, of course, track Santa, as he flies around the world on December 24th. While the app is live for a few months each year, about 90% of our usage occurs in the last two weeks of December. In order to turn around improvements to Santa Tracker quickly over this time, it's critical that we can monitor and adjust the Santa Tracker app remotely. This year, we decided to go all-in with Firebase as our monitoring solution. In this blog post, I'll talk about how we use a combination Analytics, Crash Reporting, and Remote Config to maintain a high level of quality, without ever having to republish the app.

Firebase Analytics

As users navigate through the app we use Firebase Analytics events to record their behavior. Most of the mini-games in the app live in their own Activity classes, so we can use Firebase Analytics' automatic screen tracking feature to record these events without writing any code.

For events within games we use custom events to record important user actions. For example after the user finishes playing the "Penguin Swim" game, we record the event swimming_game_end with custom parameters score and num_stars. In the first week of December we noticed that 85% of users were getting zero stars when playing the Penguin Swim game. Clearly, the game is too hard, we were hoping that only 60-70% of users would get a score this low! We were able to correct this using Remote Config, which I'll talk about later.

The other feature of Analytics that we put to use is user properties. At the start of each Santa Tracker session, we use user properties to record some information about the user's device. These properties are then attached to every analytics event. Since Santa Tracker is used all over the world, we get a lot of diversity in the devices people use. These user properties help us to make sense of our analytics data. Some examples are:

API_LEVEL The API level of the user's device, like 23 for Marshmallow or 21 for Lollipop.
DEVICE_BRAND The brand of the user's device, such as Samsung for the Galaxy S7 or Google for the Pixel XL.
DEVICE_BOARD The processor or specific SoC name for the user's device.

The combination of our custom events and user properties with Firebase Analytics' automatically tracked events enables us to get a good understanding of what our users are doing in the app by looking at the Firebase console.

Firebase Crash Reporting

Despite our best efforts, the Santa Tracker app is not perfect. With millions of users on hundreds of device types in dozens of countries we are constantly discovering new bugs in the wild. Firebase Crash Reporting lets us see all of the fatal errors in our app within a minute of their occurrence. Since Firebase Analytics events show up in Firebase Crash Reporting logs we can see the progression of events before the crash which was very helpful in diagnosing some issues.

For example there's an OutOfMemoryError crash which seems to happen during the "Penguin Swim" game on some low-RAM devices. We did not see this error during our testing, but the Firebase Analytics data in Crash Reporting tells us that this occurs when playing the game repeatedly.

This integration is invaluable in helping us to reproduce issues that our normal QA setup does not find. We can get the exact device model and then use the analytics log to recreate the crash conditions.

Firebase Remote Config

Once we have analyzed the data from Analytics and Crash Reporting, we need to make changes in the app to improve the user experience. Due to the short active life span of this app there's no time to go through the full development lifecycle of the app to publish changes, and we don't get a second chance at Santa's big day!

Santa Tracker uses Firebase Remote Config to gate access to various features, and to provide remote fine-tuning for experiences in the mini game. For example, in the "Penguin Swim" game, there are two key variables we store in Remote Config:

SwimmingObstacleDensity Control the density of ice cubes and other obstacles in the game, a lower density makes the game easier.
DisableSwimmingGame A kill-switch to completely hide the game from the app.

As mentioned earlier, users were having a hard time getting a score higher than zero stars in the game. In order to make the game more fun, we changed SwimmingObstacleDensity from 1.5 to 1.1, which made it much easier for users to dodge obstacles. By making the game easier in this way, the percentage of users getting 0 stars went down from about 85% to 70%. This change took place instantly over the air, with no need to publish a new version of the app!

Right now the OutOfMemoryError in the swimming game happens for <1% of users. But if this issue became rampant, we could use the DisableSwimmingGame flag to immediately hide the game from affected users whilst we resolve the issue. By taking advantage of the fact that Analytics user properties can be referenced in Remote Config, we can even disable the game only for certain device types! For example, let's say the Penguin Swim stopped working on all KitKat devices (API level 19).

First, we add a condition based on user properties:

Next, we disable the game only for users who match the condition:

Now the game will only appear for users who will have a stable experience, which will lead to fewer crashes for our users and more positive app ratings for us.

Final Thoughts

Adding deep Firebase integration to Santa Tracker gives us the ability to monitor and fine-tune the app over time without releasing app updates. As developers, it's invaluable to have a clear picture of what our users are really doing and how we can improve the app. Throughout December we knew we could rely on Firebase to give Santa Tracker users a magical holiday experience.

Share: