アプリ内イベント
アプリ内イベント
アプリ内イベントにより、アプリ内の動作に関するインサイトを得ることができます。ROI(投資収益率)やLTV(顧客生涯価値)を計測するために、時間を取って計測するイベントを定義することをお勧めします。
Recording in-app events is performed by calling logEvent with event name and value parameters. See In-App Events documentation for more details.
Note: An In-App Event name must be no longer than 45 characters. Events names with more than 45 characters do not appear in the dashboard, but only in the raw Data, Pull and Push APIs.
Find more info about recording events here.
イベントの送信
logEvent(eventName, eventValues, success, error)
parameter | type | description |
---|---|---|
eventName | 文字列 | In-App Event name |
イベント値 | JSON | イベントと共に送信されるイベント値 |
success | function | success callback |
エラー | function | error callback |
例:
const eventName = 'af_add_to_cart';
const eventValues = {
af_content_id: 'id123',
af_currency: 'USD',
af_revenue: '2',
};
appsFlyer.logEvent(
eventName,
eventValues,
(res) => {
console.log(res);
},
(err) => {
console.error(err);
}
);
アプリ内購入の検証
Receipt validation is a secure mechanism whereby the payment platform (e.g. Apple or Google) validates that an in-app purchase indeed occurred as reported.
Learn more here.
❗Important❗ for iOS - set SandBox to true
appsFlyer.setUseReceiptValidationSandbox(true);
parameter | type | description |
---|---|---|
purchaseInfo | JSON | In-App Purchase parameters |
successC | function | success callback (generated link) |
errorC | function | error callback |
例:
let info = {
publicKey: 'key',
currency: 'biz',
signature: 'sig',
purchaseData: 'data',
price: '123',
productIdentifier: 'identifier',
currency: 'USD',
transactionId: '1000000614252747',
additionalParameters: {'foo': 'bar'},
};
appsFlyer.validateAndLogInAppPurchase(info, res => console.log(res), err => console.log(err));
更新済 11か月前