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.
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 the 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:
In SDK_KEY you need to enter KEY that you will find on the panel while adding application, you can go to SDK Integration page from the panel, to access the key.
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: