adjust-icon

Uninstall and reinstall measurement

Use the Adjust Android SDK to measure uninstalls and reinstalls. Adjust sends silent Firebase Cloud Messaging (FCM) messages to the app’s push token to check whether the app is installed.

Before you begin

Requirements

Connect Google FCM to Adjust

To let Adjust send silent messages through FCM HTTP v1, create a service-account JSON key.

Google Cloud console

1. Create a custom role for Adjust 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:
    1. Title: Adjust Uninstall
    2. ID: adjust_uninstall
    3. Role launch stage: General Availability
  7. Select + Add Permissions.
  8. In the Enter property name or value field, enter cloudmessaging.messages.create and select it from the search results.
  9. Check the cloudmessaging.messages.create option and select Add.
  10. 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 Adjust Uninstall Service Account.
  4. Select Create and Continue.
  5. Select the Select a role dropdown. Enter Adjust 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: adjust-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. The private key is downloaded as a JSON file to your computer.

In the Adjust dashboard

Now that you have the FCM HTTP v1 service-account JSON key, enable Uninstall and reinstall measurement in your app configuration in AppView:

  1. Select the Platforms tab.
  2. Select Edit. Platform settings
  3. Under Advanced settings, find the Record uninstall and reinstall data option. Advanced settings
  4. Select Add connection. A modal will open prompting you to add a new connection between Adjust and Google FCM. New connection modal
  5. Fill in the required information, including the FCM HTTP v1 service-account JSON key you generated. The Partner and Services fields are automatically filled in.
  6. Select Connect.
  7. Review your app’s settings and select Save.

Integrate with the Adjust SDK

Add Firebase Messaging

Follow Firebase’s Android setup to configure your project and add Firebase Messaging. With the Firebase Android BoM, the app module’s Gradle dependencies include:

Register your FirebaseMessagingService in the manifest:

<service
android:name=".MyFirebaseMessagingService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>

Send the current token

Request the current FCM token when the app opens and pass it to Adjust as soon as it becomes available. You can call Adjust.setPushToken before or after Adjust.initSdk.

Handle token changes and messages

Forward new tokens to Adjust. Override onMessageReceived to skip handling for Adjust’s silent uninstall check, then handle other FCM messages as usual:

Test the integration

Use a debug or release build for testing, but initialize Adjust with AdjustConfig.ENVIRONMENT_PRODUCTION. Devices whose last activity was in the sandbox environment are excluded from uninstall checks.

To test uninstall measurement:

  1. Install the app on your physical test device or emulator.
  2. Open the app.
  3. Open Adjust’s Testing Console.
  4. Enter your device ID and select View device data.
  5. Under the App information section:
    • The Install state should show Installed.
    • There should be a value for Push token.
  6. Uninstall the app.
  7. Check the Testing Console after the next daily uninstall check. Under App information, the Install state should show Uninstalled once the uninstall is detected. Push notification services may report an uninstall up to a week after the last session.

The state change from Installed to Uninstalled ensures that the Uninstall and Reinstall measurement feature works correctly. However, if you would also like to test reinstall measurement, follow the next steps:

  1. Reinstall the debug build or release build on your physical test device or emulator.
  2. Open the app.
  3. After Adjust records the new session, check the Testing Console again. Under App information, the Install state should show Reinstalled.

Troubleshooting

Check these issues if the test does not produce the expected install state:

  • Sandbox environment: Uninstall and reinstall measurement requires AdjustConfig.ENVIRONMENT_PRODUCTION for the test install. Check the environment passed to AdjustConfig.
  • Missing push token: If the Testing Console shows no push token, check Firebase Messaging setup and the code that passes the token to Adjust.
  • FCM HTTP v1 credentials: Check that the service-account key belongs to the correct Firebase project and that its details were entered correctly in Adjust Suite. If the issue persists, contact your Technical Account Manager or support@adjust.com with the device’s push token so they can inspect Google’s API response.