AppsFlyerObject 프리팹을 사용하거나 수동으로 플러그인을 초기화할 수 있습니다.

AppsFlyerObject.prefab 사용하기

  1. 애셋 > 앱스플라이어로 이동하여 AppsFlyerObject.prefab을 씬으로 드래그합니다.


  2. 다음 필드를 업데이트합니다.
설정설명
Dev 키앱스플라이어의 Dev-Key, 앱스플라이어 대시보드에서 액세스할 수 있습니다.
앱 IDiTunes 애플리케이션 ID. (앱이 iOS 용이 아닌 경우 필드를 비워 두십시오)
전환 데이터 가져오기앱이 딥링킹에 앱스플라이어를 사용하는 경우 이 값을 true로 설정합니다.
isDebug디버그 로그를 보려면 이 값을 true로 설정합니다. (개발 전용!)
  1. 자산 > 앱스플라이어 > AppsFlyerObjectScript.cs의 코드를 사용 가능한 다른 API로 업데이트합니다.

수동 연동

게임 개체를 만들고 다음 init 코드를 추가합니다.

using AppsFlyerSDK;

public class AppsFlyerObjectScript : MonoBehaviour
{
  void Start()
  {
    AppsFlyer.initSDK("devkey", "appID");
    AppsFlyer.startSDK();
  }
}

일러두기:

  • 게임 개체에서 destroy를 호출하지 않도록 하십시오.
  • Use DontDestroyOnLoad 새 장면을 로드할 때 개체를 유지하기 위한 것입니다.

Set customer user ID

Set your own unique customer user ID (CUID) and cross-reference it with the unique AppsFlyer ID.

  • Appear in AppsFlyer raw data CSV reports.
  • Can be used in postback APIs to cross-reference with internal IDs.
    To set the CUID, use:
AppsFlyer.setCustomerUserId("someId");

Good practice! Set the CUID early in the app flow—it is only associated with events reported after its setup.

  • Recorded events will be associated with the CUID.
  • Related data will appear in the raw data reports for installs and events..

Associate the CUID with the install event

If it’s important for you to associate the install event with the CUID, call setCustomerUserId 호출 전에 startSDK.

ATTrackingManager로 IDFA 수집하기

  1. 다음을 AppTrackingTransparency Xcode 프로젝트에 추가할 프레임워크입니다.

  2. 다음 Info.plist:

    1. 리스트에 항목을 추가하십시오. 옆의 +를 누르면 됩니다 Information Property List.
    2. 스크롤 다운하여 선택 Privacy - Tracking Usage Description.
    3. IDFA 수집 허가를 요청할 때 앱 사용자에게 보일 문구를 값으로 입력합니다.
  3. 호출 waitForATTUserAuthorizationWithTimeoutInterval API startSDK()

    #if UNITY_IOS && !UNITY_EDITOR
    AppsFlyer.waitForATTUserAuthorizationWithTimeoutInterval(60);
    #endif
    
  4. Request the tracking authorization where you wish to display the prompt:

    You can use the following package or any other package that allows you to request the tracking authorization.

    
    using Unity.Advertisement.IosSupport;
    
    /*  ... */
    
    if (ATTrackingStatusBinding.GetAuthorizationTrackingStatus() 
         == ATTrackingStatusBinding.AuthorizationTrackingStatus.NOT_DETERMINED)
        {
            ATTrackingStatusBinding.RequestAuthorizationTracking();
        }
     /*  ... */
    

Customizing the ATT consent dialog

Xcode 프로젝트의 다음을 수정하여 ATT 승인 대화상자를 사용자정의할 수 있습니다. info.plist:

더 자세한 내용은 Apple 문서를 참조하세요.


Send consent for DMA compliance

Unity SDK plugin offers two alternative methods for gathering consent data:

Through a Consent Management Platform (CMP): If the app uses a CMP that complies with the Transparency and Consent Framework (TCF) v2.2 protocol, the Unity SDK can automatically retrieve the consent details.

OR

Through a dedicated Unity SDK API: Developers can pass Google's required consent data directly to the Unity SDK using a specific API designed for this purpose.

Use CMP to collect consent data

  1. SDK 초기화.

  2. Call enableTCFDataCollection(true) api before startSDK() to instruct the SDK to collect the TCF data from the device.

  3. Use the CMP to decide if you need the consent dialog in the current session to acquire the consent data. If you need the consent dialog move to step 4; otherwise move to step 5.

  4. Get confirmation from the CMP that the user has made their consent decision and the data is available.

  5. Call start().

        AppsFlyer.initSDK(devKey, appID, this);
    
        AppsFlyer.enableTCFDataCollection(true);
        
        //YOUR_CMP_FLOW()
        // if already has consent ready - you can start
            AppsFlyer.startSDK();
            
        //else Waiting for CMP completion and data ready and then start
        
            AppsFlyer.startSDK();
    

Manually collect consent data

  1. SDK 초기화.
  2. Determine whether the GDPR applies or not to the user.

When GDPR applies to the user

  1. Given that GDPR is applicable to the user, determine whether the consent data is already stored for this session.
    i. If there is no consent data stored, show the consent dialog to capture the user consent decision.
    ii. If there is consent data stored continue to the next step.

  2. To transfer the consent data to the SDK create an AppsFlyerConsent object with the following parameters:

    • hasConsentForDataUsage - Indicates whether the user has consented to use their data for advertising purposes.
    • hasConsentForAdsPersonalization - Indicates whether the user has consented to use their data for personalized advertising.
  3. Call setConsentData()with the AppsFlyerConsent object.

  4. Call start().

            
        // If the user is subject to GDPR - collect the consent data
        // or retrieve it from the storage
        ...
        // Set the consent data to the SDK:
        AppsFlyerConsent consent = AppsFlyerConsent.ForGDPRUser(true, true);
        AppsFlyer.setConsentData(consent);
            
        AppsFlyer.startSDK();
    

When GDPR does not apply to the user

  1. Create an AppsFlyerConsent object using the ForNonGDPRUser() initializer. This initializer doesn’t accept any parameters.

  2. Pass the empty AppsFlyerConsent object to setConsentData().

  3. Call start().

        // If the user is not subject to GDPR:
        AppsFlyerConsent consent = AppsFlyerConsent.ForNonGDPRUser();
        AppsFlyer.setConsentData(consent);
            
        AppsFlyer.startSDK();
    

Verify consent data is sent

To test whether your SDK sends DMA consent data with each event, perform the following steps:

  1. Enable the SDK debug mode.
  2. Search for consent_data in the log of the outgoing request.

for more information visit iOS
Android


SKAN 포스트백을 앱스플라이어로 보내기

앱스플라이어 엔드포인트를 등록하려면 info.plist에 NSAdvertisingAttributionReportEndpoint 키를 추가하고 값을 다음과 같이 설정해야 합니다 https://appsflyer-skadnetwork.com/.
info.plist를 업데이트하는 방법에 대한 자세한 내용은 여기에서 확인할 수 있습니다.


MacOS 초기화

  1. 프리팹 사용 AppsFlyerObject
  2. MacOS 앱 ID 추가
  3. 플랫폼 용으로 PC, Mac & Linux Standelone 구축하고 MacOS 타겟 플랫폼으로 선택합니다.

리스너 요청(선택사항)

  1. 'AppsFlyer.cs'의 스크립트를 앱스플라이어 초기화 코드로 게임 개체에 첨부합니다. (AppsFlyerObject, ect)
  2. startSDK() 앞에 다음 코드를 추가합니다.

세션 응답 예시:

    void Start()
    {
        AppsFlyer.OnRequestResponse += AppsFlyerOnRequestResponse;
        
        AppsFlyer.initSDK(devKey, appID, this);
        AppsFlyer.startSDK();
    }

    void AppsFlyerOnRequestResponse(object sender, EventArgs e)
    {
        var args = e as AppsFlyerRequestEventArgs;
        AppsFlyer.AFLog("AppsFlyerOnRequestResponse", " status code " + args.statusCode);
    }

인앱 응답 예시:

    void Start()
    {
        AppsFlyer.OnInAppResponse += (sender, args) =>
        {
            var af_args = args as AppsFlyerRequestEventArgs;
            AppsFlyer.AFLog("AppsFlyerOnRequestResponse", " status code " + af_args.statusCode);
        };
        
        AppsFlyer.initSDK(devKey, appID, this);
        AppsFlyer.startSDK();
    }


statusCodeerrorDescription
200null
10"Event timeout. Check 'minTimeBetweenSessions' param
11"Skipping event because 'isStopTracking' enabled"
40Network error: Error description comes from Android
41"No dev key"
50"Status code failure" + 서버에서 받은 실제 응답 코드