Topics API customization and opt-out

Users and developers should be able to fine-tune the Topics API to improve content relevance. This page is a guide on how to manage and customize the Topics API to suit user's and developer's preferences and needs.

User controls

The API design intends to provide users with the ability to view and remove the topics that are associated with their app usage. The implementation of this user control capability is a work in progress, and will be included in a future update.

If the user uninstalls an app that contributed to the selection of an inferred topic in the past 3 epochs, that topic won't be removed from the list of topics returned for the past 3 epochs, in order to avoid disclosing information about the uninstallation.

In order to facilitate testing for what the end user experience will be, developers can launch an in-app intent in order to view the settings UI for Topics similar to how an end user would see it:

//Button that launches settings UI
private Button mSettingsAppButton;
private static final String RB_SETTING_APP_INTENT = "android.adservices.ui.SETTINGS";

//Does setup for button on screen that will launch settings UI to observe Topics
private void registerLaunchSettingsAppButton() {
    mSettingsAppButton.setOnClickListener(
        new View.OnClickListener() {

            @Override
            public void onClick(View view) {
                Context context = getApplicationContext();
                Intent activity2Intent = new Intent(RB_SETTING_APP_INTENT);
                activity2Intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                context.startActivity(activity2Intent);
            }
        });
}

Developer controls

App developers can manage which ad tech developers can access the Topics APIs by including the ad tech developer's enrollment ID inside of the app manifest.

An app can declaratively opt out of the Topics API through new manifest and XML elements, in order to disallow ad SDKs from using the API for that app. Topics associated with opted-out apps won't contribute to the weekly topic computation. This document will be updated to include related implementation details.

See also

Check out our resources to better understand the Topics API on Android.