Using advertising IDs

Advertising IDs are unique IDs provided by Google Play services. They're used to serve ads to users who consent to personalized ads. Users can opt out of personalized ads or reset the ID in the settings. In this case, ad networks can't use it to serve relevant ads.

Adding the permission to use the advertising ID

Note

Starting with version 4.5.0, Yandex Mobile Ads SDK adds the com.google.android.gms.permission.AD_ID permission by default. This means you don't need to specify it in your app's main manifest. With this permission, you can use the advertising ID to serve more relevant ads from ad networks.

If your app uses a Yandex Mobile Ads SDK version lower than 4.5.0, add the com.google.android.gms.permission.AD_ID permission to your app's AndroidManifest.xml file:

  <manifest>
      <application>
      <!-- For apps targeting Android 13 or higher and Yandex Mobile Ads SDK versions lower than 4.5.0 -->
          <uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
      </application>
  </manifest>

Removing the permission to use the advertising ID

Warning

Lack of permission and access to the ID may impact your revenue, because your app may serve less relevant ads.

You can remove the permission, if necessary. For example, you may need to do this if a policy, such as the Families Policy, doesn't allow using the ID to serve ads.

To prevent the permission from being added to your app's main manifest, add the following to the AndroidManifest.xml file:

  <manifest>
      <application>
          <uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove"/>
      </application>
  </manifest>