---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://appmetrica.yandex.by/docs/en/sdk/android/get-ad-id.md
  - https://appmetrica.yandex.by/docs/ru/sdk/android/get-ad-id.md
  - href: en/sdk/android/get-ad-id.md
    type: text/markdown
    title: Markdown version
  - href: ../../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://appmetrica.yandex.by/docs/en/llms.txt

# Getting advertising IDs

An advertising ID is a unique Google Play service identifier for displaying ads to users who agree to see personalized ads. The user can disable the personalization of ads or reset the ID in settings. In this case, advertising networks won't be able to use it to select relevant ads. The accuracy of traffic attribution will also decrease significantly.

AppMetrica SDK uses `io.appmetrica.analytics:analytics-identifiers`, a separate library, to obtain ad IDs. This library contains a dependency on `com.google.android.gms:play-services-ads-identifier`, which is used to get the GAID. The `io.appmetrica.analytics:analytics-identifiers` library version should correspond to the `io.appmetrica.analytics:analytics` library version.

A dependency on the `io.appmetrica.analytics:analytics-identifiers` library is added by default.

- If you plan to never use advertising identifiers, [disable the dependency](#disable).

- If you don't want to use advertising identifiers in certain cases or you need to wait for user consent, manage them [using the API](https://appmetrica.yandex.by/docs/en/sdk/android/analytics/android-operations.md#track-adv-identifiers).


## Excluding the library of advertising IDs from the list of dependencies {#disable}

If you don't want to obtain advertising IDs (for example, for children's apps), exclude the library in the project's `build.gradle` file:

{% list tabs %}

- build.gradle.kts

   ```kotlin translate=no
   configurations.configureEach {
       exclude(group = "io.appmetrica.analytics", module = "analytics-identifiers")
   }
   ```

- build.gradle

   ```groovy translate=no
   configurations.configureEach {
       exclude group: 'io.appmetrica.analytics', module: 'analytics-identifiers'
   }
   ```

{% endlist %}

<!-- source: en/_includes/feedback-button-2.md -->
If you didn't find the answer you were looking for, you can use the feedback form to submit your question. Please describe the problem in as much detail as possible. Attach a screenshot if possible.

<a href="../../troubleshooting/feedback-new">
  <span class="button">Contact support</span>
</a>

<a href="../../troubleshooting/feedback-docs">
  <span class="button">Suggest an improvement for documentation</span>
</a>
<!-- endsource: en/_includes/feedback-button-2.md -->
