Developer Console
Thank you for your visit. This page is only available in English at this time.

Get the Advertising ID on Fire Tablets

The Advertising ID is a user-resettable, unique identifier that can be used for advertising and user analytics. Users can reset the Advertising ID or opt out of tracking for interest-based ads altogether. The Advertising ID is currently available for tablet devices running Fire OS 5.1 and later and TV devices running Fire OS and later.

On Fire Tablets, users can manage the Advertising ID by going to Settings > Apps & Notifications > Advertising ID.

When to Use the Advertising ID

You should use the Advertising ID (when supported by the device) if your app does the following:

  • Displays ads
  • Collects data for user analytics
  • Collects data to build user profiles for advertising purposes or for targeting users with interest based advertising

When available, use the Advertising ID over any other ID. Ensure that if you use a third-party ad service in your app, the service follows the requirements around the user's choice.

Developer Expectations

When you use the Advertising ID, follow these principles:

  • Use the Advertising ID only for advertising and user analytics.
  • When the user opts out of interest-based ads, the Advertising ID is still available but the developer must honor the user's opt-out choice. Do not collect information about the user's behavior to build user profiles for advertising purposes or show them interest based ads. In your code, precede any call to retrieve the Advertising ID with a call that verifies the user's opt-out choice. Allowed activities include contextual advertising, frequency capping, conversion tracking, reporting, and security and fraud detection.
  • Do not associate any persistent device identifier or personally-identifiable information with the Advertising ID unless the user has explicitly given consent to do so.
  • When a user resets the Advertising ID, do not fold earlier data into the new Advertising ID or associate the new ID with the old one unless the user has explicitly given consent for you to do so.

For more information, see the App Distribution and Services Agreement.

Verifying and Responding to the User's Advertising ID Choices

The Android Settings.Secure class exposes the user's Advertising ID choices through the getInt and getString methods. The following Java example shows the logic for verifying the user setting and retrieving an Advertising ID (if available).

import android.content.ContentResolver;
import android.provider.Settings.Secure;
import android.provider.Settings.SettingNotFoundException;

String advertisingID = "";
boolean limitAdTracking = false;

try {
    ContentResolver cr = getContentResolver();

    // get user's tracking preference
    limitAdTracking = (Secure.getInt(cr, "limit_ad_tracking") == 0) ? false : true;

    // get advertising
    advertisingID = Secure.getString(cr, "advertising_id");
} catch (SettingNotFoundException ex) {
    // not supported


The code first gets the user's ad tracking preference. Then depending on the ad tracking value, the following happens:

  • If the user has allowed ad tracking, the value for limit_ad_tracking will be false.
  • If the user has disabled ad tracking, the value for limit_ad_tracking will be true
  • The Advertising ID gets stored in the advertisingID variable. A sample Advertising ID value might be df07c7dc-cea7-4a89-b328-810ff5acb15d. (For child profiles, the advertisingID will be 00000000-0000-0000-0000-00000000000.)
  • If the system doesn't return any value for limit_ad_tracking (such as for non-Fire-OS devices or Fire Devices running older versions of FireOS), a SettingNotFoundException gets thrown. You can handle this exception as desired.

Retrieving the Advertising ID and Ad Tracking Preferences in Web Apps

With web apps, after you include the Web App API script (as detailed in Including the Amazon APIs), an AmazonAdvertising object exposes two functions in your web app: AmazonAdvertising.getAdvertisingId and AmazonAdvertising.getLimitAdTrackingPreference. Both functions have two parameters each — a success callback and an error callback.

The value retrieved by the function (either the advertising ID for the AmazonAdvertising.getAdvertisingId function, or the ad tracking preference for the AmazonAdvertising.getLimitAdTrackingPreference function) is passed to the success callback. For more details, see Retrieving the Advertising ID and Ad Tracking Preference in Web Apps (Fire Tablets).