디바이스 데이터 검색 가이드

디바이스 데이터 검색 가이드

Singular는 정확한 어트리뷰션을 위해 모든 API 요청에 특정 디바이스 식별자를 포함해야 합니다. 이러한 식별자는 다음과 같습니다:

  • 구글 플레이 기기용 구글 광고 ID(GAID) 및 구글 앱 세트 ID(ASID)
  • 비 구글 플레이 아마존 디바이스를 위한 아마존 광고 ID
  • 중국산 안드로이드 기기를 위한 오픈 광고 ID(OAID)
  • 위의 어느 것도 사용할 수 없는 경우, 비구글 플레이 기기용 안드로이드 ID(ANDI)
  • iOS 기기용 광고주 식별자(IDFA) 및 벤더 식별자(IDFV)

Singular에는 일부 모바일 기기 파라미터도 필요합니다:

  • 로캘(예: en_US)
  • 디바이스 제조사(예: 삼성)
  • 장치 모델(예: 아이폰 12, 삼성 갤럭시 S21)
  • 빌드(예: 빌드/13D15)

Singular는 이러한 식별자를 얻는 데 도움이 되는 코드 스니펫 예시를 제공하며, 아래에서 확인할 수 있습니다.

디바이스 정보 클래스 샘플

식별자

필수 iOS 식별자

  • IDFV는 모든 S2S 요청에 필요합니다.
  • 사용자가 앱 추적 투명성 동의를 제공한 경우 IDFA를 제공해야 합니다.
  • ATT 승인 상태도 필요합니다.
iOS 기기 데이터를 검색하는 방법

광고주 식별자(IDFA) 검색하기

광고주 식별자(IDFA)는 광고주가 사용자 행동(예: 광고 클릭, 앱 설치)을 추적하고 특정 캠페인에 귀속시켜 정확한 광고 타겟팅과 캠페인 최적화를 가능하게 합니다.

iOS 14.5부터는 앱이 IDFA에 액세스하기 전에 사용자가 앱 추적 투명성(ATT) 프레임워크를 통해 옵트인해야 합니다. 사용자가 옵트인하지 않으면 IDFA를 사용할 수 없으므로 추적 기능이 제한됩니다.

공급업체용 식별자(IDFV) 검색하기

공급업체용 식별자(IDFV)는 Apple이 특정 공급업체 또는 개발자에게 특정한 기기에 할당하는 고유 식별자입니다. 특정 기기에서 동일한 공급업체의 모든 앱에서 일관되게 유지되므로 공급업체는 사용자를 개인적으로 식별하지 않고도 앱 생태계 전반에서 사용자 행동 및 상호 작용을 추적할 수 있습니다.

  • IDFA에 액세스하기 전에 ATT 프롬프트가 표시되고 처리되는지 확인하세요.
  • ATT를 사용하는 경우 IDFA를 캡처하여 서버로 다시 전달하여 Singular API 요청에 사용하세요.
  • IDFV를 캡처하여 서버로 다시 전달하여 Singular API 요청에 사용하세요.

예시: 콘솔 로그를 사용하여 IDFA 및 IDFV 검색을 위한 ATT 권한 상태 요청하기

다음은 콘솔 로그를 사용하여 IDFA(광고주 식별자)와 IDFV(벤더 식별자)를 모두 검색하는 Objective-C 및 Swift 코드 스니펫입니다. 이 코드에는 iOS 14.5부터 IDFA에 액세스하는 데 필요한 ATT(앱 추적 투명성) 권한 처리가 포함되어 있습니다.

Objective-CSwift
#import <AdSupport/AdSupport.h>
#import <AppTrackingTransparency/AppTrackingTransparency.h>
#import <UIKit/UIKit.h>

- (void)retrieveIdentifiers {
    // Request ATT authorization (iOS 14.5+)

    [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
        dispatch_async(dispatch_get_main_queue(), ^{
            switch (status) {
                case ATTrackingManagerAuthorizationStatusAuthorized: {
                    // ATT authorized, retrieve IDFA

                    NSUUID *idfa = [[ASIdentifierManager sharedManager] advertisingIdentifier];
                    NSLog(@"IDFA: %@", [idfa UUIDString]);
                    break;
                }
                case ATTrackingManagerAuthorizationStatusDenied:
                case ATTrackingManagerAuthorizationStatusRestricted:
                case ATTrackingManagerAuthorizationStatusNotDetermined:
                    // ATT not authorized or not determined

                    NSLog(@"Tracking not authorized or not determined.");
                    break;
                default:
                    NSLog(@"Unknown ATT status.");
                    break;
            }

            // Retrieve IDFV (always available)

            NSUUID *idfv = [[UIDevice currentDevice] identifierForVendor];
            if (idfv != nil) {
                NSLog(@"IDFV: %@", [idfv UUIDString]);
            } else {
                NSLog(@"Unable to retrieve IDFV.");
            }
        });
    }];
}

// Call the method to retrieve identifiers

[self retrieveIdentifiers];
  • IDFA: iOS 14.5 이상에서 ATT 권한이 필요합니다. 사용자 동의가 없으면 IDFA는 모든 0을 반환합니다.
  • IDFV: 항상 사용 가능하며 Singular API 요청 시 항상 제공해야 합니다.

필수 Android 식별자(Google Play 기기)

  • ASID는 모든 S2S 요청에 필수입니다.
  • AIFA(GAID)는 가능한 경우 제공해야 합니다.
Android 기기 데이터를 검색하는 방법(Google Play)

구글 광고 식별자(GAID) 검색하기

구글 광고 식별자(GAID)는 AIFA(Singular) 또는 안드로이드 광고 ID(AAID)라고도 하며, 안드로이드 기기에 할당된 사용자 재설정이 가능한 고유 식별자입니다. 광고주와 앱 개발자가 앱 전반의 사용자 행동(예: 광고 클릭, 앱 설치)을 추적하고 특정 캠페인에 어트리뷰션하여 정확한 광고 타겟팅과 캠페인 최적화를 수행하는 동시에 사용자 개인정보를 보호할 수 있도록 도와줍니다.

JavaKotlin
종속성

빌드.gradle 파일에 구글 플레이 서비스에 필요한 종속성을 추가했는지 확인하세요:

dependencies {
    implementation 'com.google.android.gms:play-services-ads-identifier:17.0.0'
}

 

앱 빌드가 Android 12/API 레벨 31 이상을 대상으로 하는 경우, AndroidManifest.xml 에 Google 광고 ID에 액세스할 수 있는 권한을 추가하세요:

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

 

사용법

이 방법을 사용하려면 활동 또는 애플리케이션 클래스에서 호출하기만 하면 됩니다:

AdIdUtils.getGoogleAdId(getApplicationContext());

 

Google 광고 ID(GAID)를 검색하는 자바 코드
import android.content.Context;
import android.os.AsyncTask;
import android.util.Log;

import com.google.android.gms.ads.identifier.AdvertisingIdClient;
import com.google.android.gms.ads.identifier.AdvertisingIdClient.Info;

public class AdIdUtils {

    // Method to retrieve the Google Advertising ID (GAID)

    public static void getGoogleAdId(Context context) {
        // Running the task in a background thread

        AsyncTask.execute(new Runnable() {
            @Override
            public void run() {
                try {
                    // Retrieve the Advertising ID info

                    Info adInfo = AdvertisingIdClient.getAdvertisingIdInfo(context);
                    
                    // Get the GAID (Google Advertising ID)

                    String adId = adInfo.getId();
                    
                    // Check if "Limit Ad Tracking" is enabled by the user

                    boolean isLimitAdTrackingEnabled = adInfo.isLimitAdTrackingEnabled();
                    
                    // Log the results

                    Log.d("GoogleAdID", "Advertising ID: " + adId);
                    Log.d("GoogleAdID", "Limit Ad Tracking Enabled: " + isLimitAdTrackingEnabled);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });
    }
}

앱 세트 ID(ASID) 검색하기

안드로이드 앱 세트 ID는 개발자가 개인정보 보호를 고려한 방식으로 자신의 앱에서 사용자를 추적할 수 있는 방법을 제공합니다. 분석 및 사기 방지에 특히 유용하지만 개인 맞춤 광고나 측정과 같은 광고 목적으로는 사용할 수 없습니다.

JavaKotlin
종속성

빌드.gradle 파일에 Google Play 서비스에 필요한 종속성을 추가했는지 확인하세요:

dependencies {
    implementation 'com.google.android.gms:play-services-appset:16.1.0'
}

 

사용법

이 함수를 사용하려면 활동 또는 애플리케이션 클래스에서 호출하기만 하면 됩니다:

AppSetIdUtils.getAppSetId(getApplicationContext());

 

앱 세트 ID를 검색하는 자바 코드
import android.content.Context;
import android.util.Log;
import com.google.android.gms.appset.AppSet;
import com.google.android.gms.appset.AppSetIdClient;
import com.google.android.gms.appset.AppSetIdInfo;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.android.gms.tasks.Task;

public class AppSetIdUtils {

    // Method to retrieve the App Set ID

    public static void getAppSetId(Context context) {
        // Get the AppSetIdClient instance

        AppSetIdClient client = AppSet.getClient(context);

        // Retrieve the App Set ID information asynchronously

        Task<AppSetIdInfo> task = client.getAppSetIdInfo();

        task.addOnSuccessListener(new OnSuccessListener<AppSetIdInfo>() {
            @Override
            public void onSuccess(AppSetIdInfo info) {
                // Get the App Set ID and its scope

                String appSetId = info.getId();
                int scope = info.getScope();

                // Log the results

                Log.d("AppSetID", "App Set ID: " + appSetId);
                Log.d("AppSetID", "Scope: " + (scope == AppSetIdInfo.SCOPE_DEVELOPER ? "Developer" : "App"));
            }
        }).addOnFailureListener(e -> {
            // Handle any errors that occur during retrieval

            Log.e("AppSetID", "Failed to retrieve App Set ID", e);
        });
    }
}

필수 Android 식별자(Google Play 이외의 기기)

ASID 또는 AIFA를 사용할 수 없는 경우:

  • AMID(Amazon 식별자)를 제공해야 합니다. 아마존 디바이스만 해당.
아마존 광고 ID를 검색하는 방법(비구글플레이 기기)

아마존 ID(AMID) 검색하기

Android 앱에서 Amazon 광고 식별자를 캡처하려면 Settings.Secure 클래스를 사용하여 식별자를 검색하고 사용자의 광고 추적 기본 설정을 확인할 수 있습니다. 다음은 Amazon 문서에서 제공하는 정보를 기반으로 한 깔끔하고 간단한 코드 예제입니다:

광고 ID를 사용할 수 없는 시나리오(예: Fire OS가 아닌 기기 또는 이전 버전의 Fire OS)를 처리해야 합니다.

광고 또는 분석 목적으로 이 식별자를 사용할 때는 항상 사용자의 광고 추적 제한 기본 설정을 준수하세요. 이 코드는 Amazon의 가이드라인에 따라 Fire OS 5.1 이상을 실행하는 Amazon Fire 기기에서 작동해야 합니다.

JavaKotlin
사용 방법

활동이나 서비스에서 이 메서드를 호출하려면 ContentResolver를 전달하면 됩니다:

// Example usage in an Activity

AdvertisingIdHelper.getAmazonAdvertisingId(getContentResolver());

 

아마존 광고 ID(AMID) 검색을 위한 자바 코드
import android.content.ContentResolver;
import android.provider.Settings;
import android.provider.Settings.SettingNotFoundException;
import android.util.Log;

public class AdvertisingIdHelper {

    public static void getAmazonAdvertisingId(ContentResolver contentResolver) {
        String advertisingID = "";
        boolean limitAdTracking = false;

        try {
            // Get user's ad tracking preference

            limitAdTracking = (Settings.Secure.getInt(contentResolver, "limit_ad_tracking") == 0) ? false : true;

            // Get the Amazon Advertising ID

            advertisingID = Settings.Secure.getString(contentResolver, "advertising_id");

            // Log the values for demonstration purposes

            Log.d("AdvertisingID", "Amazon Advertising ID: " + advertisingID);
            Log.d("LimitAdTracking", "Limit Ad Tracking: " + limitAdTracking);

        } catch (SettingNotFoundException e) {
            // Handle case where settings are not available (e.g., non-Fire OS devices)

            Log.e("AdvertisingID", "Advertising ID not supported on this device", e);
        }
    }
}
  • OAID(오픈 광고 식별자)를 제공해야 합니다. 중국 국내 디바이스.
오픈 광고 ID를 검색하는 방법(구글 플레이 외)

OAID(오픈 광고 ID) 검색하기

OAID(개방형 광고 식별자)는 Android 기기, 특히 중국에서 제조된 기기에서 광고 목적으로 사용되는 고유한 익명 식별자입니다. 중국 시장과 같이 구글 플레이 서비스를 사용할 수 없거나 지원하지 않는 기기에서 구글의 광고 ID(GAID)를 대체하기 위해 모바일 보안 연합(MSA)에서 도입했습니다.

OAID는 주로 Google Play 서비스가 제한된 환경에서 광고 어트리뷰션 및 사용자 추적에 사용되며, 광고주와 개발자가 익명성을 유지하면서 사용자 행동을 추적할 수 있도록 해줍니다.

OAID는 화웨이, 샤오미 등의 브랜드를 포함한 대부분의 중국 제조 안드로이드 기기에서 사용할 수 있습니다. MSA SDK 또는 화웨이 모바일 서비스(HMS)를 사용하여 액세스할 수 있습니다.

JavaKotlin
종속성

build.gradle 파일에 MSA SDK에 필요한 종속성이 포함되어 있는지 확인하세요.

dependencies {
    implementation 'com.bun.msa.sdk:msa:1.0.26'  // Example version; check for the latest one

}

 

OAID를 검색하는 Java 코드
import android.os.Bundle;
import android.util.Log;
import androidx.appcompat.app.AppCompatActivity;
import com.bun.msa.sdk.DeviceId;
import com.bun.msa.sdk.DeviceIdSupplier;
import com.bun.msa.sdk.IIdentifierListener;

public class MainActivity extends AppCompatActivity {

    private static final String TAG = "OAIDExample";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        // Initialize and request OAID

        getOAID();
    }

    private void getOAID() {
        try {
            // Create a DeviceId instance and request OAID asynchronously

            DeviceId deviceId = new DeviceId(this);
            deviceId.getDeviceIds(new IIdentifierListener() {
                @Override
                public void onSupport(boolean isSupport, DeviceIdSupplier supplier) {
                    if (isSupport && supplier != null) {
                        // Retrieve OAID from supplier

                        String oaid = supplier.getOAID();
                        Log.d(TAG, "OAID: " + oaid);
                    } else {
                        Log.e(TAG, "OAID not supported on this device");
                    }
                }
            });
        } catch (Exception e) {
            Log.e(TAG, "Error retrieving OAID", e);
        }
    }
}
  • 다른 디바이스 식별자가 없는 경우 ANDI(Android ID)를 제공할 수 있습니다.
Android ID를 검색하는 방법(Google Play 외)

안드로이드 ID(ANDI) 검색하기

안드로이드 ID는 기기를 처음 설정할 때 안드로이드 운영 체제에서 생성하는 64비트 고유 식별자입니다. 장치 수명 기간 동안 영구적으로 유지되도록 설계되었지만 공장 초기화와 같은 특정 조건에서는 초기화될 수 있습니다.

안드로이드 ID는 각 디바이스마다 고유하며, 안드로이드 8.0(오레오)부터는 앱과 사용자별로 범위가 지정됩니다. 즉, 동일한 디바이스에 있는 여러 앱은 동일한 서명 키를 공유하지 않는 한 서로 다른 Android ID를 받게 됩니다.

Android ID는 디바이스를 초기화하거나 OTA(무선) 업데이트 후 앱을 삭제했다가 다시 설치하지 않는 한 일정하게 유지됩니다.

JavaKotlin
사용 방법

Android 앱에서 Android ID를 검색하려면 다음 코드 스니펫을 사용할 수 있습니다:

import android.provider.Settings;
import android.content.Context;

String androidId = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);

필수 웹 식별자

  • SDID는 모든 S2S 요청에 필요합니다.
Singular 웹 SDK 디바이스 ID(SDID)를 검색하는 방법

Singular 웹 SDK 디바이스 ID(SDID) 검색하기

설명

종속성

Singular 웹 SDK가 구현되어 있어야 합니다.

사용법

이 방법을 사용하려면 Singular SDK가 초기화된 후 웹 사이트 코드에서 호출하기만 하면 됩니다:

window.singularSdk.getSingularDeviceId()

필수 모바일 디바이스 매개변수

  • 로캘, 디바이스 제조사, 디바이스 모델, 빌드는 모든 S2S 요청에 필수입니다.
로캘, 디바이스 제조사, 모델, 빌드를 검색하는 방법

로캘, 디바이스 제조사, 모델 및 빌드 검색하기

Objective-CSwiftJavaKotlin
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <sys/sysctl.h>

// Retrieve the Locale

NSString *retrieveLocale() {
    NSString *locale = [[NSLocale currentLocale] localeIdentifier];
    NSLog(@"Locale: %@", locale);
    return locale;
}

// Retrieve the Manufacturer

NSString *retrieveManufacturer() {
    // Set the Device Make to Apple    

    return @"Apple";
}

                            
// Retrieve the Device Model

NSString *deviceModel() {
    size_t bufferSize = 64;
    char model[bufferSize];
    int status = sysctlbyname("hw.machine", model, &bufferSize, NULL, 0);
    
    if (status == 0) {
        NSString *deviceModel = [NSString stringWithCString:model encoding:NSUTF8StringEncoding];
        NSLog(@"Device Model: %@", deviceModel);
        return deviceModel;
    } else {
        NSLog(@"Unable to retrieve device model.");
        return nil;
    }
}

// Retrieve the Build Version

NSString *buildVersion() {
    size_t bufferSize = 64;
    char build[bufferSize];
    int status = sysctlbyname("kern.osversion", build, &bufferSize, NULL, 0);
    
    if (status == 0) {
        NSString *buildVersion = [NSString stringWithCString:build encoding:NSUTF8StringEncoding];
        NSLog(@"Build Version: %@", buildVersion);
        return buildVersion;
    } else {
        NSLog(@"Unable to retrieve build version.");
        return nil;
    }
}

// Example usage

int main(int argc, const char * argv[]) {
    @autoreleasepool {
        // Retrieve Locale

        NSString *locale = retrieveLocale();

        // Retrieve Device Make

        NSString *make = retrieveManufacturer();
              
        // Retrieve Device Model

        NSString *model = deviceModel();
        
        // Retrieve Build Version

        NSString *build = buildVersion();
        
        // Log results

        if (locale) {
            NSLog(@"Locale: %@", locale);
        }
        
        if (make) {
            NSLog(@"Device Make: %@", make);
        }
              
        if (model) {
            NSLog(@"Device Model: %@", model);
        }
        
        if (build) {
            NSLog(@"Build Version: %@", build);
        }
    }
    return 0;
}