# Google Play Advertising ID (AD_ID) Declaration & Manifest Merge Guide

> Every Android app targeting API 33 (Android 13) or higher must synchronize its Play Console Advertising ID declaration with `com.google.android.gms.permission.AD_ID` in its merged `AndroidManifest.xml`. Transitive SDKs like AdMob and Firebase Analytics auto-inject `AD_ID`, requiring you either to declare valid usage purposes in Console or strip the permission cleanly via `tools:node="remove"`.

- **Canonical URL**: https://gootester.com/declarations/advertising-id-ad-id-declaration
- **Play Console Location**: `Monitor & improve -> Policy -> App content -> Advertising ID`
- **Mandatory For**: All Apps Targeting Android 13+ (API 33+)
- **Account Requirement**: Personal or Organization

## Step-by-Step Walkthrough
1. **Inspect your compiled `.aab` merged manifest for `AD_ID` before answering**: Run `bundletool dump manifest --bundle=app-release.aab | grep AD_ID` to see whether Gradle or Expo plugins merged `com.google.android.gms.permission.AD_ID` into your release binary.
2. **Choose Path A (Keep & Declare) for 13+/18+ apps using Analytics or Ads**: If your app targets general/adult users and uses AdMob or Firebase attribution, answer `Yes` in `App content -> Advertising ID`, check exact purposes (`Advertising or marketing`, `Analytics`, `Fraud prevention`), and declare `Device or other IDs` in `Data safety`.
3. **Choose Path B (Strip Permission) for ad-free apps or Families / Under-13 apps**: If your app never uses Advertising ID — or targets children under 13 — add `<uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove" />` to `AndroidManifest.xml` and answer `No` in Play Console.
4. **Verify Google demo ad units on Closed Testing builds and publish changes**: Ensure AdMob builds use official Google demo ad unit IDs (`ca-app-pub-3940256099942544/...`) during your 14-day closed test to avoid invalid-traffic limits, then submit in `Publishing overview`.

## Common Rejection Traps
- **Answering 'No' on the Console form when `firebase-analytics` injected `AD_ID` silently**: Developers who show zero banner ads assume their app does not use Advertising ID, unaware that `play-services-measurement-api` merges `AD_ID` automatically — triggering an immediate Play Console release block.
- **Leaving `AD_ID` inside an app whose Target Audience includes children under 13**: Google Play's Families Policy strictly forbids transmitting Google Advertising ID (`AAID`) from children; bundling `AD_ID` alongside under-13 age brackets guarantees policy rejection.
- **Answering 'Yes' in Advertising ID while unchecking 'Device or other IDs' in Data Safety**: Play Console cross-validates both forms; declaring `AD_ID` usage requires disclosing `Device or other IDs` in `App content -> Data safety`.

## Why Gradle Manifest Merging Causes Surprise AD_ID Blocks

In Android's build system, your final `.aab` manifest is not just your hand-written `app/src/main/AndroidManifest.xml` — it is the union of every library AAR's `AndroidManifest.xml` merged by the Android Gradle Plugin (`AGP`). Including `com.google.firebase:firebase-analytics`, `com.google.android.gms:play-services-ads`, or OneSignal automatically appends `<uses-permission android:name="com.google.android.gms.permission.AD_ID" />` into the compiled bundle.
When you upload that `.aab` to Closed Testing before completing `App content -> Advertising ID` (or after answering `No`), Play Console halts the release immediately with an Advertising ID mismatch error. Inspecting the merged manifest first with `bundletool` or `/tools/app-ads-txt-admob-validator` removes all guesswork.

## Safe AdMob Verification During Your 14-Day Closed Testing Window

Once your `AD_ID` declaration aligns cleanly with your manifest and `Data safety` checkboxes, protect your AdMob account standing throughout your 12-to-25 human tester closed test on GOOtester ($6 Basic, $12 Standard, or $20 Premium). Never ship live production AdMob ad unit IDs to a small cohort of testers repeatedly navigating screens, as concentrated pre-launch impressions routinely trip AdMob Invalid Traffic (`IVT`) limits.
Bind a `closedTesting` build variant or configuration flag to Google's official test ad unit IDs during the 14-day window, host `app-ads.txt` at your Play Store developer website root ahead of launch, and swap in live ad unit IDs on your Production rollout candidate.
