Android 12 Advertising ID

These days, data is very strict. From iOS 14.5, IDFA rule becomes strict and to collect this info, need to get user approval using permission dialog.

Google will follow Apple soon. This is kind of common sense.

This is same article of Qiita I wrote. (日本語はこちら)



Google announced Android 12 on Oct in 2021, but so far no change about Adverting ID.

From Google, the change previously announced from early 2022.

Current results

  • isLimitAdTrackingEnable is true, we can collect ADID
  • Can get ADID in any OS, device OS, Compile SDK, Tool version

This is the current result without permission

DeviceSDK Compile/ToolApp Complie/ToolPermissionTracking ADID

The change for the future

  • When building application with Android 12 (API 31), apply this
  • Need to set permission (permission level is normal, so no dialog only install/update check from Google Play)
  • If missing permission, can get “00000000-0000-0000-0000-000000000000” same as iOS

Currently, this change does not have effect on, but Google said that it has an effect from early 2022.

If you are application developer, we need to implement following 2 ways to support ADID

  1. Add permission to AndroidManifest.xml
  2. Add dependency


<uses-permission android:name=""/>

Google Play Ads Identifier

The latest version already had this setting. If import this,


From google

Exceptional, we don’t want to collect ADID

If you don’t want to collect ADID, but dependency has this.

In this case, we can override setting to remove ADID collection

<uses-permission android:name="" tools:node="remove"/>

tools:node=”remove” override (remove) dependency setting.

I’m SDK developer.

Me, too. I want customers to use setting. We need ADID for ads.

In SDK developers, we can take 2 ways.

  1. Add permission to SDK’s AndroidManifest.xml
  2. Add Ads Identifier 17.1.0 dependency to SDK

In 1 case, do we need to compile with API 31, no we can use this permission with under 31 level API.

Professional Programmer2