In-App Messaging With Firebase
Welcome to Firebase In-App Messaging & Analytics. With these services, you can segment your user base and provide a personalized user experience in the form of in-app messages. By James Nocentini.
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress, bookmark, personalise your learner profile and more!
Create accountAlready a member of Kodeco? Sign in
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress, bookmark, personalise your learner profile and more!
Create accountAlready a member of Kodeco? Sign in
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress, bookmark, personalise your learner profile and more!
Create accountAlready a member of Kodeco? Sign in
Contents
Targets
Targets allow app developers to specify which users will receive the message. Campaign targets become more useful as you collect data through behavioral analytics.
You can define a target audience by various parameters including:
- Which app version a user has installed.
- Automatically collected events like a click on an ad.
- A defined user audience based on factors like the user’s age or language.
- A user property like geographical location.
- A behavior prediction that the user will or won’t trigger an analytics event like a flight booking.
Since the “Travel Exp” project is completely new, you’ll start by targeting a message to all users. Later, you’ll learn how to use behavioral analytics to specify the campaign target.
For now, return to the Firebase dashboard. With your campaign still open, click Next to proceed to the Target section. Set the Campaign name to Art Expo. Select com.raywenderlich.android.travelexp as the app target and click Next.
Scheduling
You can send in-app messages at different times including:
- Immediately.
- At a defined date and time in the future.
- When an event is triggered.
For this tutorial, you’ll send an in-app message when a user purchases a new booking. On the Firebase Dashboard, click Next to proceed to the SchedulingEvent + to add a new event and insert on_booking as the event trigger.
Conversion Events
Conversion events help you measure the effectiveness of a messaging campaign.
Developers use attribution analytics to measure the effectiveness of their advertising and growth campaigns. This tutorial will not cover that aspect of in-app messaging campaigns, but you may read about conversion events here.
Running Your Campaign
Build and run the app. This time, select airports under the From/To label and pick a favorite activity. The in-app message should arrive immediately now, because you added the on_booking event.
Note: Firebase by default restricts you to sending a message to your users once a day. This is to restrict you spamming your users with messages.
If your message isn’t being received by your device, this could be the reason why. In this case, delete the app, build it again and try the steps again.
Note: Firebase by default restricts you to sending a message to your users once a day. This is to restrict you spamming your users with messages.
If your message isn’t being received by your device, this could be the reason why. In this case, delete the app, build it again and try the steps again.
Using Analytics for Personalized In-App Messages
Let’s imagine that you’ve built up a catalog of experiences over time and you’d like to use it to personalize your suggestions. For example, you may want to suggest tea tasting events only to users who ticked the drink tea checkbox. In order to personalize the in-app message, you need to have some idea of what a user likes and dislikes.
Behavioral analytics is a method of collecting raw event data of an application to gain new insights into user preferences. You can apply behavioural analytics to a mobile application with the Firebase Event API. For example, the application could log a new event every time a user books a flight.
From the Firebase dashboard, you then have the option to create different user audiences based on the collected events. For example, you could create an audience for each Activity (Art, Board games, Cheese, Flying cards, Drinking tea) and send different in-app messages to each audience.
During development with Firebase, you can enable the DebugView in order to view logged events immediately on the dashboard. However, it is important to note that for any business analysis operations, it can take up to one day for logged events to be available on the Firebase dashboard. You can read more about this time delay on the Firebase blog.
Where to Go From Here?
Congratulations on completing this tutorial!
You’ve learned how to configure Firebase In-App Messaging in your app and how to target campaigns to different user audiences.
You also touched on the importance of using behavioral analytics to segment your customer base. Behavioral analytics can help you to personalize the user experience in your app.
There is much more to Firebase In-App Messaging, such as:
- The possibility to include deep links in messages.
- The ability to modify the message UI.
Of course, feel free to leave comments and suggestions in the forum below! Especially about what you enjoyed and how we can improve the tutorial in the future. :]