Unity SDK - 인앱 이벤트 추적

인앱 이벤트 추적

인앱 이벤트를 추적하여 캠페인 성과를 분석하고 유저 로그인, 회원 가입, 튜토리얼 완료, 진행 단계 마일스톤과 같은 핵심 성과 지표(KPI)를 측정하세요.

표준 이벤트 및 속성

표준 이벤트 사용하기

Singular은 광고 네트워크가 리포팅 및 최적화를 위해 인식하는 표준 이벤트 를 지원합니다. 자동 인식과 간소화된 설정을 위해 가능하면 항상 표준 이벤트 이름을 사용하세요.

UA, 마케팅 또는 비즈니스 팀은 조직의 마케팅 KPI를 기반으로 이벤트 목록을 작성해야 합니다. 계획 수립에 관한 자세한 내용은 인앱 이벤트 추적 방법: Singular 어트리뷰션 고객을 위한 가이드 를 참고하세요.

각 이벤트는 다양한 속성을 지원합니다. 구현 세부 정보는 이벤트별 권장 표준 속성 을 참고하세요.


이벤트 전송

이벤트 구현 가이드라인

데이터를 보강하기 위한 선택적 속성과 함께 Event() 메서드를 사용하여 Singular에 이벤트를 전송하세요.

  • 표준 이벤트: 표준 이벤트 목록에서 이벤트의 Unity 이름 을 사용하세요. 예: Events.sngLogin
  • 커스텀 이벤트: 표준 이벤트와 일치하지 않는 앱 고유의 이벤트의 경우, 문자 제한을 준수하는 설명적인 문자열을 자유롭게 사용하세요

커스텀 이벤트 제한사항:

  • 언어: 서드파티 파트너 및 분석 솔루션과의 호환성을 보장하기 위해 이벤트 이름과 속성은 영어로 전달하세요
  • 이벤트 이름: ASCII 문자 32자로 제한됩니다. ASCII가 아닌 문자열은 UTF-8로 변환했을 때 32바이트 미만이어야 합니다
  • 속성 및 값: ASCII 문자 500자로 제한됩니다

Event 메서드

가변 인수 또는 Dictionary 형식을 사용하여 추가 정보와 함께 또는 추가 정보 없이 유저 이벤트를 보고하세요.

메서드 시그니처:

public static void Event(string name)
public static void Event(string name, params object[] args)
public static void Event(Dictionary<string, object> args, string name)

참고: params object[] args 시그니처를 사용할 때, args 목록은 짝수 개의 요소(키-값 쌍)를 포함해야 하며 그렇지 않으면 이벤트가 거부됩니다. Dictionary를 전달할 때, 값은 다음 유형 중 하나여야 합니다: string, int, long, float, double, null, ArrayList, Dictionary<string, object>

사용 예시

C#
// Example 1: Standard event without attributes
SingularSDK.Event(Events.sngLogin);

// Example 2: Standard event with recommended attributes (key-value pairs)
SingularSDK.Event(Events.sngTutorialComplete,
    Attributes.sngAttrContent, "Unity Basics",
    Attributes.sngAttrContentId, 32,
    Attributes.sngAttrContentType, "video",
    Attributes.sngAttrSuccess, "yes"
);

// Example 3: Standard event with attributes using Dictionary
Dictionary<string, object> attributes = new Dictionary<string, object>()
{
    [Attributes.sngAttrContent] = "Unity Basics",
    [Attributes.sngAttrContentId] = 32,
    [Attributes.sngAttrContentType] = "video",
    [Attributes.sngAttrSuccess] = "yes"
};
SingularSDK.Event(attributes, Events.sngTutorialComplete);

// Example 4: Custom event without attributes
SingularSDK.Event("SignUp");

// Example 5: Custom event with custom attributes
SingularSDK.Event("Bonus Points Earned", "Points", 500, "Level", 5);

인앱 매출 추적

인앱 구매(IAP), 구독 및 커스텀 매출 소스에서 발생하는 매출을 추적하여 캠페인 성과와 광고 비용 대비 수익률(ROAS)을 측정하세요.

매출 데이터는 세 가지 채널을 통해 흐릅니다:

  • 인터랙티브 리포트: Singular 대시보드에서 매출 지표를 확인하세요
  • 익스포트 로그: 커스텀 분석을 위한 상세 ETL 데이터에 액세스하세요
  • 실시간 포스트백: 외부 플랫폼으로 매출 이벤트를 전송하세요

매출 이벤트 제한사항:

  • 이벤트 이름: 커스텀 매출 이벤트 이름은 ASCII 문자 32자 (또는 ASCII가 아닌 경우 UTF-8로 변환 시 32바이트)로 제한됩니다
  • 속성: 이벤트 속성 이름과 값은 ASCII 문자 500자로 제한됩니다
  • 통화 코드: 반드시 모두 대문자여야 하며 세 자리 ISO 4217 표준 을 따라야 합니다 (예: USD, EUR, INR)

참고: 서로 다른 통화의 매출은 Singular 계정에 설정된 조직의 선호 통화로 자동 변환됩니다.

모범 사례

  • 표준 명명 규칙: Singular의 표준 이벤트 및 속성 명명 규칙 을 사용하세요
  • 언어: 광고 네트워크 포스트백 호환성을 개선하기 위해 커스텀 매출 이벤트 이름은 영어로 전송하세요
  • 0이 아닌 금액: 금액이 0보다 크거나 작을 때만 매출 이벤트를 전송하세요

Unity IAP 연동

Unity IAP를 사용한 인앱 구매

데이터를 보강한 리포팅과 트랜잭션 검증을 위해 Unity의 IAP Purchase 또는 Order 객체를 InAppPurchase() 메서드에 전달하세요.

이점:

  • 풍부한 데이터: Singular은 종합적인 리포트를 위해 완전한 트랜잭션 세부 정보를 수신합니다
  • 사기 방지: 트랜잭션 영수증을 통해 검증이 가능하여 인앱 사기에 대응할 수 있습니다

Unity IAP 버전 호환성:

  • Unity IAP v5: Google Play Billing Library 7+와 함께 새로운 Unity Purchasing API 를 사용합니다. Unity 2021.3 LTS 이상과 호환됩니다. InAppPurchase(Order) 메서드를 사용하세요
  • Unity IAP v4: Google Play Billing Library 6와 함께 이전 Unity IAP API 를 사용합니다. Unity 2018.4 LTS부터 2020.3 LTS까지 호환됩니다. InAppPurchase(Product) 메서드를 사용하세요

InAppPurchase 메서드 (Unity IAP v5)

자동 검증과 데이터 보강을 위해 Unity IAP v5의 Order 객체를 사용하여 IAP 이벤트를 전송하세요.

메서드 시그니처:

public static void InAppPurchase(Order order)
public static void InAppPurchase(Order order, Dictionary<string, object> attributes)
public static void InAppPurchase(Order order, bool isRestored)
public static void InAppPurchase(Order order, string eventName, Dictionary<string, object> attributes)

사용 예시

C#
// Example 1: IAP with order object only
SingularSDK.InAppPurchase(order);

// Example 2: IAP with order and additional attributes
Dictionary<string, object> attr = new Dictionary<string, object>()
{
    ["promo_code"] = "SUMMER2025",
    ["user_tier"] = "premium"
};
SingularSDK.InAppPurchase(order, attr);

// Example 3: IAP with restored transaction flag
SingularSDK.InAppPurchase(order, true);

// Example 4: IAP with custom event name and attributes
Dictionary<string, object> attr = new Dictionary<string, object>()
{
    ["subscription_tier"] = "gold",
    ["billing_period"] = "monthly"
};
SingularSDK.InAppPurchase(order, "PremiumSubscription", attr);

InAppPurchase 메서드 (Unity IAP v4)

자동 검증과 데이터 보강을 위해 Unity IAP v4의 Product 객체를 사용하여 IAP 이벤트를 전송하세요.

메서드 시그니처:

public static void InAppPurchase(Product product, Dictionary<string, object> attributes, bool isRestored = false)
public static void InAppPurchase(string eventName, Product product, Dictionary<string, object> attributes, bool isRestored = false)
public static void InAppPurchase(IEnumerable<Product> products, Dictionary<string, object> attributes, bool isRestored = false)
public static void InAppPurchase(string eventName, IEnumerable<Product> products, Dictionary<string, object> attributes, bool isRestored = false)

사용 예시

C#
// Example 1: IAP with single product, no extra attributes
SingularSDK.InAppPurchase(myProduct, null);

// Example 2: IAP with single product and attributes
Dictionary<string, object> attr = new Dictionary<string, object>()
{
    ["promo_code"] = "SUMMER2025",
    ["user_tier"] = "premium"
};
SingularSDK.InAppPurchase(myProduct, attr);

// Example 3: IAP with custom event name
SingularSDK.InAppPurchase("PremiumUpgrade", myProduct, null);

// Example 4: IAP with list of products
SingularSDK.InAppPurchase(myProductList, null);

// Example 5: IAP with list of products and custom event name
SingularSDK.InAppPurchase("BundlePurchase", myProductList, null);

구매 검증 없는 커스텀 매출

수동 매출 추적

Purchase 또는 Order 객체 없이 통화, 금액 및 선택적 제품 세부 정보를 전달하여 매출을 추적하세요. 이 방식은 검증을 위한 트랜잭션 영수증을 제공하지 않는다는 점에 유의하세요.

중요: 이러한 메서드를 사용할 때 Singular은 트랜잭션을 검증할 수 없습니다. 가능하면 항상 위에서 설명한 Unity IAP 메서드를 사용할 것을 강력히 권장합니다.


Revenue 메서드

통화, 금액 및 선택적 제품 세부 정보와 함께 매출 이벤트를 전송하세요.

메서드 시그니처:

public static void Revenue(string currency, double amount)
public static void Revenue(string currency, double amount, string productSKU, string productName, string productCategory, int productQuantity, double productPrice)
public static void Revenue(string currency, double amount, Dictionary<string, object> attributes)

사용 예시

C#
// Example 1: Revenue without product details
SingularSDK.Revenue("USD", 1.99);

// Example 2: Revenue with product details
SingularSDK.Revenue("USD", 4.99, "coin_package_abc123", "Coin Pack 5", "Bundles", 1, 4.99);

// Example 3: Revenue with attributes dictionary
Dictionary<string, object> attributes = new Dictionary<string, object>()
{
    ["productSKU"] = "coin_package_abc123",
    ["productName"] = "Coin Pack 5",
    ["productCategory"] = "Bundles",
    ["productQuantity"] = 2,
    ["productPrice"] = 4.99,
    ["transaction_id"] = "T12345"
};
SingularSDK.Revenue("USD", 9.98, attributes);

CustomRevenue 메서드

지정된 이벤트 이름, 통화, 금액 및 선택적 트랜잭션 속성과 함께 커스텀 매출 이벤트를 전송하세요.

메서드 시그니처:

public static void CustomRevenue(string eventName, string currency, double amount)
public static void CustomRevenue(string eventName, string currency, double amount, string productSKU, string productName, string productCategory, int productQuantity, double productPrice)
public static void CustomRevenue(string eventName, string currency, double amount, Dictionary<string, object> attributes)

사용 예시

C#
// Example 1: Custom revenue without product details
SingularSDK.CustomRevenue("MyCustomRevenue", "USD", 9.99);

// Example 2: Custom revenue with product details
SingularSDK.CustomRevenue("MyCustomRevenue", "USD", 50.50, "abc123", "Premium Item", "Virtual Goods", 2, 25.50);

// Example 3: Custom revenue with attributes dictionary
Dictionary<string, object> attributes = new Dictionary<string, object>()
{
    ["productSKU"] = "premium_bundle_xyz",
    ["productName"] = "Premium Bundle",
    ["productCategory"] = "Bundles",
    ["productQuantity"] = 1,
    ["productPrice"] = 99.99,
    ["discount_applied"] = true
};
SingularSDK.CustomRevenue("PremiumBundlePurchase", "USD", 99.99, attributes);

StoreKit2 지원

Singular Unity SDK는 StoreKit2 트랜잭션 또는 제품 JSON 표현을 직접 받지 않습니다. 자동 검증과 데이터 보강 기능을 통해 StoreKit2로 이루어진 iOS 구매를 추적하려면, 위에서 설명한 InAppPurchase 메서드 (Unity IAP v5) 를 사용하고 Unity IAP의 Order 객체를 전달하세요.


하이브리드 이벤트 추적 (고급)

최적의 어트리뷰션을 위해 모든 이벤트와 매출을 앱에 연동된 Singular SDK를 통해 전송하세요. 다만, 필요한 경우 Singular은 다른 소스에서 이벤트를 수집할 수 있습니다.

Singular SDK 외부에서 전송되는 이벤트는 Singular의 서버 간(Server-to-Server) 이벤트 문서 를 준수해야 하며 정확한 어트리뷰션을 위해 일치하는 디바이스 식별자를 제공해야 합니다.

중요:

서버 간 요청의 디바이스 식별자가 Singular SDK가 기록한 식별자와 일치하지 않으면 불일치가 발생합니다:

  • 조기 이벤트: Singular SDK가 디바이스 식별자를 기록하기 전에 이벤트가 도착하면, 해당 이벤트는 알 수 없는 디바이스의 "첫 세션"이 되어 오가닉 어트리뷰션으로 처리됩니다
  • 불일치 식별자: Singular SDK가 서버 간 요청의 식별자와 다른 디바이스 식별자를 기록한 경우, 해당 이벤트는 잘못 어트리뷰션됩니다

하이브리드 이벤트 추적 가이드

내부 서버에서 이벤트 전송

내부 서버에서 매출 데이터를 수집하여 캠페인 성과와 ROI를 분석하세요.

요구사항:

  • 디바이스 식별자 캡처: 인앱 회원 가입 또는 로그인 이벤트 중에 디바이스 식별자를 캡처하여 전달한 다음, 이 데이터를 User ID와 함께 서버에 저장하세요. 정확한 어트리뷰션을 보장하기 위해 유저가 새로운 앱 세션을 생성할 때 식별자를 업데이트하세요
  • 플랫폼별 식별자: 플랫폼에 일치하는 디바이스 식별자와 함께 서버 측 이벤트를 전송하세요 (예: iOS 디바이스의 경우 IDFA 또는 IDFV, Android 디바이스의 경우 GAID)
  • 실시간 업데이트: Singular Internal BI 포스트백 메커니즘을 사용하여 이벤트를 실시간으로 엔드포인트에 푸시하세요. Internal BI Postback FAQ 를 참고하세요
  • 구현 세부 정보: 서버 간(Server-to-Server) 연동 가이드의 "매출 추적(Tracking Revenue)" 섹션을 검토하세요

매출 제공업체에서 이벤트 전송

RevenueCat 또는 adapty와 같은 서드파티 매출 제공업체를 연동하여 구매 및 구독 매출을 Singular에 전송하세요.

지원되는 제공업체:


Segment에서 이벤트 전송

Segment에 "Cloud-Mode" 대상을 추가하여 Segment가 Singular SDK와 병렬로 Singular에 이벤트를 전송하도록 설정하세요.

자세한 설정 방법은 구현 가이드 Singular-Segment 연동 을 참고하세요.