アプリ内イベントのトラッキング
アプリ内イベントをトラッキングして、キャンペーンのパフォーマンスを分析し、ユーザーのログイン、登録、チュートリアル完了、進行状況のマイルストーンなどの主要業績評価指標(KPI)を測定します。
標準イベントと属性
標準イベントの使用
Singular は、広告ネットワークがレポートおよび最適化のために認識する 標準イベント をサポートしています。自動認識とセットアップの簡素化のため、可能な限り標準イベント名を使用してください。
UA、マーケティング、またはビジネスチームが、組織のマーケティング KPI に基づいてイベントのリストを作成する必要があります。計画にあたっては、ガイド アプリ内イベントのトラッキング方法:Singular アトリビューションのお客様向けガイド を参照してください。
各イベントはさまざまな属性をサポートしています。実装の詳細については、 イベントごとに推奨される標準属性 を参照してください。
イベントの送信
イベント実装のガイドライン
データを充実させるためのオプション属性とともに、
Event()
メソッドを使用してイベントを Singular に送信します。
-
標準イベント:
標準イベントリストにある
イベントの Unity 名
を使用します。例:
Events.sngLogin - カスタムイベント: 標準イベントに一致しないアプリ固有のイベントには、文字数制限に準拠した任意の説明的な文字列を使用します
カスタムイベントの制限:
- 言語: サードパーティパートナーおよび分析ソリューションとの互換性を確保するため、イベント名と属性は英語で渡してください
- イベント名: 32 ASCII 文字までに制限されます。非 ASCII 文字列は、UTF-8 に変換した際に 32 バイト未満である必要があります
- 属性と値: 500 ASCII 文字までに制限されます
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>
使用例
// 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)を測定します。
収益データは 3 つのチャネルを通じて流れます:
- インタラクティブレポート: Singular ダッシュボードで収益指標を表示します
- エクスポートログ: カスタム分析のための詳細な ETL データにアクセスします
- リアルタイムポストバック: 外部プラットフォームに収益イベントを送信します
収益イベントの制限:
- イベント名: カスタム収益イベント名は 32 ASCII 文字(非 ASCII の場合は UTF-8 に変換した際に 32 バイト)までに制限されます
- 属性: イベント属性名と値は 500 ASCII 文字までに制限されます
- 通貨コード: すべて大文字で、3 文字の ISO 4217 標準 に従う必要があります(例:USD、EUR、INR)
注: 異なる通貨での収益は、Singular アカウントで設定した組織の優先通貨に自動的に換算されます。
ベストプラクティス
- 標準的な命名: Singular の 標準イベントおよび属性の命名規則 を使用します
- 言語: 広告ネットワークのポストバック互換性を向上させるため、カスタム収益イベント名は英語で送信します
- ゼロ以外の金額: 金額が 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)
使用例
// 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)
使用例
// 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)
使用例
// 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)
使用例
// 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 を分析します。
要件:
- デバイス識別子のキャプチャ: アプリ内の登録またはログインイベント中に、デバイス識別子をキャプチャして渡し、このデータをユーザー ID とともにサーバーに保存します。正確なアトリビューションを確保するため、ユーザーが新しいアプリセッションを生成した際に識別子を更新します
- プラットフォーム固有の識別子: プラットフォームに一致するデバイス識別子(例:iOS デバイスの場合は IDFA または IDFV、Android デバイスの場合は GAID)とともにサーバーサイドイベントを送信します
- リアルタイム更新: Singular Internal BI ポストバックメカニズムを使用して、イベントをリアルタイムでエンドポイントにプッシュします。 Internal BI Postback FAQ を参照してください
- 実装の詳細: サーバー間インテグレーションガイドの 「Tracking Revenue」 セクションを確認してください
収益プロバイダーからのイベント送信
RevenueCat や adapty などのサードパーティの収益プロバイダーを統合して、購入およびサブスクリプションの収益を Singular に送信します。
サポートされるプロバイダー:
- RevenueCat: 詳細は RevenueCat のドキュメント を参照してください
- adapty: 詳細は adapty のドキュメント を参照してください
- Superwall: 詳細は Superwall のドキュメント を参照してください
- Xsolla: 詳細は Xsolla のドキュメント を参照してください
Segment からのイベント送信
Segment に「Cloud-Mode」デスティネーションを追加することで、Segment が Singular SDK と並行して Singular にイベントを送信できるようにします。
詳細なセットアップ手順については、実装ガイド Singular-Segment インテグレーション に従ってください。