Firebase can help level up your game:
Log Games events with Google Analytics, a free app measurement solution that provides insight on app usage and user engagement.
Use any of the Firebase products that support games, like Crashlytics, Remote Config, and more.
If you haven't already, create a Firebase project, and then add Firebase to your game (C++ | Unity).
Link your Firebase app to your Google Play developer account. This same link will be used by your Play Games services project.
In the Firebase console, go to the Integrations tab. On the Google Play card, click Link, and then follow the on-screen instructions to create the link.
Make sure that your app in Google Play is set up to use Play Games services.
Log Games events using Google Analytics
Once you've added the Firebase SDK for Google Analytics to your app, you can begin logging Play Games events. Here are some sample events you can log:
Bundle bundle = new Bundle(); mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.LOGIN, bundle);
Bundle bundle = new Bundle(); bundle.putString(FirebaseAnalytics.Param.ACHIEVEMENT_ID, achievementId); mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.UNLOCK_ACHIEVEMENT, bundle);
Scores on a leaderboard
Bundle bundle = new Bundle(); bundle.putLong(FirebaseAnalytics.Param.SCORE, score); bundle.putString("leaderboard_id", leaderboardId); mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.POST_SCORE, bundle);
You can view the logged events in the Analytics dashboard of the Firebase console.
You can also access the Firebase console from the Play Console by clicking the Firebase icon next to your app’s icon in the Game details page.
Troubleshooting common errors
Cannot view Play Games events in the Analytics dashboard
Check that you've enabled Google Analytics for your Firebase project and that you've integrated Google Analytics into your game.
Verify that your code implements events for
Verify the SDK is logging events by enabling verbose logging. Because devices batch events to preserve battery life, it can take some time before these events are visible in the Analytics dashboard.
Cannot link Google Play to Firebase
You need to link Google Play to Firebase using the Firebase console ( > Project settings > Integrations > Google Play). If you're having trouble linking, check the following:
Make sure that your app meets all the prerequisites for linking.
Make sure that you have the required access for creating the link.
Cannot access the Firebase console from the Play Console
Make sure that your Google Play developer account is linked to a Firebase app. In the Play Console, an Owner or Admin of the Play developer account can view the linking status under Setup > Linked Services > Firebase.