[MUSIC PLAYING]
TODD KERPELMAN: OK, let's talk Audiences.
Audiences are a powerful and sophisticated tool
within Analytics that lets you create groups of users
who meet certain criteria.
They can be very broad, like people
who have made an in-app purchase in the last 30 days,
or very narrow, like Canadians who are fans of yoga
and have completed three exercises
in a seven-day period, but haven't yet signed up
for my premium service.
And you can then use these Audiences
in many different ways.
You can filter all your Analytics reports
and Dashboards against a specific Audience,
in case you wanted to see, for instance,
how your spenders behave compared
to the rest of your users.
You can send Cloud Messages or in-app notifications
to a specific Audience to make sure you're
targeting just those users who are
likely to care about your notification,
without bugging the rest of your users.
And you can send different Remote Config values
to certain Audiences to deliver a customized experience
to just one group of people.
And you can target these Audiences
in remarketing campaigns in Google Ads.
Now, if you're a longtime Analytics user,
you may have noticed that Audiences have gotten more
powerful over the last year.
There are more dials and levers you can adjust,
and there are more logical operations
you can apply to create some pretty sophisticated rules.
Also, we removed one very big limitation from the past.
It used to be that once your user joined an Audience,
they would never leave, which was confusing
and often quite limiting.
But now we let your users leave an Audience once they no longer
meet the conditions that put them in this Audience
in the first place, which is generally
how you expect them to behave.
Of course, if you still prefer the old behavior,
you can do that too.
But this dynamic behavior is the new default.
Now there are two limitations you should still
be aware of, however.
First is that Audiences are not retroactive for most Firebase
products.
When you first create an Audience,
it will initially be empty when you're
trying to use it with products like Remote Config or Firebase
Cloud Messaging.
So when you create an Audience, you'll
need to wait for the clients to retrieve that Audience
definition, and then determine whether or not
that user belongs to a specific Audience.
Additionally, if your Audience depends
on an event being triggered, like making a purchase,
you'll need to have that event happen again on the client,
before the client decides to place
that user into an Audience.
For that reason, I often recommend
creating a few Audiences you think
you're going to need before your app has a lot of users.
On the other hand, if you're an app advertiser,
you can use these very same Audiences right away
for things like remarketing campaigns,
and they will be pre-populated based on your user's
previous behavior.
I know this is weird.
And the reason behind this is a policy issue, not
a technical one.
And I don't know, maybe this is something we can smooth out
in the future.
Now, the other important limitation is that Audiences
that include your user's gender, age, or interests-- you know,
the data that's supplied for you by Google--
can't be used for a Remote Config or notification
targeting.
They can only be used for building certain ad
campaigns like display campaigns or filtering your Analytics
data.
And again, this is more of a policy
issue than a technical one, and I don't expect
this to go away anytime soon.
But let's go over a few concrete examples
here so you can see what it's like creating
a new Audience using Analytics.
We'll start with a simple sample app,
then move on to something a little more sophisticated.
Now in the last couple of videos,
we've been looking at this fantastic app where
I have a button, a slider, and a switch our users can play with.
Each of these UI elements generates their own Analytics
event.
In addition, we've been asking people whether or not
they're a dog person or a cat person
and setting that value as a user property.
So now, let's say that one day our marketing department
decides that we need to send notifications to all of our dog
users who have clicked the button in our app
so we can let them know about a great new in-app sale.
Let's find out how we can create an Audience of just
these users.
So here I am back to my sample app on the Analytics page.
Looks like it's not quite the mega hit I was hoping for,
but that's OK.
I'm going to jump in the Audiences panel.
Now you'll notice that Firebase already
has two Audiences set up for me, All Users and Purchasers.
To create my new Audience, I'll click New Audience,
and this panel slides over.
Down here are a few suggested Audiences
and templates I could use to kick start the process.
These suggestions might change depending on the app you have
and the events you're recording.
They're definitely worth checking out
if you want to start playing with Audiences,
but aren't quite sure exactly what to build.
In my case, though, I know what Audience I want.
So I'm going to start by asking to Create a custom Audience.
Now I can give my Audience a name and a description.
And down here is where the real work gets done,
selecting which users get to be a part of my Audience.
In general, I have three categories
of things to choose from here.
Dimension is basically just another way
of saying user properties right now.
Metrics tend to be calculated user properties,
like lifetime value.
And then we have Events which are the Analytics events
that we've generated in our app.
So I'm going to select Dimensions first.
We have a bunch of automatically generated user properties,
things like the user's Age or OS version, and then Registered
properties.
These are the custom user properties
that I've created for my app and registered in the Firebase
console.
And right here is my dog or cat property.
So I have a bunch of comparison operators here.
The top ones are for text.
These bottom ones tend to be for numbers.
So this is text.
So I'm going to select "exactly matches" here.
And Analytics will helpfully provide me
with a bunch of values it's seen in the past.
I will select dog person.
And if I leave this "At any point" button unchecked,
which is the default, then this Audience
will only include people who are currently dog people
and will remove them from the group
if they decide to become cat people.
Now if I were to check this, then this
would include anybody, if they were ever a dog person,
even if they changed their mind later and become a cat person.
Now for the second part of my Audience definition,
I'll click the AND button here.
I'll select Events.
And down here is my press_button event.
Now I can just leave this as-is, and Analytics
will interpret this as the press_button
event was triggered.
And that's actually all I need for this Audience.
If I wanted to, I could make this explicit, I suppose,
by adding a parameter here.
I could select event_count.
This is a special event parameter
that notes the number of times an event has been triggered.
And then I could make this, say, any value greater than 0.
This "in any x-day period" checkbox here shows up
when you add event counts.
It's basically useful if you want
to find users who trigger a certain event multiple times
in a certain time period.
For example, let's say I was interested in users who
were frequent button clickers.
If I just left this at, like, people
who click the button five or more times,
that wouldn't really get at the Audience
I'm interested in because even people
who just click that button once a month would eventually get
included in my frequent button clickers library,
you know, after five months.
On the other hand, if I make this people who
click the button more than four times in a two-day period, that
sounds a lot more like the Audience I'm after.
But, you know, let's just revert this back to be more basic
form for now.
Now let me call out three other things here.
First, you can see here that this conditional scoping option
up here tells us that our users have
to meet both of these conditions at any point to be included
in this Audience.
This means that a user could click this button
and later become a dog person, and they would then
be added to my Audience.
If I wanted my Audience to only include
people who are dog people at the time they click this button,
I could change this dropdown to within the same event.
The second thing you might notice
is that I have a Membership duration selector here.
This basically means that once a person qualifies
for an Audience, they remain in that Audience
for a certain amount of time before they basically
need to requalify for it.
So right now, our dog people will
stay in this Audience for 30 days
after they click on a button.
If our dog person were to click a button again 15 days later,
the countdown basically restarts,
and they get to stay in this Audience for another 30 days
after that.
This also means that if a dog person decides
to become a cat person, they will still
remain in our Audience for 30 days
before they get kicked out.
Now you can set this to any value like up to,
I think, 540 days.
But if you're planning on using this audience
for notifications, you might want
to keep this duration to something like 30 or 45 days,
so that you're not bugging people who stopped
using your app a year ago.
Finally, over here you can see Analytics has given me
a pretty good estimate of how many people
are in this Audience based on the last 30 days of data
I have from my app.
Now remember, my actual Audience for most purposes
starts off with zero users and grows over time.
This thing here is basically an estimate.
So I'm happy with this basic Audience.
I'm going to go ahead and click Save to save it.
Now, once this Audience fills up with users,
I can do things like filter my event counts
based on this Audience, or target them
in Firebase Cloud Messaging, or use them to define conditions
in Remote Config.
So those are the basics of Audiences.
Now I'd like to introduce you to some more advanced features
before we go.
And for that, I'm going to head over
to a game called Bingo Blast because it probably
more closely resembles an app in the real world.
Now this is a bingo type of game that contains
a lot of different events.
It tracks when players start a game, purchase in-game items,
calls bingo and finishes a round.
Now the round_completed event is an interesting one,
because it contains a lot of data around the type of game
they played.
Did they play a single player game or a social game?
Did they use any power ups?
How many bingos did they get?
And what was their final score?
So the first thing I'm going to show you
is that you can create Audiences based
on users who have events with specific event parameters
that meet a certain criteria.
For finding people who have gotten a score of 40,000 points
or more in a round, I would do that
by selecting the round_completed event.
Then select Add parameter, select the score parameter,
and set that to be greater than or equal to 40,000.
And if I'm just looking for my expert multiplayer users,
I can add another condition so that we're
looking for users who have scored
more than 40,000 points while also playing the social game.
The one thing you can't do here is combine these event
parameters with that event_count parameter
I was talking about earlier.
So for instance, I can't say let's find
people who scored 40,000 points three times in the last week.
You'll notice that the event_count parameter isn't
available anymore in this dropdown,
now that I've select my score parameter.
And if I were to do something like this,
this wouldn't work either.
I'm basically saying, let's find people
who scored 40,000 points and people who
have played three games, but those three games
don't need to be high scoring ones.
These are basically two completely separate conditions.
Now there is kind of a workaround for this, which
I'll get to later in the video.
For now though, let's talk about a few other advanced features.
One of my favorite new features is the Exclude Group.
As the name suggests, this allows
you to remove people from your Audience
if they meet a certain condition.
One very common use case for this
is if you want to find people who have started a purchase by,
like, visiting your in-app store or adding
an item to their cart, but never completed a purchase.
In fact, let's create an Audience
that does exactly that.
In Bingo Blast, people make in-app purchases
by visiting the shop, selecting an item to start the purchase,
and then triggering the in-app purchase event
once they complete the payment.
So if we want to create an Audience of people
who can't seem to commit to making a purchase,
that's easy to create now with these Exclude Groups.
So I'm just going to create an Audience of people
who have triggered the store_purchase_started event.
And then I will exclude users who have triggered
the in_app_purchase event.
Notice how I have the option to temporarily exclude users
or permanently exclude users.
If I were to pick temporary, users
would be allowed in the Audience once they no longer
meet this exclude criteria.
I think in general you're only going
to care about this setting if you're excluding users
based on dimensions or user properties.
You'll notice this doesn't really
make a difference in my example, since I can't really untrigger
an in-app purchase event.
These exclude groups are really useful for finding people
who maybe need a little nudge or a coupon code
to trigger some important conversion
event in your app, things like completing a purchase,
sharing the app with their friends, writing a review,
or completing your tutorial.
Audiences is also give me the ability to logically "and"
and "or" these different conditions together,
and they kind of work the way you expect.
Like, I can create an Audience of users
who clicked on an ad OR made an in-app purchase,
or people who are signed into my app AND completed
the tutorial AND are male AND signed in AND
have their device language set to English.
You might notice I can perform ANDs in two different ways,
by ANDing different conditions together here,
or by adding a completely different condition group.
In general, there's not much difference between these two.
The difference would be if I want different scoping
across these two groups.
Like, I might want to create an Audience of users
who start AND finish the tutorial in the same session
AND also people who played both a social and a solo game
across different sessions.
But that's definitely moving to some advanced features there,
so don't worry too much about this.
Finally, the last big feature I want to talk about
is being able to create an Audience based on Sequence.
Again, as the name suggests, this
lets you select groups of users who perform one action and then
another in sequence.
Now you can require that these happen in a strict order,
or you can allow other events to happen in between these events.
And you can specify that these events
have to happen within certain time windows of each other.
So in Bingo Blast, before your round is over,
you have a chance to use a time extender
power-up which is tracked by the use_time_extender event.
Now I want to find people who use this power-up
and then ended the round by getting at least one bingo.
That's going to require a sequence of events,
so let's build that now.
So I can initiate a sequence made up of a series of events
by clicking this Add sequence group.
The first step will be triggering
the use_time_extender event.
I'll click Add step.
And then the next step here will be hitting
the round_completed event.
And then maybe just to make sure I'm including people
who found time extenders useful, I'll
make sure the bingos_claimed parameter is one or more.
Great.
Or is it?
Now there's an issue here.
Right now, this will include anybody
who's used a time extender followed by anybody who
triggered this round_completed event at any time,
right, whether that's shortly after using the time extender,
which really is the group I want, or, like,
completing a round in a totally different game two weeks later.
So I can fix that by adjusting how these events appear
in this sequence.
Right now, you can see this is set to
"is indirectly followed by."
That's basically our way of saying,
"Eh, I don't care what other events happen in the meantime,
just as long as this second event happens sometime
after the first one."
And that could be nothing, or it could be two weeks' worth
of data.
Now, you might think that the way to fix this
is to make this direct, which means that the second event has
to appear directly after the first one with nothing
else in between.
But in fact, you can see that if I do this,
my estimated user count drops to zero.
This is because my app generates a lot of events, including
bingo_button_highlighted, that are bound
to appear between these two events, which
means that these two events will almost never directly appear
one after another.
For that reason, I'm not really a fan of using directly
follows in these kinds of sequences.
I think it's really easy to accidentally break
one of these Audiences when your Analytics team decides
to instrument some other event in this time sequence.
If they've forgotten about this Audience definition,
you're going to lose a bunch of users.
Instead, let's fix this by adding time constraints
instead.
Given that our time extenders add only about 30 seconds
of time, I think it's safe to say
that if you hit this round over event within, say, one
minute of this time_extender event, then
we're talking about events that happened in the same game.
So let's go back to my sequence of events,
make this indirect again, and then let's
say that this second event has to happen within one
minute of the previous event.
And now, it looks like I have a group of users
who tried a time extender and then
completed a game successfully, probably
a good group to target if I were to ever hold
a sale on these items.
And by the way, this is how I found
a workaround for that "create an Audience of people
who have scored three or more high scoring games" issue.
Basically, I can set up a sequence of events
where in each step of the sequence,
a user has to trigger a round_over
event with a high enough score.
I repeat that for three steps.
And then up here, I can say that the user
has to complete this entire sequence in, say, seven days.
That will help me figure out who my real expert players are.
So there you have it.
Like I said, Audiences have gotten
quite a bit more powerful over the last year or so.
So if you haven't given them a look lately,
they're definitely worth revisiting.
And hey, if any of this chat around events or user
properties has you mystified, make
sure you check out some of our other Analytics videos
in the description below.
And hey, why not subscribe to the Firebase channel
so you don't miss out on other important and exciting
tutorials?
And as always, thanks for watching.
[MUSIC PLAYING]