[GOOGLE LOGO MUSIC]
PAIGE BAILEY: I'm Paige Bailey, a TensorFlow developer
advocate, and I'm here today with Doug Stevenson, who's
going to tell us all about the latest
and greatest in Firebase.
So show us what you have planned, Doug.
DOUG STEVENSON: OK.
So turns out Firebase has a bunch
of products that help you ensure a high quality
of your app, which is very important for a lot of app
developers.
Every app developer always has to be able to diagnose crashes
in their app--
PAIGE BAILEY: Yes.
DOUG STEVENSON: --as you know.
So Firebase has a tool called Crashlytics.
With Crashlytics, the integration is fairly simple.
Add a plug-in, add a build dependency to your build
and it just starts monitoring crashes.
You don't have to write any lines of code.
So the app is crashing, you can see
that it's rather problematic for our users.
But it turns out the engineers made a good decision
and they put this new home screen experiment
behind a Remote Config flag.
PAIGE BAILEY: So tell me a little bit more
about what Remote Config is.
DOUG STEVENSON: Right.
So Remote Config lets you define key value pairs in the Firebase
console and then you can publish those to your app
without having to actually write any lines of code in your app.
So it gets them all almost immediately as you change them
in the console.
So the idea here is we have a new parameter.
It's called home screen experiment enabled,
and the default value is true.
So this is what's enabling the new home screen
experiment that's also causing devices to crash.
Now, what we want to do here is ask our engineer and say,
our engineer thinks that it's a translation issue.
So we've narrowed it down to Spanish speakers who
are using the app on Android.
So we can define a new condition here for this flag
and say for Spanish speakers who are
using Android what we can do is disable
the home screen experiment.
So we'll set it to false for all of them
and all the other users can retain the value true.
So, now, once this is configured, what we'll do
is publish the store app, and the app internally
will use Firebase Remote Config to fetch parameters, pull out
that home screen flag, and enable the home screen
experiment if it's been enabled for this device.
PAIGE BAILEY: And it's amazing that you're
able to narrow in with such laser focus what
the problem could be, and then to change it without altering
a single line of code.
DOUG STEVENSON: Right, right.
So it's remotely fixing your app in some cases.
And we do recommend that people publish their apps
with new features hidden behind Remote Config flags,
so you can toggle them on and off for cases like this.
PAIGE BAILEY: Right.
DOUG STEVENSON: So we'll publish our new changes
to Remote Config.
We can see that the app is no longer crashy.
PAIGE BAILEY: I see no more sad faces.
DOUG STEVENSON: No more sad faces,
and the number of crash for users has gone up,
so we've reduced the crash rate down to below 1%,
which is really good.
So a successful experiment.
PAIGE BAILEY: That's amazing.
So launch into the next demo.
What do we have next?
DOUG STEVENSON: Yeah.
So another thing that developers need to be able to do
is compare what their users prefer.
PAIGE BAILEY: A/B testing.
DOUG STEVENSON: Perform an A/B test, yes.
So what we can do is use Firebase A/B
testing to create and run an experiment.
So what we can do in the console here
is create an experiment with a name targeting
half of our users with some metrics that we want to track,
and we're going to use Firebase Remote Config again
to configure this experiment.
So, for the control group, dark mode will not be enabled.
And for the variant group, we will enable this experiment.
So Remote Config as it's going to tell
half the devices to run this experiment and half the devices
not.
And we'll compare the metrics on that and see how it performs.
PAIGE BAILEY: And all of this is done through the console.
DOUG STEVENSON: Yes, all of this is done through the console.
So we can see here our experiment is ready to run.
We're especially interested in 15 day retention,
so we're going to use that as the way to determine
whether or not this experiment is successful.
So what we can do is start this experiment.
Bear in mind that Remote Config is
being used to pull out that Boolean flag
and enable dark mode only for those half
of all devices that are configured to use it.
And what we're going to do is run this A/B test,
and that's going to push to our devices.
And, as you can see, some of our devices are running dark mode
and some are running light mode, and they're
switching between the two.
PAIGE BAILEY: I think I like the light mode best.
DOUG STEVENSON: You like the light?
OK.
I'm partial to dark mode but--
PAIGE BAILEY: Well, let's see what the users say.
DOUG STEVENSON: Yeah.
The users get to decide based on our goal metrics.
PAIGE BAILEY: Oh, man.
DOUG STEVENSON: Yeah.
It looks like dark mode is the leader in this,
and we can see the exact mark on the retention
that this experiment had.
PAIGE BAILEY: This is amazing.
I was a data scientist in a previous life,
and, historically, we would have to use
weeks of training and custom code and configurations
and track all of the metrics and visualizations ourselves.
But this looks like you could do it
just by clicking a couple of buttons.
DOUG STEVENSON: That entire engine is basically
hidden by Firebase A/B testing.
So we can use Remote Config and then push it out
to all of our users.
All right.
The last thing that a lot of app developers
are concerned about--
PAIGE BAILEY: And it's probably the most the most important
one.
DOUG STEVENSON: And everyone wants their pages
to load fast and their screens to be snappy.
So what we can do is measure that with Firebase Performance
Monitoring.
Now with Firebase Performance Monitoring,
you put basically one SDK in your app
and it automatically collects things.
And it goes out to your users and it
measures the behavior of your app on your user's devices.
But if you do need to measure something in particular,
like say, the load screen time, what you can do
is create a trace.
PAIGE BAILEY: And so, tell me what a trace is.
DOUG STEVENSON: So a trace is something
in Firebase Performance Monitoring that measures
the duration of something.
So here we're creating a new trace, we're starting a timer.
Then after we load and all of our image
and text for this screen we'll stop the timer.
That becomes our metric.
So that's going to get sent to the Firebase Performance
Monitoring dashboard.
So we're going to run this code on all of our users devices,
collect this metric, and now you can
see here is the trend over time is that 555
milliseconds of load time.
PAIGE BAILEY: That is way too long.
DOUG STEVENSON: It's half a second,
but it still feels like an eternity
and when you click the button.
So what we need to do is bring this down.
Now it turns out this app has been configured
with Firebase Remote Config to have a configurable image
quality.
So the idea is, to speed up the performance for our app,
we'll ratchet down the quality.
Maybe that will make the images smaller and faster to load.
So what we can do is create a condition for this
and say that half of our users get a reduced quality.
So, when we finalize this, half of our users
are going to get the default, the other half
are going to get this reduced image quality.
And then we can compare this in the dashboard.
Now, again, we do need a few lines of code
to enable this in Remote Config.
When that's done, we can collect this information
on our user's devices, exactly as they're using it
and come up with results.
So we were able to reduce the time to 111 milliseconds,
and our engineer thinks this is a good idea.
PAIGE BAILEY: Much faster.
And I agree with them.
And it also looks like you can drill down into the data
by device?
DOUG STEVENSON: Yeah, yeah.
So right now we're slicing this by app version,
but you can also use other characteristics
of the device and the user to determine
what the performance is for very specific conditions.
PAIGE BAILEY: That's amazing.
And I love being able to see the visualizations just out
of the box.
So thank you so much for sharing all of this great functionality
with Firebase.
I can't wait to try out an A/B test.
DOUG STEVENSON: Thanks for joining me.
[GOOGLE LOGO MUSIC]