GAID (Google Advertising ID) and AAID (Android Advertising ID) are unique advertising identifiers for Android devices used for install attribution and ad personalization. GAID is the official name for devices with Google Play Services, AAID is a universal term for all Android devices, including builds without Google services. According to the Google Developer Documentation, 2025, obtaining GAID requires Google Play Services. AdvertisingIdClient is the main API for retrieving the advertising identifier on Android.
Key Takeaways
GAID (Google Advertising ID) is a unique identifier assigned to each Android device with Google Play Services installed. It is intended for advertising purposes: install attribution, campaign measurement, and personalized ad delivery. AAID (Android Advertising ID) is a broader term that encompasses advertising identifiers on all Android devices, including Huawei devices with HMS, Amazon Fire, and AOSP builds without Google services.
The main difference between GAID and IDFA on iOS is that GAID is available without an explicit permission request, but since Android 14, apps must declare the use of the advertising identifier in the manifest and obtain user consent in accordance with the Google Play Privacy Policy. Google does not require a system dialog (like ATT on iOS), but the developer must follow user consent rules.
According to Google Play Console Statistics (2025), over 95% of active Android devices support GAID via Google Play Services. On devices without Google services (Chinese market, Huawei AppGallery), AAID from the respective app stores or alternative identifiers such as OAID (Open Anonymous ID) for Chinese manufacturers are used.
The key advantage of GAID over IDFA is the ability to obtain the identifier without a blocking system dialog. However, Google is constantly tightening requirements: since Android 14, apps targeting API 34 and above must explicitly declare the AD_ID permission in the manifest.
On Android, obtaining the advertising identifier is implemented through Google Play Services and the AdvertisingIdClient class. Unlike iOS, where IDFA requires an explicit ATT dialog, GAID is available to the app by default unless the user has disabled ad personalization in device settings.
The AdvertisingIdClient class from the com.google.android.gms.ads.identifier package provides two main methods: getAdvertisingIdInfo (context) and start (context). The method returns an AdvertisingIdInfo object containing the identifier (UUID string) and the isLimitAdTrackingEnabled flag, which indicates whether the user has disabled ad personalization.
Calling AdvertisingIdClient must be done on a background thread, as the method accesses the remote Google Play service. It is recommended to use coroutines or AsyncTask for asynchronous identifier retrieval. If Google Play Services are unavailable on the device, the method throws a GooglePlayServicesNotAvailableException — in this case, the developer must use an alternative identification method.
The user can reset GAID at any time via Settings — Google — Ads — Reset advertising ID. After reset, apps receive a new identifier and the link to previous data is lost. The user can also enable the “Disable ad personalization” option, which sets the isLimitAdTrackingEnabled flag to true.
The developer must respect the isLimitAdTrackingEnabled flag: if it is true, the app must not use GAID for ad personalization, but may use it for limited purposes such as conversion measurement, fraud prevention, and frequency capping. Violating this rule leads to app suspension on Google Play.
Starting with Android 14 (API 34), Google introduced new restrictions on access to the advertising identifier. The AD_ID permission must now be explicitly declared in the app manifest to obtain GAID. If the app does not declare the permission and targets API 34+, calling AdvertisingIdClient returns a null identifier.
The Google Play Policy requires apps using GAID to comply with several rules: the identifier may only be used for advertising and analytics purposes; the app must not link GAID to personal data without explicit user consent; GAID must not be shared with third parties without disclosure in the privacy policy. Since 2025, Google Play has begun automatically scanning apps for compliance with these rules using the Play Integrity API.
Special attention is given to children’s apps: according to the Google Play Families Policy, apps targeting children must not use GAID for ad personalization under any circumstances. Developers must use ad networks certified for children’s audiences.
The isLimitAdTrackingEnabled flag signals the user’s choice to the app. If the flag is true, the app may only use GAID for basic operations: install attribution, analytics, anti-fraud, frequency capping. Ad personalization, user profiling, and retargeting based on GAID are prohibited in this case.
Google recommends against attempting to bypass the isLimitAdTrackingEnabled flag through alternative identifiers (IMEI, MAC address, Android ID). Using permanent hardware identifiers is strictly prohibited by Google Play policy and leads to immediate app suspension without possibility of appeal.
Obtaining GAID on Android requires an asynchronous call to AdvertisingIdClient with handling of possible exceptions. Below is a complete example in Kotlin using coroutines.
The example demonstrates retrieving the advertising identifier and checking the isLimitAdTrackingEnabled flag using coroutines and try-catch for handling Google Play Services errors.
import com.google.android.gms.ads.identifier.AdvertisingIdClient
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
data class AdvertisingInfo(
val gaid: String,
val isLimitAdTrackingEnabled: Boolean
)
suspend fun getAdvertisingInfo(context: Context): AdvertisingInfo? {
return withContext(Dispatchers.IO) {
try {
val adInfo = AdvertisingIdClient.getAdvertisingIdInfo(context)
AdvertisingInfo(
gaid = adInfo.id,
isLimitAdTrackingEnabled = adInfo.isLimitAdTrackingEnabled(true)
)
} catch (e: GooglePlayServicesNotAvailableException) {
// Google Play Services unavailable — using alternative ID
null
} catch (e: IOException) {
// Network error when accessing the service
null
}
}
}
// Usage in Activity or ViewModel
fun onGaidRequested() {
lifecycleScope.launch {
val info = getAdvertisingInfo(this@MainActivity)
setupAdNetwork(
gaid = info?.gaid,
limitTracking = info?.isLimitAdTrackingEnabled ?: true
)
}
}
Understanding the differences between advertising identifiers across platforms is critically important for developers working with ad attribution on both OSes. Below is a comparison of the key aspects of GAID, AAID, and IDFA.
The main difference between GAID and IDFA is the retrieval mechanism. IDFA requires explicit consent through ATT, without which a null identifier is returned. GAID is available without a system dialog, but since Android 14+ requires declaring the AD_ID permission in the manifest. GAID also has a more flexible flag system: isLimitAdTrackingEnabled does not block identifier retrieval, it only signals the app to limit usage.
According to Adjust (2025), GAID availability on Android is 98% of active devices compared to 20–35% IDFA availability on iOS. This makes Android a more predictable platform for ad attribution, but tightening Google policies are gradually closing this gap.
AAID, unlike GAID, is not tied to Google Play Services and can be used on Huawei (HMS), Amazon Fire OS, and Chinese manufacturer devices. On Huawei devices, AAID is implemented through Huawei Mobile Services (HMS) with the AdvertisingIdClient class from the com.huawei.hms.ads.identifier package. For the Chinese market, OAID (Open Anonymous ID) is also common — a standard developed by the alliance of Chinese manufacturers to replace GAID on devices without Google services. Choosing the right API for obtaining the identifier directly affects the availability of ad attribution in different markets.
Frequently Asked Questions
GAID (Google Advertising ID) is an advertising identifier for devices with Google Play Services. AAID (Android Advertising ID) is a general term for Android advertising identifiers, including devices without Google services (Huawei, Amazon Fire). GAID is obtained via Google Play, AAID via the SDK of the respective app store.
Yes, starting with Android 14 (API 34), the AD_ID permission must be declared in the manifest. If the app targets SDK 34+ and does not declare AD_ID, AdvertisingIdClient returns a null identifier. The permission is declared using the
Yes, the user can reset GAID at any time via Settings — Google — Ads — Reset advertising ID. After reset, all apps receive a new identifier and the link to ad interaction history is lost.
OAID (Open Anonymous ID) is an advertising identifier standard developed by the alliance of Chinese smartphone manufacturers (Xiaomi, OPPO, vivo, Huawei). It is used on devices without Google Play Services for the Chinese market. Unlike GAID, OAID does not require Google Play and works through the device manufacturer’s SDK.
If isLimitAdTrackingEnabled is true, the app cannot use GAID for ad personalization, user profiling, or retargeting. However, the identifier can be used for limited purposes: install attribution, analytics, fraud prevention, and frequency capping.
Summary
We will develop a mobile application turnkey
IT Sectr creates iOS and Android applications for startups and businesses since 2017. We will advise you and propose the best solution.
Read also