> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kontext.so/llms.txt
> Use this file to discover all available pages before exploring further.

# IFA & ATT

> How the SDK reads the device advertising identifier on iOS and Android, and the one-time configuration each platform needs.

The **IFA (Identifier for Advertisers)** is the platform-standard ad ID we forward with every ad request — IDFA on iOS, GAID on Android. The SDK reads it automatically; your app only needs the one-time platform configuration below.

If no IFA is available (user denied permission, OS-level opt-out, web), the SDK falls back to a first-party identifier it generates internally — fill rate stays reasonable, but retargeting and frequency capping work better with a real IFA.

## iOS — IDFA + App Tracking Transparency

iOS 14+ requires user consent before any SDK can read the IDFA. The system prompt is **App Tracking Transparency (ATT)**.

Add the usage description to `Info.plist`:

```xml theme={null}
<key>NSUserTrackingUsageDescription</key>
<string>We use your advertising identifier to show you more relevant ads.</string>
```

<Warning>
  Without this key, the app will crash on iOS 14+ as soon as the SDK requests ATT.
</Warning>

By default the SDK calls `ATTrackingManager.requestTrackingAuthorization` automatically the first time a session is created. To manage the prompt yourself (for example, delay it until after onboarding), set `requestTrackingAuthorization: false` on `SessionOptions` and supply the `advertisingId` you collected.

<Warning>
  The ATT prompt only appears when the app is in an active state. Initializing the SDK before that — for example, in `AppDelegate.didFinishLaunchingWithOptions` — may suppress the prompt entirely.
</Warning>

The Swift SDK also reads **IDFV** (`UIDevice.current.identifierForVendor`) as a stable iOS-only secondary identifier. IDFV does **not** require ATT and is always available.

## Android — GAID + AD\_ID permission

GAID is always available on Android — there's no runtime consent prompt. Reading it requires the install-time `com.google.android.gms.permission.AD_ID` permission (Android 13+ / API level 33+).

How the permission is declared depends on the SDK:

* **Kotlin SDK and React Native SDK** — added automatically via manifest merger. No changes to your `AndroidManifest.xml` required.
* **Flutter SDK** — declare it manually in `android/app/src/main/AndroidManifest.xml`:

  ```xml theme={null}
  <uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
  ```

<Note>
  If your manifest has `tools:node="remove"` on the `AD_ID` permission anywhere (often a leftover from an older privacy-tightening pass), remove the override or the SDK can't read GAID.
</Note>

## Web

Browser environments don't have an OS-level IFA. The React, Vue, and JavaScript SDKs don't read or request one — they go straight to the first-party fallback identifier on every request.
