Advertising ID (Ad ID) is commonly used in various apps, especially in AVOD (Advertising Video On Demand) apps. Ad ID is used to show customized ads for specific customers and/or devices. Given Ad ID is used for privacy related features, it is important to provide opt-out mechanism for end users. In this KB, we will explain how to retrieve an Ad ID and opt-out status on Vega. We will also explain conditions for testing AdIdRetriever on Vega FTV devices.
![]()
AdIdRetrieveris ONLY supported on the Vega FTV device. If you try to run this on the Vega Virtual Device,AdIdRetriever.isAdvertisingTrackingEnabled()always returns false.
Steps to integrate
- Add the following library in the
"dependencies"section topackage.json.
"dependencies": {
"@amazon-devices/kepler-adid-retriever": "~1.0.14"
}
- Add Package ID to
manifest.toml.
[wants]
[[wants.service]]
id = "com.amazon.admanager.service.main"
- Import
AdIdRetrieverin your code.
import {AdIdRetriever} from '@amazon-devices/kepler-adid-retriever';
- Retrieve AdID in your code. Note that
fetchAdvertisingId()returns the advertising ID regardless of tracking state, but per Amazon’s advertising policy, you should only use it for interest-based ads when tracking is enabled.
if (AdIdRetriever.isAdvertisingTrackingEnabled()) {
const adId: string = AdIdRetriever.fetchAdvertisingId();
console.log(`Interest-based Ads is enabled. Retrieved AdID: ${adId}`);
} else {
console.log(`Interest-based Ads is disabled.`);
}
- Build and run your project. With the sample code above, you’ll see the
console.logmessages usingloggingctl(see details in Use Loggingctl to Manage System Logs | Vega CLI Tools)
Testing Conditions
-
Go to Settings > Preferences > Privacy Settings > Interest-based Ads. Change it On or Off to test
AdIdRetriever.isAdvertisingTrackingEnabled() -
Check the Ad ID under the Privacy Settings to test
AdIdRetriever.fetchAdvertisingId() -
You can also reset Ad ID on the Ad ID setting.
Last updated: Mar 9, 2026