分析集成
Adapty 将所有订阅事件发送到分析服务,例如 Amplitude、Mixpanel 和 AppMetrica。我们也可以通过 webhook 集成将事件发送到您的服务器。最棒的是,您无需手动发送任何事件,我们会为您完成。只需在 Adapty 看板中配置集成即可。
Adapty 支持与以下第三方分析服务集成:
没有看到您使用的分析服务商?
请告知我们!提交功能请求,我们将考虑添加。
事件属性
Webhook 事件以 JSON 格式发送。所有事件遵循相同的结构,但其字段会根据事件类型、商店以及您的具体配置而有所不同。
| 属性 | 类型 | 描述 |
|---|---|---|
| profile_id | uuid | Adapty 用户 ID。 |
| currency | str | 本地货币(默认为 USD)。 |
| price_usd | float | Apple/Google 抽成前的产品价格。收入。 |
| proceeds_usd | float | Apple/Google 抽成后的产品价格。净收入。 |
| net_revenue_usd | float | 净收入(Apple/Google 抽成及税费后的收入),单位为 USD。可能为空。 |
| price_local | float | Apple/Google 抽成前以本地货币计算的产品价格。收入。 |
| proceeds_local | float | Apple/Google 抽成后以本地货币计算的产品价格。净收入。 |
| transaction_id | str | 交易的唯一标识符,例如购买或续订。 |
| original_transaction_id | str | 原始购买的交易标识符。 |
| purchase_date | ISO 8601 date | 产品购买的日期和时间。 |
| original_purchase_date | ISO 8601 date | 原始购买的日期和时间。 |
| environment | str | 可以是 Sandbox 或 Production。 |
| vendor_product_id | str | Apple App Store、Google Play Store 或 Stripe 中的产品 ID。 |
| base_plan_id | str | Google Play Store 中的基础方案 ID 或 Stripe 中的价格 ID。 |
| event_datetime | ISO 8601 date | 事件的日期和时间。 |
| store | str | 可以是 app_store 或 play_store。 |
| trial_duration | str | 试用期时长(天)。以” days”格式发送,例如”7 days”。 |
| cancellation_reason | str | 用户取消订阅的原因。 可以是 iOS 和 Android voluntarily_cancelled、billing_error、refund iOS price_increase、product_was_not_available、unknown Android new_subscription_replace、cancelled_by_developer |
| subscription_expires_at | ISO 8601 date | 订阅到期日期。通常为将来的日期。 |
| consecutive_payments | int | 用户连续订阅的周期数,不含中断。包含当前周期。 |
| rate_after_first_year | bool | 布尔值,表示该订阅在持续续订一年后是否符合降低佣金率(通常为 15%)的条件。佣金率因计划资格和国家/地区而异。详见商店佣金和税费。 |
| promotional_offer_id | str | 在 Adapty 看板产品部分中指定的促销活动 ID。 |
| store_offer_category | str | 可以是 introductory 或 promotional。 |
| store_offer_discount_type | str | 可以是 free_trial、pay_as_you_go 或 pay_up_front。 |
| paywall_name | str | 交易来源付费墙的名称。 |
| paywall_revision | int | 交易来源付费墙的修订版本。该值设为 1。 |
| developer_id | str | 交易来源版位的开发者(SDK)ID。 |
| ab_test_name | str | 交易来源 A/B 测试的名称。 |
| ab_test_revision | int | 交易来源 A/B 测试的修订版本。该值设为 1。 |
| cohort_name | str | 用户画像所属目标受众的名称。 |
| profile_event_id | uuid | 可用于去重的唯一事件 ID。 |
| store_country | str | 商店发送给我们的国家/地区。 |
| profile_ip_address | str | 用户画像 IP(可以是 IPv4 或 IPv6,优先使用 IPv4)。每次设备 IP 变更时更新。 |
| profile_country | str | 由 Adapty 根据用户画像 IP 确定。 |
| profile_total_revenue_usd | float | 用户画像的总收入,包含退款。 |
| variation_id | uuid | 购买所在付费墙的唯一 ID。 |
| access_level_id | str | 付费访问等级 ID。 |
| is_active | bool | 布尔值,表示用户画像的付费访问等级是否处于活跃状态。 |
| will_renew | bool | 布尔值,表示付费访问等级是否将续订。 |
| is_refund | bool | 布尔值,表示交易是否已退款。 |
| is_lifetime | bool | 布尔值,表示付费访问等级是否为永久授权。 |
| is_in_grace_period | bool | 布尔值,表示用户画像是否处于宽限期。 |
| starts_at | ISO 8601 date | 用户付费访问等级开始的日期和时间。 |
| renewed_at | ISO 8601 date | 付费访问将续订的日期和时间。 |
| expires_at | ISO 8601 date | 付费访问将到期的日期和时间。 |
| activated_at | ISO 8601 date | 付费访问被激活的日期和时间。 |
| billing_issue_detected_at | ISO 8601 date | 检测到账单问题的日期和时间。 |
| profile_has_access_level | Bool | 布尔值,表示用户画像是否拥有活跃的访问等级(仅限 Webhook)。 |
每个事件都具有以下属性:
transaction_id, original_transaction_id, purchase_date, original_purchase_date, environment, vendor_product_id, event_datetime, store。
此外,某些事件还具有额外属性。对于 subscription_refunded 和 non_subscription_purchase_refunded 事件,必须提供 price_usd 和 proceeds_usd 作为额外属性的值。
| 事件名称 | 属性 |
|---|---|
| subscription_initial_purchase | price_usd, proceeds_usd, subscription_expires_at, consecutive_payments, rate_after_first_year, trial_duration |
| subscription_renewed | price_usd, proceeds_usd, subscription_expires_at, consecutive_payments, rate_after_first_year, trial_duration |
| subscription_cancelled | cancellation_reason, trial_duration |
| trial_started | subscription_expires_at, trial_duration |
| trial_converted | price_usd, proceeds_usd, subscription_expires_at, consecutive_payments, rate_after_first_year, trial_duration |
| trial_cancelled | cancellation_reason, trial_duration |
| non_subscription_purchase | price_usd, proceeds_usd |
| billing_issue_detected | subscription_expires_at, trial_duration |
| entered_grace_period | subscription_expires_at, trial_duration |
事件示例
{
"price_usd": 9.99,
"proceeds_usd": 6.99,
"transaction_id": "1000000628581600",
"original_transaction_id": "1000000628581600",
"purchase_date": "2020-02-18T18:40:22.000000+0000",
"original_purchase_date": "2020-02-18T18:40:22.000000+0000",
"environment": "Sandbox",
"vendor_product_id": "premium",
"event_datetime": "2020-02-18T18:40:22.000000+0000",
"store": "app_store"
}
Adapty 将事件发送到您的服务器和第三方分析系统。
profile_ip_address 属性与当前设备 IP 同步。每次 Adapty 服务器从 SDK 接收到信息时,如果 IP 与我们记录的不同,则会更新该 IP。
设置用户画像标识符
- 使用 instructions for setting user attributes in your app iOS、Android、React Native、Flutter 和 Unity 为所选分析工具设置用户画像标识符。
避免重复
请记得关闭从设备和服务器发送订阅事件的功能,以避免重复计数。
为特定用户禁用外部分析
您可能希望停止为特定用户发送分析事件。如果您的应用中提供了退出分析服务的选项,此功能将非常有用。
要为某用户禁用外部分析,请使用 updateProfile() 方法。创建 AdaptyProfileParameters.Builder 对象并为其设置相应的值。
当外部分析被屏蔽后,Adapty 将不会为该特定用户向任何集成发送任何事件。如果您想为应用的所有用户禁用某个集成,只需在 Adapty 看板中将其关闭即可。