TABLE OF CONTENTS
- 1. Set up a common identifier
- 2. Set up conversion event using firebase
- 3. Set up the cloud function to communicate uninstall data with Trackier
In Trackier MMP, we provide you with an option to track real-time uninstalls for android applications. Setting this up is a simple three-step process:
1. Set up a common identifier
Add the following code to your app to set up a common identifier.
The following fields can also be tracked with the uninstall:
(optional) Application mode:
(optional) Customer user ID:
(optional) Customer email:
2. Set up conversion event using firebase
Firebase analytics automatically collects the app_remove event, you will need to enable that.
This is an Android-only event that is tracked when an application is uninstalled from the device. To set this up, perform the following steps:
- Navigate to the firebase console and select the firebase project that is integrated with your android application.
- From the Firebase dashboard, navigate to Analytics > Events
- Enable the “Mark as conversion” toggle for the app_remove event.
3. Set up the cloud function to communicate uninstall data with Trackier
After the conversion is set up, use the cloud function for Firebase to create a function and send the uninstall data to Trackier MMP.
Your system should have nodejs (https://nodejs.org/en/) installed, preferably version 14 or higher. Run the following command to check the installed nodejs version node -v.
Please make sure that your user in the application’s project on google cloud platform has the permission to create a cloud function here: https://console.cloud.google.com/functions/list
To create and publish a cloud function using Node JS, perform the following steps:
Open a terminal.
Set up Node.js and the Firebase CLI.
Run npm install -g firebase-tools.
To initialize Firebase SDK for Cloud Functions, run firebase login.
From your Firebase project directory, run firebase init functions.
Move to the functions directory, run cd functions.
Open index.js and add the following code:
Open package.json and add the following code:
Open .eslintrc.js and add the following code, create one if does not exist:
Install all dependencies, run npm install.
Deploy the cloud function, run npm run deploy.
Once deployed, you can monitor the status of your cloud function here: