Uninstall/Reinstall Tracking
Use the Adtrace Android SDK to measure "uninstall"s and "reinstall"s. Adtrace uses push tokens to send silent push notifications to your users' device, and checks if your app is currently installed.
Use the following instructions to add this functionality to your app.
Uninstall and reinstall measurement is effective for apps distributed through any app store or direct download, as long as the device has Google Play Services installed. Devices without Google Play Services are not currently supported, such as Amazon and Huawei devices.
to enable Adtrace to track uninstalls and "reinstall"s make sure to complete related parts in panel.
Before you begin
Here's what you need to know before getting started.
Requirements
Connect Google FCM to Adtrace
Configuring silent push notifications through Google's Firebase Cloud Messaging (FCM) API allows you to measure uninstalls and "reinstall"s. Adtrace requires an FCM HTTP v1 API private key to connect to Google FCM.
Generate a new FCM HTTP v1 private key rather than using a legacy service key. Google will sunset the Cloud Messaging API (Legacy) on June 20, 2024.
Google Cloud console
1. Create a custom role for Adtrace Uninstall and Reinstall Measurement
- Access your Google Cloud Console.
- Select the Google Cloud project associated with your Firebase project.
- Search for IAM & Admin.
- From the side menu, select Roles.
- Select + Create Role.
- Enter the following details:
- Title: Adtrace Uninstall
- ID: adtrace_uninstall
- Role launch stage: General Availability
- Select + Add Permissions.
- In the Enter property name or value field, enter
cloudmessaging.messages.createand select it from the search results. - Check the
cloudmessaging.messages.createoption and select Add. - Select Create.
2. Create a service account
- From the side menu, select Service Accounts.
- Select + Create Service Account.
- In the Service account name field, enter
Adtrace Uninstall Service Account. - Select Create and Continue.
- Select the Select a role dropdown. Enter
Adtrace Uninstalland select it from the search results. - Select Continue.
- Select Done.
3. Generate and download the private key
- Select the newly created service account. The format looks like this:
adtrace-uninstall-service-account@test3-55065.iam.gserviceaccount.com. - Select the Keys tab.
- Select Add Key > Create new key.
- Select JSON and then Create.
Finally, the private key is downloaded as a JSON file to your computer.
Adtrace Panel
Add an FCM connection to your application in Adtrace panel
Integrate with the Adtrace SDK
Follow these instructions to integrate FCM with the Adtrace SDK:
- Ensure that you have the required dependency for Firebase Messaging in your
build.gradlefile:
To send us the push notification token, add the following call to Adtrace once you have obtained your token (or whenever its value changes):
- Kotlin (build.gradle.kts)
- Groovy (build.gradle)
dependencies {
// ...
implementation("com.google.firebase:firebase-messaging:23.4.0")
// ...
}
dependencies {
// ...
implementation("com.google.firebase:firebase-messaging:23.4.0")
// ...
}
- Set up a Firebase Cloud Messaging client app on Android following Google's documentation, if you have not already done so.
- Pass the push token for the device to the Adtrace SDK.
If you are sending your own push notifications to the app, ensure that you override the onMessageReceived method in the FirebaseMessagingService class with logic that handles all types of push notifications, including Adtrace's silent push notifications for Uninstall and Reinstall Measurement.