Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Skip to main content
Ad ID Retriever is a service on device that retrieves advertising ID and advertising tracking state. Use cases:
  • Retrieve the advertising ID for bidding, reporting impressions, and reporting attributions of ads. (fetchAdvertisingId)
  • Retrieve a user’s preference on interest-based advertisements. (isAdvertisingTrackingEnabled)

Behavior

Account for the following when you integrate Ad ID Retriever.
  • Verify tracking before you use the advertising ID. Call isAdvertisingTrackingEnabled and check the result before you use the value from fetchAdvertisingId for interest-based advertising. If it returns false, the user has opted out of interest-based advertising, so serve contextual (non-personalized) advertisements rather than interest-based ones.
  • Child profiles. On a child profile, isAdvertisingTrackingEnabled returns false regardless of the Interest-based Ads setting. The user has opted out of interest-based advertising, so serve contextual (non-personalized) advertisements rather than interest-based ones.
  • Service unavailable. fetchAdvertisingId returns an empty string if it cannot reach the Advertising Manager service. This does not raise an error. An empty string means the Advertising Manager service was unreachable. Do not use an empty string as a valid advertising ID.

Get Started

Setup

  1. Add the following library dependency to the dependencies section of your package.json file.
  1. In your manifest.toml, add the following components and wants required to access Ad ID Retriever.

Usage

This example demonstrates how to implement the Ad ID Retriever service. The example provides a simple UI with two buttons that showcases both core functionalities: fetching the advertising ID and checking the advertising tracking status.

API Reference

Classes

  • AdIdRetriever — AdIdRetriever provides APIs for retrieving advertising IDs and advertising tracking state.

Last modified on September 23, 2026