The Open Anonymous Device Identifier (OAID) service facilitates personalized ad placement based on OAIDs, each of which is a non-permanent device identifier. The service provides personalized ads for users while protecting their personal data privacy. It can also interact with third-party tracking platforms to provide conversion attribution analysis for advertisers.
You can use the APIs provided in this repository to obtain OAIDs.
1. Request the ad tracking permission.
Configure the [ohos.permission.APP_TRACKING_CONSENT](https://docs.openharmony.cn/pages/v4.0/zh-cn/application-dev/security/permission-list.md/) permission in the **module.json5** file of the module.
```javascript
{
"module": {
"requestPermissions": [
{
"name": "ohos.permission.APP_TRACKING_CONSENT" // Request the ad tracking permission.
}
]
}
}
```
2. Request authorization from the user by displaying a dialog box when the application is started.
```javascript
import abilityAccessCtrl from '@ohos.abilityAccessCtrl';