Get Started with Firebase Predictions

You can use Firebase Predictions to predict user behaviors. Your predictions are automatically available in Firebase Remote Config and the Notifications composer to help you customize the experience for predicted user groups.

This guide shows you how to use Predictions with your app, following these steps:

  1. Add Analytics and any custom events to your app.
  2. Enable Analytics data sharing in your app.
  3. Create and evaluate predictions.
  4. See the effects of different risk tolerance levels.
  5. Use a prediction with Remote Config.
  6. Use a prediction with the Notifications composer.

Add Analytics and any custom events to your app

Before you start using Predictions, add Analytics to your app, and then add any events that you want to predict.

This guide assumes that your app uses the predefined churn and spend predictions that are available when you add Analytics to your app. But, this guide also tells you how to add additional Analytics events to your app so that you can predict other types of user behavior, such as the following:

  • When users spend a virtual in-app currency, as might occur in gaming apps. For this prediction, you need to use the spend_virtual_currency Analytics event in your app.
  • When users share app content, as might occur in most non-gaming apps with some type of social media integration. For this prediction, you need to use the share Analytics event in your app.

To learn more about these events, see Events: All apps.

iOS

  1. Add Analytics to your app, using the instructions in the Analytics get started guide for iOS.

  2. Add additional events that you want to predict to your app, such as spend_virtual_currency or share. For instructions, see the Analytics log events guide for iOS. Use the following Analytics constants to log these events in your app: kFIREventSpendVirtualCurrency and kFIREventShare.

Android

  1. Add Analytics to your app, using the instructions in the Analytics get started guide for Android.

  2. Add additional events that you want to predict to your app, such as spend_virtual_currency or share. For instructions, see the Analytics log events guide for Android. Use the following Analytics constants to log these events in your app: SPEND_VIRTUAL_CURRENCY and SHARE.

Enable Analytics data sharing and Predictions in your app

  1. On the Firebase console navigation bar, click settings and select Project Settings.

  2. On the Project Settings page, click the Analytics tab, and then make sure your sharing setting is enabled to Share Analytics data for all your apps within your project or at minimum to share with the Firebase Predictions product.

    To learn more about sharing settings, see Manage data sharing.

  3. Then, in the Firebase console, open the Predictions section. If you haven't already agreed to the Predictions terms of service, do so.

After you have enabled data sharing and have agreed to the terms of service, Predictions will be enabled for your project. You can stop making predictions any time by disabling data sharing with Firebase Predictions.

Create and evaluate predictions

Regardless of the type of app you are using with Predictions, you should predict whether users are likely to remain engaged with your app. For that reason, you should always create a churn prediction to predict whether users are likely to continue doing things like opening your app or opening app-related notification messages.

The other predictions that you might add depend on the type of app:

  • For gaming apps with some type of virtual currency, such as gold pieces in an adventure game, you should include a prediction based on the spend_virtual_currency Analytics event.
  • For non-gaming apps with a social component, such as sharing stories from a news app using SMS or social media, you should include a prediction based on the share Analytics event.

Depending on the number of users and Analytics events, you might be able to use these predictions as soon as a day or two after you start collecting these events from your app users.

For instructions on creating a prediction, see Create a prediction.

See the effects of different risk tolerance levels

When you use a prediction to target users in Remote Config and the Notifications composer, you need to set the risk tolerance level to manage the tradeoff between targeting more users with lower accuracy or fewer users with higher accuracy.

You can preview the effects of each risk profile on targeting accuracy and the percentage of your users that will be targeted by adjusting the slider on the Predictions cards in the Firebase console.

Use a prediction with Remote Config

Predictions are automatically available in Remote Config.

How you use a prediction to change the behavior and appearance of your app for users in a predicted group depends on how you are using Remote Config in your app. Below are two examples of how you might use one or more predictions with Remote Config in a gaming app and in a non-gaming app:

  • For gaming apps with some type of virtual currency, such as gold pieces in an adventure game, you could change the game to reduce in-game virtual currency prices for users who are predicted to spend by recent spend_virtual_currency Analytics events. Because virtual currency does not impact revenue for this app, it might make sense to use a high risk tolerance.
  • For non-gaming apps with a social component, such as sharing stories from a news app using SMS or social media, you could change your app to make the sharing UI more prominent for users who are predicted to share app content based on recent share Analytics events. Because such a change would be unlikely to have a negative impact on users who were incorrectly predicted to share app content, it makes sense to use a high risk tolerance.

For instructions on adding a prediction to Remote Config, see Use a prediction with Remote Config.

To learn more about risk tolerance, see Prediction Risk Tolerance.

Use a prediction with the Notifications composer

Predictions are automatically available for targeting in the Notifications composer.

Below are two examples of how you might use one or more predictions with the Notifications composer in a gaming app and in a non-gaming app:

  • For gaming apps with some type of virtual currency, such as gold pieces in an adventure game, you could send a notification message advertising certain in-game goods to users who are predicted to spend based on recent spend_virtual_currency Analytics events. Because users who spend virtual currency are already engaged with using your app, it makes sense to use a low risk tolerance in this situation (to avoid annoying users who are already engaged).
  • For non-gaming apps with a social component, such as sharing top stories from a news app using SMS or social media, you could send notification messages to users who are predicted to share app content based on recent share Analytics events. Because users who share news stories will probably like being the first users to learn about top stories, such a change would be unlikely to have a negative impact, so it makes sense to use a high risk tolerance in this situation.

When you send a notification to a group, the notification is directed only to users who are members of the group at the time you send it. Users who join the group after you send the notification will not receive the notification until you send it again.

For instructions on adding a prediction to the Notifications composer, see Use a prediction with the Notifications composer.

To learn more about risk tolerance levels, see Prediction Risk Tolerance.

Şunun hakkında geri bildirim gönderin...

Yardım mı gerekiyor? Destek sayfamızı ziyaret edin.