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.

Integrating a library for getting advertising IDs

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:18.0.1, 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.

Note

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

Excluding the library of advertising IDs from the list of dependencies

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:

configurations.configureEach {
    exclude(group = "io.appmetrica.analytics", module = "analytics-identifiers")
}
configurations.configureEach {
    exclude group: 'io.appmetrica.analytics', module: 'analytics-identifiers'
}

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.

Contact support