[MUSIC PLAYING]
MEGHA BANGALORE: Getting users to download
and start to use your app can be an all-encompassing driving
goal.
But what about keeping your users engaged
and building on top of that initial honeymoon period?
How do you make sure your app feels really
personalized without constantly shipping
new releases with increasingly complicated workflows?
One way is by using contextual messages
to help guide users to the right content at the right moment.
We'll be sharing examples of how you
can use relevant and contextual messaging to grow your app,
building meaningful engagement and connection with your users.
I'm Megha Bangalore.
TODD HANSEN: And I'm Todd Hansen.
Thanks for joining us.
MEGHA BANGALORE: We're both engineering
leads at Firebase, though we'll see more from Todd in a bit.
When trying to engage your users,
you want to be able to really connect with them, not only
when they're actively using your app, like providing hints
in a game when they're stuck on a level,
but also when they're not using your app.
If there is some critical news that just can't wait.
We'll explore two distinct approaches
to setting up personalized messaging, both in app and out.
I'll start by teaching you how to set up campaigns and nudges
to guide your users to the features
and sections of the app that are the highest value to you.
Todd will show you how to send messages
to topic subscribers via the programmatic APIs.
He'll then dig into some advanced API use cases,
using Analytics Labels, BigQuery, and a new FCM
feature, Direct Boot.
But first, to set the stage--
Todd and I are working to grow our latest
app, a cooking app where users can discover and share recipes
with friends.
A lot of the recipe shared within the app
come from cookbooks.
And I wanted to launch a new integration
to allow users to easily buy the cookbooks that
feature their favorite recipes.
To promote this integration, I created a sale
where cookbooks were 10% off for a limited time.
While we could send all of our users the sale notification,
Todd and I are seasoned app developers
and only want to send the right users this message.
Getting interrupted by an irrelevant message
can be jarring.
And we want to do our best to avoid that.
We used a feature called dynamic audiences in Google Analytics
for Firebase.
For those new to GA Firebase, it's
a great way to track key client-side metrics.
You get a lot of great metrics out of the box,
but can also define custom ones.
Dynamic Audiences are one of Analytics'
superpowered features.
You can cluster your users into segments or audiences
based on in-app actions and behaviors.
For more info on how to set up your audiences,
and Analytics in general, see the links in the description.
I already have my Dynamic Audiences configured,
so now to set up my messaging campaigns.
There are two types in Firebase--
in app and Cloud Messaging.
Let's use both to ensure we're reaching our users
in the most effective way.
But you rightly ask, Megha, why are there
two types of messaging, and how should I be using them?
Great question, my remote friends.
Let's do a bit of comparison.
First, to introduce the messaging types.
Let's start with Firebase Cloud Messaging, or FCM for short.
FCM is a cross-platform messaging solution
that lets you reliably send notifications to your users
when they aren't using your app, with SDKs for iOS, web,
Android, and Unity.
Let's say that I am tootling along, browsing Stack Overflow,
when I get summoned back into my photos
app by this critical notification.
What?
There are chinchillas on the internet
and no one is watching.
My photos app knows that I can't resist a cute chinchilla
and that I love to see new photos instantly
as they get added, even when I'm not currently
browsing through the app.
FCM is perfect for re-engaging users
who aren't using your app.
You're able to send a message to a user's notification bar
and, with the right compelling chinchilla-related message,
bring them back.
Firebase Base In-App Messaging, or FIAM, on the other hand,
provides a fully managed UI to display messages
within your app.
Think a nice card or modal encouraging users
to rate your app or connect their address book.
For example, I'm happily using the app.
And when I go to my profile page,
this triggers a FIAM, encouraging
me to add my hometown to my aesthetics.
FIAM is great for deepening user engagement with users
while they're already using the app.
So let's compare how these two are similar
and how they differ.
Who is eligible for the message?
With both FCM and FIAM, you can use user segments or audiences.
Additionally, FCM allows sending to topic subscribers.
And Todd will dig more into topics soon.
When do they see it?
With FCM, you control when the user gets the notification.
With FIAM, your users actions control if and when
the user sees the message.
If the trigger event is level up, but your user never does,
they will never see that message.
What do they see?
FCM shows as a notification in their system bar.
And FIAM shows as an embedded part of your app.
And finally, how does it get to their device?
FCM sends it on demand.
When the user should see, the message is sent.
For FIAM, our SDK periodically fetches the eligible messages.
Now that we're clear on the differences between FCM
and FIAM, let's go to the Firebase console
and see how you can configure your messaging campaigns.
Both messaging tabs can be found under Grow.
Let's start with FIAM.
Now, if you wanted to run an experiment on the messaging
campaigns, you could click here to configure the experiment
details, specifying what variance to show, et cetera.
To learn more about running experiments, which
you can do with both in app and Cloud Messaging,
check the description.
I already know exactly what I want to send, however.
So let's just run a campaign directly.
Not only that, with the power of some movie magic,
I already have one prepared.
Let's take a look.
First, we start with what message users will see.
There are four template types to choose from.
I recommend the Card type to start with.
There are few more guardrails to help
make your message look great.
You can configure the text and background colors,
set the message title and text, as well as preview
the message over here on the right.
Here, I linked the image that I want displayed.
You can use Firebase Storage or Hosting or really
any URL allowed to host the image.
And note if you want to have different images for landscape
or portrait orientations.
I would strongly recommend you make sure
that whatever is hosting the image is ready for scale
and fronted with a CDN, though.
We want to ensure that all your users will be able to see it.
Here's the primary button click link.
This takes users directly to the Sale page,
with details on how the cookbook promo code works.
You can put a Firebase Dynamic Link here
or use any other deep linking tool
you've configured in your app.
Next, we define who will see the message in target.
I want users who had not bought anything in the last seven days
and who are seen in the app in the last week.
Here, I use the not in with my weekly active purchasers
audience and add an additional condition for app activity.
You can construct any combination of audiences,
user properties, et cetera, to configure
the group eligible to receive this message.
You don't need a special audience per campaign.
You can also define localization options,
either automatically powered by the Google Translate API,
or manually curated by your own localization team.
My Italian in-laws are big fans of my app,
so I can use Google Translate to provide
a translated message that will be sent
to all devices set to Italian.
The default text will show up for any language
that doesn't have a specific translation defined.
Next, we define when a user is eligible for this message
and when they can see it.
I want this to be a limited run, so I
can set the end date for this campaign here.
But more importantly, I set the triggering event.
This is the local event that is used
to trigger the message display.
I want these messages displayed when the user fires the recipe
favorite event and to only show once per device to avoid
dealing spammy.
If it were a critical terms of service update, though,
I might want to configure this message
to show once per day on app foreground for the week
leading up to the change.
Now the reason for this campaign was
to increase in-app purchases.
So I specified the relevant conversion event here
so we can track this as part of our campaign stats.
In Additional Options, there are fields for custom data
that can be sent with each in-app message.
This is metadata that you can programmatically
act on on device.
I want to immediately change the app when
a user clicks on the message.
And by defining in-app messaging callbacks
and specifying this custom data, I can.
See the details for more on handling callbacks in your app.
The campaign is now ready to go live.
But first, there's a review summarizing the key details
to do final verification before it's published.
Now to configure the FCM campaign.
This is actually really similar to the in-app configuration.
So I'm just going to highlight the important differences.
Like before, we start with what your users will see.
Next, we go to who will get this message, which has the option
to pick a user segment, as we had in FIAM,
but also by topic unique to FCM.
Since we want to use Analytics audiences,
we'll stick to user segment.
We specify that the last user app engagement should
have been over a week ago.
This way, we're ensuring that weekly active users are getting
the in-app message, but our less active users
are getting a notification.
It's not necessary to create these disjoint conditions
between in-app and Cloud.
But this way, we can ensure that we bias
towards the contextually triggered in-app message where
possible.
Users are already in your app with the right mindset
to export more.
When we choose the when users will receive this message,
we can also configure it to either use your time
zone or the devices local time.
If I want a nice morning digest to show up
at the right time for both people living
in California and Italy, recipient time
is what I select.
Speeding through here, we see our friendly review screen
and publish to make it live.
Clicking on any of the campaigns in either the FCM or FIAM
dashboards will show the activity of the campaign.
In this case, since we've just scheduled these campaigns,
these are still empty.
Now we've got both our messaging campaigns
scheduled and ready for when our sale goes live
and we're able to engage with our users.
Let's check in with Todd, who will tell you
about another messaging challenge
that we tackled, using FCM topics to send timely messages
via the programmatic API.
TODD HANSEN: Thanks, Megha.
Early Saturday as I'm planning my mini for the week,
I need to figure out a special dessert
to share at my Scrabble game later that evening.
As I'm scrolling through our cooking app, looking for ideas,
it occurs to me that I do this every Saturday
and that others probably do, too.
Perhaps there is an opportunity to send some inspiration
to people that fits their schedule.
On Monday, Megan and I are back in the office in video chat.
Together, we start brainstorming a subscription push service
for recipe ideas.
Users can subscribe to different feeds
of recipes that can be delivered any day of the week.
Megha suggests that we use FCM topic subscriptions
to manage these messages.
It keeps our infrastructure simple.
We just push the messages to each topic at the right time
while FCM takes care of managing memberships
and fanning out messages to interested users.
The whole thing can be automated pretty easily, saving us
time for outdoor activities.
To subscribe a device to a topic,
it only takes a single asynchronous
call to the Subscribe to Topic function.
A single call enables FCM to manage your subscribers
for you.
When it comes time to send a message to a topic,
you can simply call Admin SDK setTopic function.
After you send the topic message to FCM,
the FCM Server handles fanning out messages
to each subscriber for you.
Those previous examples work for Android.
But I want to ensure this feature works well
for different users.
Using the FCM v1 API, I can create different messaging
experiences for different platforms.
As you can see, each platform gets
the upper level parameters and thus overridden
in the platform specific sections below.
Megha is super excited to find out that we even
support watchOS and Wear OS.
Maybe that can be useful when it is
time to create an awesome shopping experience.
Our new feature launches to an enthusiastic audience.
Users are happy to control their recipe subscriptions
and happy to engage with our app's
content on their schedules.
This is a good start.
But if we look deeper, we can find more optimizations
that we can do to improve our app.
Let's examine some of those opportunities.
First, we'll look at using Analytics Label to gather
message delivery and open accounts to understand
which subscription feeds are the most engaging.
Simply add the Analytics Label parameter
to your v1 send message calls.
You can specify different labels for each topic up to 100 labels
total.
After adding in Analytics Label, we
can view the results in our reporting dashboard.
In this case, I am showing the send, received,
and open counts for the Monday launch subscriber base.
It seems to be sending the weekly message daily.
So I had better go fix the code.
I can go a step further and debug specific message delivery
issues using BigQuery.
BigQuery logs specific events for individual messages,
such as message acceptance and delivery.
Using BigQuery data helped us to find out
about direct boot's impact on our app.
When an Android device's OS is updated overnight,
it is unable to receive notifications
until the device is unlocked.
By adding direct boot support to our app,
we are able to greet our customers when they wake up,
even before the device is unlocked.
One aspect we are looking forward to exploring
is driving acquisition of new users to our app
using Firebase Dynamic Links.
When a user wants to share a recipe,
we can make it easier by including a Share
button within our app.
If we use Firebase Dynamic Links,
the Share button can link users directly
to the in-app content they want.
If the user follows a shared link that
doesn't have an app installed, it brings them to the App Store
to install the app, and then directly to the shared content.
This makes it easy for the end user
to consume the content with minimal hassle.
And it brings additional users to our app.
FDL also drives re-engagement by bringing idle users back
into our app naturally whenever their friends share
a new recipe.
As you can see, Firebase Dynamic Links
is a part of our diverse set of tools for engaging and growing
our user base.
Thanks for joining Megha and I today as we
examined how a recipe app uses Firebase Messaging
products to engage its users.
We examined setting up campaigns using FIAM and FCM.
We explored using topics to distribute
user-selected content.
And we investigated advanced concerns,
such as direct boot, Analytics Label, BigQuery data export,
and Firebase Dynamic Links.
Stay safe.
We look forward to meeting you in person at our next Fire
Conf.
[MUSIC PLAYING]