Skip to main content

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.

Note

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.

info

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.

Important

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
  1. Access your Google Cloud Console.
  2. Select the Google Cloud project associated with your Firebase project.
  3. Search for IAM & Admin.
  4. From the side menu, select Roles.
  5. Select + Create Role.
  6. Enter the following details:
  7. Title: Adtrace Uninstall
  8. ID: adtrace_uninstall
  9. Role launch stage: General Availability
  10. Select + Add Permissions.
  11. In the Enter property name or value field, enter cloudmessaging.messages.create and select it from the search results.
  12. Check the cloudmessaging.messages.create option and select Add.
  13. Select Create.
2. Create a service account
  1. From the side menu, select Service Accounts.
  2. Select + Create Service Account.
  3. In the Service account name field, enter Adtrace Uninstall Service Account.
  4. Select Create and Continue.
  5. Select the Select a role dropdown. Enter Adtrace Uninstall and select it from the search results.
  6. Select Continue.
  7. Select Done.
3. Generate and download the private key
  1. Select the newly created service account. The format looks like this: adtrace-uninstall-service-account@test3-55065.iam.gserviceaccount.com.
  2. Select the Keys tab.
  3. Select Add Key > Create new key.
  4. 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:

  1. Ensure that you have the required dependency for Firebase Messaging in your build.gradle file:

To send us the push notification token, add the following call to Adtrace once you have obtained your token (or whenever its value changes):

dependencies {
// ...
implementation("com.google.firebase:firebase-messaging:23.4.0")
// ...
}
  1. Set up a Firebase Cloud Messaging client app on Android following Google's documentation, if you have not already done so.
  2. Pass the push token for the device to the Adtrace SDK.
Apps with push notification

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.