アプリ内イベントのトラッキング
アプリ内イベントをトラッキングして、キャンペーンのパフォーマンスを分析し、ユーザーのログイン、登録、チュートリアル完了、進行マイルストーンなどの主要業績評価指標(KPI)を測定します。
標準イベントと属性
標準イベントの使用
Singularは、広告ネットワークがレポートと最適化のために認識する 標準イベント をサポートしています。自動認識とシンプルな設定のため、可能な限り標準イベント名を使用してください。
UA、マーケティング、またはビジネスチームが、組織のマーケティングKPIに基づいてイベントのリストを作成する必要があります。計画については、ガイド アプリ内イベントのトラッキング方法: Singularアトリビューション顧客向けガイド を参照してください。
各イベントはさまざまな属性をサポートしています。実装の詳細については、 イベントごとの推奨標準属性 を参照してください。
イベントの送信
イベント実装ガイドライン
eventJSON
または
event
メソッドを使用してSingularにイベントを送信します(可読性向上のため
eventJSON
を推奨します)。
-
標準イベント:
標準イベントリストの
イベントのAndroid名
を使用します(例:
sngTutorialComplete) - カスタムイベント: 標準イベントに一致しないアプリ固有のイベントの場合、文字数制限に準拠した任意の説明的な文字列を使用します
カスタムイベントの制限:
- 言語: サードパーティパートナーや分析ソリューションとの互換性を確保するため、イベント名と属性は英語で渡してください
- イベント名: ASCII文字32文字に制限されます。非ASCII文字列はUTF-8に変換した際に32バイト未満である必要があります
- 属性と値: ASCII文字500文字に制限されます
eventJSONメソッド
構造化データのためにJSONObject形式を使用して、追加情報とともにユーザーイベントを報告します。
メソッドシグネチャ:
Singular.eventJSON(String name, JSONObject args)
注:
args
パラメーターは、1つ以上のキーと値のペアを含むJSONObjectです。キーは文字列である必要があり、値はJSONObject値として許可される任意の型にできます。
使用例
// Example 1: Standard event with recommended attributes
val att = JSONObject().apply {
put(Attributes.sngAttrContent.toString(), "Telugu")
put(Attributes.sngAttrContentId.toString(), 32)
put(Attributes.sngAttrContentType.toString(), "video")
put(Attributes.sngAttrSuccess.toString(), 75)
}
Singular.eventJSON(Events.sngTutorialComplete.toString(), att)
// Example 2: Custom event with custom attributes
val att = JSONObject().apply {
put("Points", 500)
put("score", 650)
}
Singular.eventJSON("Bonus Points Earned", att)
// Example 1: Standard event with recommended attributes
JSONObject att = new JSONObject();
try {
att.put(Attributes.sngAttrContent.toString(), "Telugu");
att.put(Attributes.sngAttrContentId.toString(), 32);
att.put(Attributes.sngAttrContentType.toString(), "video");
att.put(Attributes.sngAttrSuccess.toString(), 92);
} catch (JSONException e) {
e.printStackTrace();
}
Singular.eventJSON(Events.sngTutorialComplete.toString(), att);
// Example 2: Custom event with custom attributes
JSONObject att = new JSONObject();
try {
att.put("Points", 500);
att.put("score", 650);
} catch (JSONException e) {
e.printStackTrace();
}
Singular.eventJSON("Bonus Points Earned", att);
eventメソッド
可変引数を使用して、追加情報の有無にかかわらずユーザーイベントを報告します。
メソッドシグネチャ:
Singular.event(String eventName)
Singular.event(String eventName, Object... args)
注:
args
パラメーターは、1つ以上のキーと値のペアを受け取ります。キーは文字列である必要があり、値はJSONObject値として許可される任意の型(JSONObject、JSONArray、String、Boolean、Integer、Long、Double、またはNULL)にできます。
args
リストには偶数個の要素を含める必要があり、そうでない場合イベントは拒否されます。
使用例
// Example 1: Standard event without attributes
Singular.event(Events.sngSubscribe.toString())
// Example 2: Standard event with recommended attributes
Singular.event(Events.sngTutorialComplete.toString(),
Attributes.sngAttrContent.toString(), "Telugu",
Attributes.sngAttrContentId.toString(), "32",
Attributes.sngAttrContentType.toString(), "video",
Attributes.sngAttrSuccess.toString(), "yes"
)
// Example 3: Custom event without attributes
Singular.event("SignUp")
// Example 4: Custom event with custom attribute
Singular.event("Bonus Points Earned", "Points", 500)
// Example 1: Standard event without attributes
Singular.event(Events.sngSubscribe.toString());
// Example 2: Standard event with recommended attributes
Singular.event(Events.sngTutorialComplete.toString(),
Attributes.sngAttrContent.toString(), "Spanish",
Attributes.sngAttrContentId.toString(), 52,
Attributes.sngAttrContentType.toString(), "video",
Attributes.sngAttrSuccess.toString(), 46
);
// Example 3: Custom event without attributes
Singular.event("SignUp");
// Example 4: Custom event with custom attribute
Singular.event("Bonus Points Earned", "Points", 500);
アプリ内収益のトラッキング
アプリ内購入(IAP)、サブスクリプション、カスタム収益ソースからの収益をトラッキングして、キャンペーンのパフォーマンスと広告費用対効果(ROAS)を測定します。
収益データは3つのチャネルを通じて流れます:
- インタラクティブレポート: Singularダッシュボードで収益指標を表示します
- Export Logs: カスタム分析のための詳細なETLデータにアクセスします
- リアルタイムポストバック: 外部プラットフォームに収益イベントを送信します
収益イベントの制限:
- イベント名: カスタム収益イベント名はASCII文字32文字(非ASCIIの場合、UTF-8に変換すると32バイト)に制限されます
- 属性: イベント属性名と値はASCII文字500文字に制限されます
- 通貨コード: すべて大文字で、3文字の ISO 4217標準 に従う必要があります(例: USD、EUR、INR)
ベストプラクティス
- 標準的な命名: Singularの 標準イベントおよび属性の命名規則 を使用します
- 言語: 広告ネットワークのポストバック互換性向上のため、カスタム収益イベント名は英語で送信します
- ゼロ以外の金額: 金額が0より大きいか小さい場合にのみ収益イベントを送信します
非サブスクリプションのアプリ内購入
Purchaseオブジェクトの連携
Google Billing Libraryの
Purchase
オブジェクトを
revenue
または
customRevenue
メソッドに渡すことで、強化されたレポートとトランザクション検証を実現します。
メリット:
- 豊富なデータ: Singularが包括的なレポートのための完全なトランザクション詳細を受信します
- 不正防止: トランザクションのレシートにより検証が可能になり、アプリ内不正に対抗します
注:
-
カスタムイベント名:
customRevenueメソッドは、レポートでイベントタイプ別に収益を分類するためのカスタムイベント名を受け取ります - 通貨換算: 異なる通貨の収益は、組織の優先通貨に自動的に換算されます
Purchaseを使用したrevenueメソッド
自動検証と強化されたデータのために、Purchaseオブジェクトとともに収益イベントを送信します。
メソッドシグネチャ:
Singular.revenue(String currency, double amount, Object purchase)
使用例
Singular.revenue("USD", 5.50, purchase)
Singular.revenue("USD", 5.50, purchase);
Purchaseを使用したcustomRevenueメソッド
分類された収益トラッキングのために、カスタム名とPurchaseオブジェクトとともに収益イベントを送信します。
メソッドシグネチャ:
Singular.customRevenue(String eventName, String currency, double amount, Object purchase)
使用例
Singular.customRevenue("MyCustomRevenue", "USD", 5.50, purchase)
Singular.customRevenue("MyCustomRevenue", "USD", 5.50, purchase);
サブスクリプション収益
サブスクリプションイベントの実装
サブスクリプションの購入と更新をトラッキングして、ユーザー行動と継続的な収益創出に関するインサイトを獲得します。
実装ガイド: Singular SDKでサブスクリプションをトラッキングする詳細な手順については、包括的な サブスクリプションイベント技術実装ガイド を確認してください。
Purchase検証なしのカスタム収益
手動収益トラッキング
Purchaseオブジェクトなしで通貨、金額、およびオプションの製品詳細を渡して収益をトラッキングします。このメソッドは検証用のトランザクションレシートを提供しないことに注意してください。
重要: これらのメソッドを使用すると、Singularはトランザクションを検証できません。可能な限り、上記で説明したPurchaseオブジェクトのメソッドを使用することを強くお勧めします。
Purchaseなしのrevenueメソッド
通貨、金額、およびオプションの製品詳細とともに収益イベントを送信します。
メソッドシグネチャ:
Singular.revenue(String currency, double amount)
Singular.revenue(String currency, double amount, String productSKU, String productName, String productCategory, int productQuantity, double productPrice)
Singular.revenue(String currency, double amount, Map<String, Object> attributes)
使用例
// Without product details
Singular.revenue("USD", 5.50)
// With product details
Singular.revenue("EUR", 5.00, "SKU1928375", "Reservation Fee", "Fee", 1, 5.00)
// With product details in an attribute map
val attributes = mutableMapOf<String, Any>().apply {
put("product_id", "com.app.premium")
put("transaction_id", "T12345")
put("quantity", 1)
put("is_trial", false)
}
Singular.revenue("USD", 9.99, attributes)
// Without product details
Singular.revenue("USD", 5.50);
// With product details
Singular.revenue("EUR", 5.00, "SKU1928375", "Reservation Fee", "Fee", 1, 5.00);
// With product details in an attribute map
Map<String, Object> attributes = new HashMap<>();
attributes.put("product_id", "com.app.premium");
attributes.put("transaction_id", "T12345");
attributes.put("quantity", 1);
attributes.put("is_trial", false);
Singular.revenue("USD", 9.99, attributes);
PurchaseなしのcustomRevenueメソッド
指定されたイベント名、通貨、金額、およびオプションのトランザクション属性とともにカスタム収益イベントを送信します。
メソッドシグネチャ:
Singular.customRevenue(String eventName, String currency, double amount)
Singular.customRevenue(String eventName, String currency, double amount, String productSKU, String productName, String productCategory, int productQuantity, double productPrice)
Singular.customRevenue(String eventName, String currency, double amount, Map<String, Object> attributes)
使用例
// Without product details
Singular.customRevenue("MyCustomRevenue", "USD", 5.50)
// With product details
Singular.customRevenue("MyCustomRevenue", "EUR", 5.00, "SKU1928375", "Reservation Fee", "Fee", 1, 5.00)
// With product details in an attribute map
val attributes = mutableMapOf<String, Any>().apply {
put("product_id", "com.app.premium")
put("transaction_id", "T12345")
put("quantity", 1)
put("is_trial", false)
}
Singular.customRevenue("MyCustomRevenue", "USD", 9.99, attributes)
// Without product details
Singular.customRevenue("MyCustomRevenue", "USD", 5.50);
// With product details
Singular.customRevenue("MyCustomRevenue", "EUR", 5.00, "SKU1928375", "Reservation Fee", "Fee", 1, 5.00);
// With product details in an attribute map
Map<String, Object> attributes = new HashMap<>();
attributes.put("product_id", "com.app.premium");
attributes.put("transaction_id", "T12345");
attributes.put("quantity", 1);
attributes.put("is_trial", false);
Singular.customRevenue("MyCustomRevenue", "USD", 9.99, attributes);
ハイブリッドイベントトラッキング (上級)
最適なアトリビューションのために、アプリに統合されたSingular SDKを通じてすべてのイベントと収益を送信してください。ただし、必要に応じてSingularは他のソースからイベントを収集できます。
Singular SDKの外部から送信されるイベントは、Singularの サーバー間(S2S)イベントドキュメント に準拠し、正確なアトリビューションのために一致するデバイス識別子を提供する必要があります。
重要:
サーバー間リクエストのデバイス識別子がSingular SDKによって記録された識別子と一致しない場合、不一致が発生します:
- 早期イベント: Singular SDKがデバイス識別子を記録する前にイベントが到着すると、そのイベントは不明なデバイスの「最初のセッション」となり、オーガニックアトリビューションとなります
- 不一致の識別子: Singular SDKがサーバー間リクエストの識別子とは異なるデバイス識別子を記録した場合、イベントは誤ってアトリビューションされます
ハイブリッドイベントトラッキングガイド
内部サーバーからのイベント送信
内部サーバーから収益データを収集して、キャンペーンのパフォーマンスとROIを分析します。
要件:
- デバイス識別子のキャプチャ: アプリ内の登録またはログインイベント中にデバイス識別子をキャプチャして渡し、このデータをUser IDとともにサーバーに保存します。正確なアトリビューションを確保するため、ユーザーが新しいアプリセッションを生成するたびに識別子を更新します
- プラットフォーム固有の識別子: プラットフォームに一致するデバイス識別子(例: iOSデバイスの場合IDFAまたはIDFV)とともにサーバー側イベントを送信します
- リアルタイム更新: Singular Internal BIポストバックメカニズムを使用して、イベントをリアルタイムでエンドポイントにプッシュします。 Internal BI Postback FAQ を参照してください
- 実装の詳細: サーバー間連携ガイドの 「Tracking Revenue」 セクションを確認してください
収益プロバイダーからのイベント送信
RevenueCatやadaptyなどのサードパーティ収益プロバイダーを連携して、購入とサブスクリプションの収益をSingularに送信します。
サポートされるプロバイダー:
- RevenueCat: 詳細は RevenueCatドキュメント を参照してください
- adapty: 詳細は adaptyドキュメント を参照してください
Segmentからのイベント送信
Segmentで「Cloud-Mode」デスティネーションを追加することで、Singular SDKと並行してSegmentがSingularにイベントを送信できるようにします。
詳細な設定手順については、実装ガイド Singular-Segment連携 を参照してください。