概要:您可以对应用内购和自动续订产生的收入进行自动验证和衡量,从而全面掌握相关用户的生命周期数据,并获得准确的ROAS信息。
简介
广告主可以通过已验证的应用内购买(IAP)和订阅收入来衡量以下数据:
- 所有通过App Store Connect(iOS)或Google Play Console(安卓)管理的应用内商品购买和订阅收入。
- 退款。
- 未完成交易及延期交易的收入(安卓)。
- 在相关应用内或应用外发生的订阅相关事件。
该IAP和订阅收入解决方案还能用于:
- 确保AppsFlyer记录到的交易数据中没有重复。在iOS中,该方案还能确保家庭共享型交易不会被重复记录。
- 将Apple App Store的交易数据通过AppsFlyer发送给广告主。
- 呈现真实的收入数据,即剔除商店抽成和税费之后的净收入。
这些购买和订阅数据来自:
- 专用于购买事件的AppsFlyer purchase SDK connector(分安卓和iOS,含Unity wrapper)
- 发送到AppsFlyer的App Store和Google Play(RTND实时开发者通知)服务器通知
您可以通过AppsFlyer面板和报告获取购买和订阅收入的数据,也可以通过回传将这些数据共享给合作渠道。
注意事项:
- 如果您使用此IAP和订阅收入衡量解决方案,则不应发送应用内购买事件或执行 ValidateAndLoginAppP urchase,因为这样做会导致重复的收入报告。
- 现有订阅用户打开带有Purchase SDK connector的应用版本后,订阅收入衡量功能即可开始记录该用户的生命周期变化。
链路:
- 用户完成一次应用内购买或自动续订。
- 该应用在应用商店中完成一次交易。
- AppsFlyer purchase SDK connector自动检测购买事件,并将该事件的有效信息(payload)发送到AppsFlyer进行验证和记录。
-
AppsFlyer会与相关的商店验证该次购买,以确保交易信息的真实性。
- 验证成功后,AppsFlyer会记录该次购买或订阅。
- 如果收据验证失败,则该事件会显示在被拦截的应用内事件原始数据报告中(需购买Protect360)。
- AppsFlyer将商店的响应消息发送到SDK connector,然后SDK connector会将收据验证的响应消息(成功或失败)发送到应用。
-
所有传入AppsFlyer的服务器通知都会按照我们的购买和订阅收入逻辑进行处理:
- 对于之前已经由SDK connector上报的交易,我们会对其相关通知进行验证和处理,并在系统内部生成一个购买事件或生命周期事件。
- 与未知交易相关的通知会被忽略。
- 对于iOS平台的所有服务器通知,您可以更改其发送路径,将其发送到您自己的服务器。
IAP和订阅收入的对接流程
请严格按照下表所列的设置说明进行操作,确保IAP和自动续订收入及生命周期事件能得到最准确、最全面的上报,否则会导致永久性的数据上报失真。如需了解各个步骤的完整信息,请见表格下方对应的选项卡。
步骤 | 配置流程 |
---|---|
1 | 针对Google Play的IAP和订阅收入设置消息通知。 |
2 | 针对iOS App Store的IAP和订阅收入设置消息通知。 |
3 |
|
4 | 接入True Revenue tax API。仅用于更改默认税率,无此需求不必配置。在未配置此API的情况下,由ROI360衡量的所有交易都会按默认税率上报税费。 |
5 |
测试对接,确保以下事项:
|
6 | 发布带有SDK connector的安卓和iOS应用版本。 |
第1步:设置Google Play的服务器通知
温馨提示以下信息 :
- 由于IAP和订阅收入的对接设置同时涉及到Google Cloud Platform和AppsFlyer两个平台中的相关操作,因此建议您在设置对接时,全程保持Google Cloud Platform和AppsFlyer的页面处于打开状态。
- AppsFlyer后台的设置需要有管理员权限才能操作。
请按下文说明设置Google Play的通知:
1.1 将您的Google Play开发者账号关联到您的Google Cloud项目
- 从Google Play Console进入您的Google Play开发者账号。
- 将该账号关联到您的Google Cloud项目。详细指南请参考Google提供的说明文档。
- 启用Google Play Developer API。详细指南请参考Google提供的说明文档。
1.2 创建服务账号
- 进入Google Cloud并打开您在1.1中关联的项目。
- 进入该项目下的IAM and Admin > Service Accounts,然后点击Create service account(创建服务账号)。
- 在创建服务帐号的页面中,填写Service account details(服务帐号详细信息)部分的字段。
- 点击Create and continue,进入下一步。
- 在Grant this service account access to the project(为该服务账号开放项目权限)部分的“Select a role”(选择角色)字段中,选择Pub/Sub subscriber。
- 点击Continue > Done,完成服务账号的创建。
1.3 下载账号私钥(private key)
1.4 设置API访问权限
- 从Google Play Console进入Users and permissions(用户和权限)。
- 在Users and permissions(用户和权限)列表中,找到您在1.2中创建的服务帐号,然后点击Manage。
- 在Permissions(权限)部分,进入Account permissions(账号权限)选项卡,然后同时勾选以下两项:
- View financial data(查看财务数据)
- Manage orders and subscriptions(管理订单和订阅)
- 点击Invite user(邀请用户),然后再点击Send invitation(发送邀请)。
【在以下两步中任选其一】1.5:直接向AppsFlyer发送Google Play通知
Google Play的IAP和订阅收入数据的接收方式有以下两种,请任选其一:
可以是以下两类渠道中的任意一种:
- 创建一个主题(topic),让AppsFlyer直接接收Google Play的RTDN通知(详见本步骤说明)
或
- 将AppsFlyer设置为现有PUB/SUB主题的subscriber(跳过本步骤直接进入下一步)。
请按以下方式创建一个主题(topic),让AppsFlyer直接接收RTND通知:
- 从AppsFlyer后台的侧边栏中选择配置 > 收入设置 > 购买和订阅,然后选择“允许AppsFlyer topic直接从Google接收RTDN消息”。
- 将AppsFlyer topic复制到剪贴板。
- 进入Google Play Console > All apps,选择相关应用,打开面板。
- 进入Monetization setup,在Google Play Billing部分中,将此步骤的第2小步中复制AppsFlyer topic地址的粘贴到Topic name字段中。
- 在Notification content部分选择Subscriptions, voided purchases, and all one-time products(订阅、作废的购买交易以及所有一次性付费产品)。
- 点击Save Changes,保存更改。
【或者】1.6:将Google Play的通知转发给AppsFlyer
如果您已经具备从Google Play获取通知的现行主题(topic),可以使用这种方式来接收IAP和订阅通知。 使用该方法时,请将AppsFlyer设置为现有PUB/SUB topic的subscriber,而不是创建新的topic(见1.5)。
请按以下方式将AppsFlyer设置为现有PUB/SUB topic的subscriber:
- 从AppsFlyer后台的侧边栏中选择配置 > 收入设置 > 购买和订阅 ,然后选择将您的RTDN topic消息转发到AppsFlyer。
- 将端点URL复制到剪贴板。
- 进入Google Cloud Platform,在相关项目下搜索Pub/Sub。
- 进入Pub/Sub的Topics部分,确认您有一个专用于订阅的pub/sub topic。
- 进入Subscriptions部分,点击Create subscription。
- 输入Subscription ID。
- 从下拉列表中选择相关订阅的pub/sub主题。
- 在Delivery type(发送方式)部分中,选择Push(推送)。
- 输入您在本节第2步中记录的端点URL。
- 在Expiry period(期限)部分,选择Never expire(永不过期)。
- 点击Save保存。
- 进入Subscriptions部分,将Topic name(主题名称)复制到剪贴板。
- 从Google Play Console进入Monetization setup,在Google Play Billing部分中,将此步骤的第2小步中复制AppsFlyer topic地址的粘贴到Topic name字段中。
- 在Notification content部分选择Subscriptions, voided purchases, and all one-time products(订阅、作废的购买交易以及所有一次性付费产品)。
- 点击Save保存。
1.7 配置自动服务
第2步:设置iOS App Store的通知
温馨提示以下信息 :
- 由于IAP和订阅收入的对接设置同时涉及到App Store Connect 和AppsFlyer两个平台中的相关操作,因此在设置期间请不要关闭App Store Connect和AppsFlyer的页面。
- AppsFlyer后台的设置需要有管理员权限才能操作。
请按以下方式配置IAP和订阅收入:
-
进入App Store Connect并选择您的相关应用。在App Information部分中,向下滚动到App-Specific Shared Secret,然后点击Manage,获取App Store Connect的共享密钥(shared secret key)。将该密钥复制到剪贴板。
-
从AppsFlyer后台的侧边栏中选择配置 > 收入设置 > 购买和订阅。
界面会打开收入设置页。
- 输入您的App Store Connect共享密钥(shared secret key)。
-
配置通知端点。Apple仅可向一个端点发送服务器通知,可以是AppsFlyer的端点(推荐方式)或您自己的端点(如果使用此方式,需要再将通知转发到AppsFlyer)。下文分别解释了这两种方案的配置。
-
【推荐方式】直接向AppsFlyer发送通知:
- 在AppsFlyer的收入配置中,复制AppsFlyer服务器通知端点,将其输入您的App Store Connect配置。
-
进入App Store Connect的App Information部分(同第1步),向下滚动到App Store Server Notifications,然后将AppsFlyer端点地址粘贴到Production Server URL以及Sandbox Server URL字段中。
-
选择Notifications Version下的Version 2 Notifications。
- 点击Save保存。
- 如果您想要接收通知复件,请在AppsFlyer后台(同第2步)输入您的通知转发端点,然后点击保存。
-
【可选】选择将服务器通知发送到您自有的端点并将其转发到AppsFlyer。
-
进入App Store Connect的App Information部分(同第1步),向下滚动到App Store Server Notifications,然后将您自有端点的地址粘贴到Production Server URL以及Sandbox Server URL字段中。
-
选择Notifications Version下的Version 2 Notifications。
- 点击Save保存。
- 配置通知发送请求,从您后台向AppsFlyer通知端点的URL发送Apple服务器通知。请注意:这些请求必须与您从App Store接收到的通知完全一致。详见Apple的格式要求。
-
进入App Store Connect的App Information部分(同第1步),向下滚动到App Store Server Notifications,然后将您自有端点的地址粘贴到Production Server URL以及Sandbox Server URL字段中。
-
【推荐方式】直接向AppsFlyer发送通知:
- 在AppsFlyer的IAP和订阅收入配置页面中,打开以下任一或全部开关:
-
【可选】勾选允许AppsFlyer对已上报的交易去重。
避免重复记录同一个交易。 - 【可选】勾选允许AppsFlyer针对退款事件自动上报负向收入。该选项用于确保AppsFlyer记录退款、取消订单等事件。
-
【可选】勾选对家庭共享型购买产生的收入进行去重。
避免对家庭共享型购买重复记录同一笔收入。在家庭共享型购买事件中,除付款人之外的其他成员所产生的收入事件带有参数purchase_ownership_type=FAMILY_SHARED,且收入值为零。
第3步:接入Purchase SDK connector
接入Purchase SDK Connector后,您的应用就可以记录应用内购买和自动续订事件。该connector分为安卓和iOS版本。接入完成后,请登入AppsFlyer面板,从左侧菜单栏中选择配置 > 收入设置 > 购买和订阅,并选择您需要记录的事件(可以选择记录其中一种或同时记录两种事件)。
请按以下方式接入该SDK connector:
- 让您的安卓开发人员在相关应用中接入适用于安卓平台的AppsFlyer Purchase SDK connector。
- 让您的 iOS开发人员在相关应用中接入适用于iOS平台的AppsFlyer Purchase SDK connector。
请注意:
- 如果您的应用以Unity框架为基础,请参考适用于Unity的connector接入说明。
- 如果您的应用以Flutter框架为基础,请参考适用于Flutter的connector接入说明。
第4步:接入True Revenue tax API
您可以使用True Revenue tax API为AppsFlyer的应用内购买和订阅收入解决方案添加一层业务逻辑。对于AppsFlyer接收到的每一笔交易信息,该API都会实时自动计算净收入值,并将这些数据纳入报告中。ROI360对于其衡量范围内的所有交易都会按默认税率上报税费数据。您可以使用这个税费专用的API更改税率配置。
如需进一步了解True Revenue tax API,请参考这部分说明。
如需使用该tax API修改税费配置,请按以下方式操作:
-
请向您的开发人员提供以下信息:
- API V2 token,作为授权密钥(authorization key)。
-
相关参数和参数值,其中包含需要计算的税费信息,详见下表。
- 让您的开发人员按照tax API说明,创建税率计算规则。请注意:使用该API时,可以在Post请求体中传递JSON文件。请参考此处的JSON文件示例,其中包含所有适用的国家/地区及其默认税率。开发人员可以在示例文件的基础上进行修改,或直接按原样在API中使用该文件。
可在该API中使用的参数和参数值
参数 | 是否必须配置 | 说明 | 参数值(供开发者记录) |
---|---|---|---|
tax_name | 是 |
|
|
tax_rate | 是 |
|
|
tax_exclusive | 否 |
|
|
country | 否 |
|
|
subdivision | 否 |
|
|
postal_code | 否 |
|
|
deduction_order | 否 |
|
第5步:测试IAP和订阅收入对接
建议在沙盒环境中验证IAP和订阅收入对接,确保SDK connector已正确接入到相关应用中,且服务器通知的配置正确无误,AppsFlyer可正常收到通知。
在测试之前,请先确保您的开发人员在SDK connector中配置了沙盒环境(将Sandbox
设置为true
)。这样,ROI360就能针对测试场景,仅创建收入值为0的沙盒应用内事件,而不影响生产环境中的数据(production data)。
沙盒环境的注意事项
在沙盒环境中:
- 只有初次购买行为才会触发SDK connector生成事件,用于AppsFlyer侧的数据记录。IAP事件的名称为af_purchase_sandbox_sdk,订阅事件的名称af_ars_sandbox_sdk。
-
所有其他购买事件都会被忽略,也就是说SDK connector不会为其它购买行为生成事件,因此AppsFlyer也不会记录到其它购买事件。
- SDK connector必须先记录到初始交易,然后AppsFlyer才会处理传入的服务器通知。这种情况下,SDK connector会生成一个名为af_purchase_sandbox_s2s的IAP事件,以及一个名为af_ars_sandbox_s2s的订阅事件。
- 如果SDK connector未事先记录到初始交易,则不会生成任何事件,也不会请求服务器通知。
-
对于iOS应用,请确保App Store connect中“App Store Server Notifications”(应用商店服务器通知)部分下的Sandbox Server URL(沙盒服务器地址)配置为AppsFlyer端点。
- 对于iOS应用,如果af_purchase_sandbox_sdk事件中包含带有收入值的af_sandbox_revenue参数,表示该事件在生产环境中会是一个常规的af_purchase事件。如果没有收入值,则该事件在生产环境中会是一个af_purchase_free事件。
- 对于安卓应用,由已获许可的测试人员(Licensed Tester)开展的测试总是会触发沙盒事件,无论SDK中是否配置了沙盒环境。
IAP和订阅收入对接的测试方式
如需测试IAP和订阅收入对接,请按以下方式操作:
- 请让您的开发人员按照安卓、 iOS和Unity的专用说明在SDK connector中配置沙盒环境。
- 完成一次购买,用作测试。由已获许可的测试人员(Licensed Tester)在Google Play中完成的交易以及通过TestFlight在iOS中完成的交易也同样适用。
请注意:对于任何一个订阅产品,每个测试设备仅可完成一次测试。也就是说,如果您在同一个设备上针对同一个订阅产品完成了多次测试性购买,SDK connector不会记录这些事件。 -
检查AppsFlyer的活跃数据面板中是否呈现了该事件。 IAP事件的名称为af_purchase_sandbox_sdk,订阅事件的名称为af_ars_sandbox_sdk。这些事件具有如下特征:
- 收入值为0(避免AppsFlyer的实际报告数据受到扭曲)。
- 带有af_sandbox_revenue参数,其参数值为所购产品的实际收入值,以便您确认上报的收入准确无误。
- 如果您测试的是一款订阅产品,需要稍等片刻,确保AppsFlyer已接收到服务器通知。一般情况下,AppsFlyer会在初始购买完成后的几分钟内收到通知。
-
检查AppsFlyer的活跃数据面板中是否呈现了该事件。对于自动续订的订阅类购买事件,面板显示的名称为 af_ars_sandbox_s2s。该事件具有以下特征:
- 收入值为0(避免AppsFlyer的实际报告数据受到扭曲)。
- 带有af_sandbox_revenue参数,其参数值为所购产品的实际收入值,以便您确认上报的收入准确无误。
其他参考信息
与IAP相关的事件和参数
以下几个小节分别说明了AppsFlyer所衡量的各个IAP相关事件及其参数。如需了解这些参数的含义,请参考事件参数详解部分。
SDK connector生成的所有事件:
- 都被视为S2S事件。
- 会呈现在原始数据报告中(记录为自然或非自然应用内事件)。
- 可以通过回传发送给合作渠道。
- 可以在SKAN转化值操作台中使用。
请注意:一个应用内事件中可能会有部分参数得不到填充,具体取决于用户设备的操作平台。
购买(af_purchase)
说明
用户完成购买时记录该事件。
参数
- app_id
- customer_user_id
- af_currency
- af_original_transaction_id
- af_order_id
- af_purchase_token
- af_transaction_id
- af_product_id
- android_id
- idfa
- ip
- appsflyer_id
- af_purchase_date_ms
- af_store
- af_environment
- af_revenue
- af_net_revenue
- af_net_revenue_tax_name
- af_net_revenue_tax_rate
- af_net_revenue_tax_exclusive
- af_net_revenue_country
- af_net_revenue_subdivision
- af_net_revenue_postal_code
- af_net_revenue_factors
免费购买 (af_purchase_free)
说明
用户完成不带收入金额的购买时记录此事件。此时,所有收入参数的值都是0。
参数
- app_id
- customer_user_id
- af_currency
- af_original_transaction_id
- af_order_id
- af_purchase_token
- af_transaction_id
- af_product_id
- android_id
- idfa
- ip
- appsflyer_id
- af_purchase_date_ms
- af_store
- af_environment
- af_revenue
- af_net_revenue
- af_net_revenue_tax_name
- af_net_revenue_tax_rate
- af_net_revenue_tax_exclusive
- af_net_revenue_country
- af_net_revenue_subdivision
- af_net_revenue_postal_code
- af_net_revenue_factors
已取消的购买(af_purchase_canceled)
说明
用户取消购买时记录该事件。
参数
- app_id
- customer_user_id
- af_currency
- af_original_transaction_id
- af_order_id
- af_purchase_token
- af_transaction_id
- af_product_id
- android_id
- idfa
- ip
- appsflyer_id
- af_purchase_date_ms
- af_store
- af_environment
尚未完成的购买(af_purchase_pending)
说明
用户下单但未完成付款时记录该事件。
参数
- app_id
- customer_user_id
- af_currency
- af_original_transaction_id
- af_order_id
- af_purchase_token
- af_transaction_id
- af_product_id
- android_id
- idfa
- ip
- appsflyer_id
- af_purchase_date_ms
- af_store
- af_environment
退款(af_purchase_refund)
说明
购买交易退款时记录该事件。
参数
- app_id
- customer_user_id
- af_currency
- af_original_transaction_id
- af_order_id
- af_purchase_token
- af_transaction_id
- af_product_id
- android_id
- idfa
- ip
- appsflyer_id
- af_purchase_date_ms
- af_store
- af_environment
- af_discount_type
- event_revenue_usd
- event_revenue(收入超过零时事件中会带有该参数)
- store_commission
- af_revenue
- af_net_revenue
- af_net_revenue_factors
- af_net_revenue_tax_name
- af_net_revenue_tax_rate
- af_net_revenue_tax_exclusive
- af_net_revenue_country
- af_net_revenue_subdivision
- af_net_revenue_postal_code
用于测试的购买(af_purchase_sandbox_sdk)
说明
在沙盒环境中测试SDK记录的购买时记录该事件。
参数
- app_id
- customer_user_id
- af_currency
- af_original_transaction_id
- af_order_id
- Af_purchase_token
- af_transaction_id
- af_purchase_state
- af_product_id
- android_id
- idfa
- ip
- appsflyer_id
- af_net
- af_sandbox_revenue
用于测试的购买(af_purchase_sandbox_s2s)
说明
在沙盒环境中测试S2S上报的购买时记录该事件。
参数
- app_id
- customer_user_id
- af_currency
- af_original_transaction_id
- af_order_id
- af_purchase_token
- af_transaction_id
- af_purchase_state
- af_product_id
- android_id
- idfa
- ip
- appsflyer_id
- af_net
- af_sandbox_revenue
与订阅相关的事件和参数
以下几个小节分别说明了AppsFlyer所衡量的各个订阅相关事件及其参数。如需了解这些参数的含义,请参考事件参数详解部分。
SDK connector生成的所有事件:
- 都被视为S2S事件。
- 会呈现在原始数据报告中(记录为自然或非自然应用内事件)。
- 可以通过回传发送给合作渠道。
- 可以在SKAN转化值操作台中使用。
请注意:一个应用内事件中可能会有部分参数得不到填充,具体取决于用户设备的操作平台。
开始试用(af_ars_trial_started)
说明
订阅用户的试用期开始时记录该事件。
参数
- app_id
- customer_user_id
- af_currency
- af_expires_date_ms
- Af_subscription_ownership_type
- af_original_transaction_id
- af_order_id
- Af_purchase_token
- af_transaction_id
- af_product_id
- android_id
- idfa
- ip
- appsflyer_id
- af_purchase_date_ms
- af_store
- af_environment
- af_period_type
取消试用(af_ars_trial_canceled)
说明
订阅用户在试用期内取消自动续订时记录该事件。如果用户后续未在试用期内恢复自动续订,还会记录用户流失事件。
参数
- app_id
- customer_user_id
- af_currency
- af_expires_date_ms
- Af_subscription_ownership_type
- af_original_transaction_id
- af_order_id
- Af_purchase_token
- af_transaction_id
- af_product_id
- android_id
- idfa
- ip
- appsflyer_id
- af_purchase_date_ms
- af_store
- af_environment
- af_period_type
试用后流失 (af_ars_trial_churned)
说明
订阅用户在试用期结束后流失时记录该事件。用户的试用期结束,且该用户取消了自动续订时,即视为发生了试用后流失事件。这类事件之前可能发生了与续订有关的计费或技术问题,进而导致用户流失。
参数
- app_id
- customer_user_id
- af_currency
- af_expires_date_ms
- Af_subscription_ownership_type
- af_original_transaction_id
- af_order_id
- Af_purchase_token
- af_transaction_id
- af_product_id
- android_id
- idfa
- ip
- appsflyer_id
- af_purchase_date_ms
- af_store
- af_environment
- af_period_type
- af_reason
试用后转化(af_ars_trial_converted)
说明
用户完成试用后全价续订时记录该事件。
参数
- app_id
- customer_user_id
- af_currency
- af_expires_date_ms
- Af_subscription_ownership_type
- af_original_transaction_id
- af_order_id
- af_purchase_token
- af_transaction_id
- af_product_id
- android_id
- idfa
- ip
- appsflyer_id
- af_purchase_date_ms
- af_store
- af_environment
- af_period_type
- af_discount_id
- af_discount_type
- event_revenue_usd
- store_commission
- af_revenue(仅在收入超过零时,事件中才会带有该参数)
- af_net_revenue
- af_net_revenue_factors
- af_net_revenue_tax_name
- af_net_revenue_tax_rate
- af_net_revenue_tax_exclusive
- af_net_revenue_country
- af_net_revenue_subdivision
- af_net_revenue_postal_code
套餐生效(af_ars_subscription_started)
说明
用户以折扣价或全价订阅的套餐生效时记录该事件。
请注意:
- 新增的套餐订阅事件只能通过SDK connector记录。
- 对于iOS应用,如果某个订阅用户重复订阅现有套餐,SDK connector会向相关应用上报一个收据验证成功事件,但不会在AppsFlyer中记录新增交易。
参数
- app_id
- customer_user_id
- af_currency
- af_expires_date_ms
- af_subscription_ownership_type
- af_original_transaction_id
- af_order_id
- af_purchase_token
- af_transaction_id
- af_product_id
- android_id
- idfa
- ip
- appsflyer_id
- af_purchase_date_ms
- af_store
- af_environment
- af_period_type
- af_discount_id
- af_discount_type
- event_revenue_usd
- event_revenue(收入超过零时事件中会带有该参数)
- store_commission
- af_revenue
- af_net_revenue
- af_net_revenue_factors
- af_net_revenue_tax_name
- af_net_revenue_tax_rate
- af_net_revenue_tax_exclusive
- af_net_revenue_country
- af_net_revenue_subdivision
- af_net_revenue_postal_code
订阅已取消(af_ars_subscription_canceled)
说明
用户在计费周期内取消自动续订时记录该事件。如果用户后续未在同一个计费周期内恢复自动续订,还会记录用户流失事件。
参数
- app_id
- customer_user_id
- af_currency
- af_expires_date_ms
- af_subscription_ownership_type
- af_original_transaction_id
- af_order_id
- af_purchase_token
- af_transaction_id
- af_product_id
- android_id
- idfa
- ip
- appsflyer_id
- af_purchase_date_ms
- af_store
- af_environment
- af_period_type
订阅已暂停(af_ars_subscription_paused)- 仅限适用于安卓应用
说明
用户暂停已生效的套餐时记录该事件。
参数
- app_id
- customer_user_id
- af_currency
- af_expires_date_ms
- af_subscription_ownership_type
- af_original_transaction_id
- af_order_id
- af_purchase_token
- af_product_id
- android_id
- idfa
- ip
- appsflyer_id
- af_purchase_date_ms
- af_store
- af_environment
- af_period_type
订阅已恢复(af_ars_subscription_resumed)
说明
用户流失或套餐发生退款后,以全价订阅套餐重新生效时记录该事件。
参数
- app_id
- customer_user_id
- af_currency
- af_expires_date_ms
- af_subscription_ownership_type
- af_original_transaction_id
- af_order_id
- af_purchase_token
- af_transaction_id
- af_product_id
- android_id
- idfa
- ip
- appsflyer_id
- af_purchase_date_ms
- af_store
- af_environment
- af_period_type
- af_discount_id
- af_discount_type
- af_reason
- event_revenue(事件收入超过零值时,相关事件中会带有该参数)
- store_commission
- af_revenue
- af_net_revenue
- af_net_revenue_factors
订阅用户流失(af_ars_subscription_churned)
说明
订阅用户流失时记录该事件。一般情况下,当用户的计费周期结束,或用户取消自动续订时,说明该订阅用户发生了流失。这类事件之前可能发生了与续订有关的计费或技术问题,进而导致用户流失。
参数
- app_id
- customer_user_id
- af_currency
- af_expires_date_ms
- Af_subscription_ownership_type
- af_original_transaction_id
- af_order_id
- Af_purchase_token
- af_transaction_id
- af_product_id
- android_id
- idfa
- ip
- appsflyer_id
- af_purchase_date_ms
- af_store
- af_environment
- af_period_type
- af_reason
订阅已退款(af_ars_subscription_refunded)
说明
向订阅用户退款发出时记录该事件。
请注意:
- 该事件通常带有负值。如果AppsFlyer无法识别出发生退款的交易,或服务器通知中未包含退款详情,则相关退款事件不会显示事件值。
参数
- app_id
- customer_user_id
- af_reason
- af_subscription_ownership_type
- af_discount_id
- af_discount_type
- af_original_transaction_id
- af_order_id
- af_purchase_token
- af_refunded_transaction_ids
- event_revenue_usd
- event_revenue(收入超过零时事件中会带有该参数)
- af_product_id
- android_id
- idfa
- ip
- appsflyer_id
- af_store
- af_environment
- af_period_type
- store_commission
- af_revenue
- af_net_revenue
- af_net_revenue_factors
- af_net_revenue_tax_name
- af_net_revenue_tax_rate
- af_net_revenue_tax_exclusive
- af_net_revenue_country
- af_net_revenue_subdivision
- af_net_revenue_postal_code
订阅计费宽限期(af_ars_subscription_billing_grace)
说明
若出现支付问题导致续订失败,相关订阅用户进入计费宽限期时记录该事件。
参数
- app_id
- customer_user_id
- af_currency
- af_expires_date_ms
- Af_subscription_ownership_type
- af_original_transaction_id
- af_order_id
- Af_purchase_token
- af_transaction_id
- af_product_id
- android_id
- idfa
- ip
- appsflyer_id
- af_purchase_date_ms
- af_store
- af_environment
- af_period_type
订阅已更新(af_ars_subscription_renewed)
说明
订阅自动续费时记录该事件。
参数
- app_id
- customer_user_id
- af_currency
- af_expires_date_ms
- af_subscription_ownership_type
- af_original_transaction_id
- af_order_id
- af_purchase_token
- af_transaction_id
- af_product_id
- android_id
- idfa
- ip
- appsflyer_id
- af_purchase_date_ms
- af_store
- af_environment
- af_period_type
- af_discount_id
- af_discount_type
- event_revenue_usd
- event_revenue(收入超过零时事件中会带有该参数)
- store_commission
- af_revenue
- af_net_revenue
- af_net_revenue_factors
订阅已变更(af_ars_subscription_xgraded)
说明
用户订阅的产品发生升级、降级或变更时记录该事件。
参数
- app_id
- customer_user_id
- af_currency
- af_expires_date_ms
- af_subscription_ownership_type
- af_original_transaction_id
- af_order_id
- af_purchase_token
- af_transaction_id
- af_product_id
- android_id
- idfa
- ip
- appsflyer_id
- af_purchase_date_ms
- af_store
- af_environment
- af_period_type
- af_discount_id
- af_discount_type
- event_revenue_usd
- event_revenue(收入超过零时事件中会带有该参数)
- store_commission
- af_revenue
- af_net_revenue
- af_net_revenue_factors
现有订阅用户(af_ars_existing_subscriber)
说明
SDK connector针对处于计费周期内的订阅用户收到通知,但尚未收到后续通知要将此用户转移至生命周期的其它阶段时,即会生成该事件。该事件通常会在ROI360方案的启用期间以及SDK connector的采纳期间生成。
参数
- app_id
- customer_user_id
- country
- af_currency
- af_expires_date_ms
- af_subscription_ownership_type
- af_original_transaction_id
- af_order_id
- af_purchase_token
- af_transaction_id
- af_product_id
- android_id
- idfa
- ip
- appsflyer_id
- af_purchase_date_ms
- af_store
- af_environment
- af_period_type
- af_cuids
- af_validated
用于测试的购买 (af_ars_sandbox_sdk)
说明
在沙盒环境中测试SDK记录的购买时记录该事件。
参数
- app_id
- customer_user_id
- country
- af_currency
- af_expires_date_ms
- af_subscription_ownership_type
- af_discount_id
- af_discount_type
- af_original_transaction_id
- af_order_id
- af_purchase_token
- af_transaction_id
- af_product_id
- android_id
- idfa
- ip
- appsflyer_id
- af_purchase_date_ms
- af_store
- af_environment
- af_period_type
- af_cuids
- af_validated
- af_net
- af_sandbox_revenue
用于测试的购买 (af_ars_sandbox_s2s)
说明
在沙盒环境中测试S2S上报的购买时记录该事件。
参数
- app_id
- customer_user_id
- country
- af_currency
- af_expires_date_ms
- af_subscription_ownership_type
- af_discount_id
- af_discount_type
- af_original_transaction_id
- af_order_id
- af_purchase_token
- af_transaction_id
- af_product_id
- android_id
- idfa
- ip
- appsflyer_id
- af_purchase_date_ms
- af_store
- af_environment
- af_period_type
- af_cuids
- af_validated
- af_net
- af_sandbox_revenue
参数详解
在原始数据中,IAP和订阅事件的参数会单独成列显示,或以事件值的形式呈现。
单独成列的参数如下:
- app_id
- customer_user_id
- country_code
- af_currency
- event_revenue_usd
- af_revenue
- android_id
- ip
- idfa
- appsflyer_id
如需进一步了解这些参数的详细信息,请参考原始数据字段释义文档。
下表列出了ARS(自动续订)和VIAP(经验证的应用内购买)事件中可用的原始数据参数。
参数 | 说明 | 产品 |
---|---|---|
af_cancelation_date_ms | 取消日期 | IAP |
af_reason |
|
|
af_expires_date_ms | 当前订阅周期的截止日期。 | 订阅 |
af_subscription_ownership_type | 若字段值为FAMILY_SHARED,表示该用户通过家人共享套餐获取访问权限。 若字段值为PURCHASED,表示付费用户完成了一次购买。 | 订阅 |
af_discount_id | 在首次购买过程中呈现给用户的优惠ID。只有在使用优惠码时才会填充该ID。 |
|
af_discount_type | 用户领取的优惠类型。可能出现的值为:
|
订阅 |
af_original_transaction_id |
|
|
af_order_id |
|
|
af_purchase_token |
|
|
af_transaction_id |
|
|
af_purchase_state | 可能出现的值为:
|
IAP |
af_original_transaction_id |
|
|
af_refunded_transaction_ids |
|
|
af_product_id | 相关订阅产品的ID |
|
af_purchase_date_ms | 报告中与产品ID应用内事件相关联的购买日期。 |
|
af_store | 指用户购买订阅产品时使用的应用商店 |
|
af_environment | 数据接收环境,可能出现的值为production(生产环境)和sandbox(沙盒环境)两种。 |
|
af_period_type |
|
订阅 |
store_commission |
|
|
af_net_revenue | 根据所有相关因素计算得出的净收入。详情请见af_net_revenue_factors说明。 |
|
af_net_revenue_factors |
|
|
af_net_revenue_tax_name |
|
|
af_net_revenue_tax_rate |
|
|
af_net_revenue_tax_exclusive |
|
|
af_net_revenue_country |
|
|
af_net_revenue_subdivision |
|
|
af_net_revenue_postal_code |
|
|
af_cuids |
|
订阅 |
真实收入(True Revenue)
您可以使用True Revenue tax API为AppsFlyer的应用内购买和订阅收入解决方案添加一层业务逻辑。对于AppsFlyer接收到的每一笔交易信息,该功能都会实时自动计算净收入值,并将这些数据纳入报告中。True Revenue基于以下因素根据总收入计算净收入:
-
商店抽成:
- AppsFlyer会自动计算和上报该信息,您无需完成任何操作。
- 购买交易的商店抽成比例为30%。
- 订阅交易的商店抽成比例根据订阅用户的生命周期,分用户自动计算,(App Store:初始抽成30%,一年后降至15%;Play Store:抽成15%)。
- 原始数据报告中会呈现相关的净收入参数。
-
税费:
- ROI360对于其衡量范围内的所有交易都会按默认税率上报税费数据。
- 该因素适用于标价中含税的国家。以英国为例,如果应用商店向终端用户收取10英镑,则计算净收入时会自动扣除20%的税,显示为8英镑(£8)。对于美国等标价中不含税国家,收入和净收入参数默认不包含税费的计算。
- 您可以使用这个税费专用的tax API更改税率配置。请参考此处的JSON文件示例,其中包含所有适用的国家/地区及其默认税率。开发人员可以在示例文件的基础上进行修改,或直接按原样在API中使用该文件。
下表列出了包含净收入数据的参数,便于您在报告中查看真实收入。详情请见参数详解部分。
参数 | 净收入因素 |
---|---|
store_commission | 商店抽成 |
af_net_revenue_tax_name | 税费 |
af_net_revenue_tax_rate | 税费 |
af_net_revenue_tax_exclusive | 税费 |
af_net_revenue_postal_code | 税费 |
af_net_revenue_country | 税费 |
af_net_revenue_subdivision | 税费 |
af_net_revenue |
|
af_net_revenue_factors |
|
特点与局限性
维度 | 产品 | 说明 |
---|---|---|
记录激活并进行匿名化处理 |
|
不支持 |
新增订阅 | 订阅收入 | 仅通过AppsFlyer Purchase SDK记录 |
价格变动 | 订阅收入 | 对于订阅收入,如果AppsFlyer没有接收到带有新价格的SDK通知,则会持续上报之前的价格,将其记录为收入。AppsFlyer接收到Purchase SDK发出的新价格后,即会记录新价格。 |
总收入 |
|
支持 |
净收入 |
|
仅在原始数据中呈现该信息 |
税费 | 订阅收入 | 支持 |
净收入商店抽成 |
|
|
退款 | IAP | 上报窗口期为初始购买发生后的180天内。 |
数据去重 |
|
事件发生日期后180天内上报的交易可进行去重。 |
SDK严格模式 |
|
对于以下版本的SDK connector,AppsFlyer在SDK严格模式下仍支持ROI360订阅和IAP解决方案:
|
货币 |
|
收入数据以实际货币(通过event_revenue参数)和美元(通过event_revenue_usd参数)为单位上报。 |
数据时效性 |
|
|