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. (日本語はこちら)

スポンサーリンク

2021/10

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
Get
Get
Get

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 com.google.android.gms:play-services-ads-identifier:17.1.0

AndroidManifest.xml

<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>

Google Play Ads Identifier

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

17.1.0

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="com.google.android.gms.permission.AD_ID" 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.

Android
スポンサーリンク
Professional Programmer2

コメント