What is real-time uninstall tracking?
Real-time uninstall tracking enables you to track the uninstall immediately after the user uninstalls an app integrated with Firebase Analytics. The Firebase tracks the event app-remove when an app is uninstalled. The app-remove event is used by MoEngage using Firebase Cloud Functions.What are Firebase Cloud Functions?
Cloud Functions for Firebase is a serverless framework that programmatically provides responses to events triggered by Firebase features and HTTPS requests. For more information, refer to Cloud Functions for Firebase.How is real-time uninstall tracking different from the existing uninstall tracking?
The current uninstall tracking in MoEngage happens by sending Silent Push notifications once a day to all user devices. Up to 24 hours is required to track uninstall. Using the real-time uninstall tracking, the uninstall is tracked immediately by the Firebase SDK so that you can respond quickly to user uninstallsImplementation of real-time uninstall tracking
Ensure you have the Firebase Blaze plan account.To deploy Cloud Functions to the runtime environment, your project must be on the Firebase pricing plan.
Set up a common identifier
Ensure your app has integrated Firebase Analytics SDK. For more information, refer to Get started with Google Analytics. Add the following code in your app to set up a common identifier between MoEngage and Firebase.Set up the conversion event using Firebase
Ensure that the App is integrated with Firebase Analytics for real-time uninstall tracking.
app_remove. The app_remove event is, an Android-only event, tracked when an application package is removed or uninstalled from the device, regardless of the installation source. To set up a real-time uninstall make sure that the app_remove event is marked as the conversion event on the Firebase dashboard.
To set up a conversion event, follow these steps:
- Navigate to Firebase Console and select the Firebase project integrated with the app.
- From the Firebase dashboard, select Analytics > Events.
- Enable the Mark as Conversion toggle for app_remove event in the event list.
Create Cloud Function
After the conversion event is set up, use the Cloud Function for Firebase to create a function and send the app_remove event to MoEngage. To create and publish a cloud function using Node JS, follow these steps:- Install Node.js and npm.
Node.js environment is required to write functions. Use the Firebase CLI to deploy functions to the Cloud Functions runtime. - Install Firebase CLI using the following code:
- Run firebase login to log in using the browser and authenticate the firebase tool.
- Navigate to your Firebase project directory.
- Run firebase init functions.
- Select Javascript as a language option.
- Add the following code to the index.js file:
- Add the following code to package.json file: