---
updatedAt: 2026-06-29T12:08:08.000Z
agentTools:
  projectIndex: https://docs.apphud.com/llms.txt
---

# Device Identifiers

# Overview

Advertising Device Identifiers include:

* IDFA (iOS)
* IDFV (iOS)
* Advertiser ID (Android)
* App Set ID (Android)

Collecting Device Identifiers is required for marketing attribution providers: AppsFlyer, Branch, Facebook, Adjust, Tenjin, Singular, etc.

If you don't use such integrations, you may ignore this guide.

# iOS

Since version 3.3.0, the iOS SDK no longer collects the Identifier For Vendor (IDFV) automatically. Failing to pass the IDFV might disrupt some of your MMP integration setups.

Call `setDeviceIdentifiers(idfa: String?, idfv: String?)` method immediately after the SDK initialization. If the advertising identifier (IDFA) is not available, pass only the IDFV.

When IDFA becomes available, you can call `setDeviceIdentifiers(idfa: String?, idfv: String?)` again.

> 📘 IDFA depends on user consent
>
> If the user denies the App Tracking Transparency (ATT) prompt, the IDFA is unavailable and won't be collected — even though `setDeviceIdentifiers` is called. In that case, pass only the IDFV.

Sample Code:

```swift
import AppTrackingTransparency
import AdSupport

Apphud.start(apiKey: "YOUR_API_KEY")
Apphud.setDeviceIdentifiers(idfa: nil, idfv: UIDevice.current.identifierForVendor?.uuidString)
fetchIDFA()

func fetchIDFA() {
        if #available(iOS 14.5, *) {
            DispatchQueue.main.asyncAfter(deadline: .now()+2.0) {
                ATTrackingManager.requestTrackingAuthorization { status in
                    guard status == .authorized else {return}
                    let idfa = ASIdentifierManager.shared().advertisingIdentifier.uuidString
                    Apphud.setDeviceIdentifiers(idfa: idfa, idfv: UIDevice.current.identifierForVendor?.uuidString)
                }
            }
        }
    }
```

> 📘 Important
>
> Don't forget to add **Privacy - Tracking Usage Description** (`NSUserTrackingUsageDescription`) to your app's `Info.plist`

# Android

Call `Apphud.collectDeviceIdentifiers()` method after the SDK initialization.\
When targeting Android 13 and above, you must also declare [AD\_ID permission](https://support.google.com/googleplay/android-developer/answer/6048248?hl=en) in the manifest file.

```kotlin
Apphud.start(this, API_KEY)
Apphud.collectDeviceIdentifiers()
```

# Flutter

```
On Flutter please use the following plugin:
https://pub.dev/packages/app_tracking_transparency

// Use following methods:

/// iOS (IDFV is collected automatically in this method since SDK v2.6.0)
static Future<void> setAdvertisingIdentifier(String idfa) async

/// Android (Collects Advertiser ID and App Set ID)
static Future<void> collectDeviceIdentifiers()
```

# App Store Privacy

Even with the use of IDFA, it is still necessary to accurately fill out the [App Store Privacy](https://docs.apphud.com/docs/apple-app-privacy) Information.

For more details, please refer to [Apple Guide](https://developer.apple.com/app-store/app-privacy-details/).

# Google Play Data Safety

If your app uses Apphud SDK or attribution integrations, you may also need to complete the Google Play [Data safety](https://docs.apphud.com/docs/google-play-data-safety) form.

For more details, please refer to [Google Guide](https://support.google.com/googleplay/android-developer/answer/10787469).