AppsFlyer
AppsFlyer 是一个领先的移动归因与营销分析平台,作为第三方服务,它能够收集并整理来自各营销活动的数据,帮助企业在一处统一查看各活动的投放效果。 Adapty 提供了一套完整的数据,让您可以在一个地方追踪来自各应用商店的订阅事件。借助 Adapty,您可以轻松了解订阅用户的行为规律和偏好,并据此与他们进行精准有效的沟通。因此,本集成可帮助您在 AppsFlyer 中追踪订阅事件,精确分析各推广活动带来的收益。
Adapty 与 AppsFlyer 的集成主要通过两种方式运作。
- 从 AppsFlyer 接收归因数据 在完成应用代码中将 AppsFlyer 归因数据发送至 Adapty 的配置后,Adapty 将开始接收来自 AppsFlyer 的归因数据。你可以在用户的用户画像页面轻松访问和查看这些数据。
- 将订阅事件发送至 AppsFlyer Adapty 可以将集成中配置的所有订阅事件发送至 AppsFlyer,让你能够在 AppsFlyer 看板中追踪这些事件。此集成有助于评估广告活动的效果。
配置设置
将 Adapty 与 AppsFlyer 连接
按以下步骤设置与 AppsFlyer 的集成:
-
在 Adapty 看板中打开 Integrations -> AppsFlyer。
-
打开开关以启用集成。
-
下一步是填写凭据。 对于 iOS,请在 App Store Connect 中找到 Apple ID(具体操作:在 App Store Connect 中打开您的应用页面,进入 General 部分的 App Information 页面,在屏幕左下角即可找到 Apple ID)。
3.2. 将复制的 Apple ID 粘贴到 Adapty 看板的 iOS App ID 字段中。
如果你使用的是 AppsFlyer API 2,需要切换到 API 3,因为 AppsFlyer 即将弃用旧版本。请在 AppsFlyer S2S API 列表中选择 API 3。
- 无论是 iOS 还是 Android,请打开 AppsFlyer 网站 并登录。
- 点击看板右上角的 Your account name -> Security Center。
- 在 Manage your account security 窗口中,点击 Manage your AppsFlyer API and S2S tokens 按钮。
- 如果您已有 S2S 令牌,请直接跳到第 12 步。如果没有,请点击 New token 按钮。
-
在 New token 窗口中,输入令牌名称。该名称仅供您自己参考。
-
在 Choose type 列表中选择 S2S。
-
点击 Create new token 按钮保存新令牌。
-
在 Tokens 窗口中,复制 S2S 令牌。
-
在 Adapty 看板中,将复制的 S2S 密钥粘贴到 Dev key for iOS 和 Dev key for Android 字段中。
-
点击 Save 按钮保存更改。
AppsFlyer 的服务器对服务器集成没有沙盒模式。因此,你需要在 AppsFlyer 中为沙盒开发密钥创建一个独立的应用/账户。如果你希望将沙盒事件发送到同一个应用,直接使用与生产环境相同的密钥即可。 :::
Adapty 默认会将部分事件映射到 AppsFlyer 的标准事件。通过这样的配置,AppsFlyer 可以无需额外设置,直接将事件转发到你使用的各个广告网络。 另外需要注意的是,AppsFlyer 不支持超过 26 小时的历史事件。因此,如果某个事件的发生时间超过 26 小时,Adapty 仍会将其发送给 AppsFlyer,但事件的日期和时间将被替换为当前时间戳。
配置事件和标签
在凭证下方,有三组事件可供你从 Adapty 发送到 AppsFlyer。直接开启你需要的事件即可。点击此处查看 Adapty 提供的完整事件列表。
我们建议使用 Adapty 提供的默认事件名称,但您也可以根据需要修改事件名称。
Adapty 将通过服务器对服务器集成向 AppsFlyer 发送订阅事件,让您能够在 AppsFlyer 看板中查看所有订阅事件,并将其与您的获客广告系列关联起来。
将您的应用连接到 AppsFlyer
完成上述步骤后,调用 updateAttribution 方法保存归因数据,并使用 Adapty.setIntegrationIdentifier() 设置集成标识符。
请先初始化 AppsFlyer SDK 并等待其 UID 回调,再在 Adapty 中进行用户识别。否则 appsflyer_id 会落在 Adapty 激活时创建的临时匿名用户画像上,无法始终同步到已识别的用户画像。一旦出现这种情况,AppsFlyer 的收入转发将静默失败。
事件结构
Adapty 通过 POST 请求将所选事件以 JSON 格式发送至 AppsFlyer:
- API v2:
https://api2.appsflyer.com/inappevent/{app_id} - API v3:
https://api3.appsflyer.com/inappevent/{app_id}(推荐)
每个事件的结构如下:
{
"appsflyer_id": "1699887556000-6192770",
"eventName": "subscription_renewed",
"eventTime": "2024-03-01 12:00:00",
"eventValue": "{\"af_content_id\":\"yearly.premium.6999\",\"af_order_id\":\"GPA.3383-4699-1373-07113\",\"store_country\":\"US\",\"profile_country\":\"US\",\"af_content_type\":\"in_app\",\"af_revenue\":\"9.9900\",\"af_currency\":\"USD\",\"af_quantity\":\"1\"}",
"os": "17.0.1",
"bundleIdentifier": "com.example.app",
"customer_user_id": "user_12345",
"eventCurrency": "USD",
"ip": "192.168.100.1",
"advertising_id": "00000000-0000-0000-0000-000000000000",
"idfa": "00000000-0000-0000-0000-000000000000",
"idfv": "00000000-0000-0000-0000-000000000000",
"att": "3"
}
It looks like your message was cut off. Could you please share the MDX documentation you’d like me to translate from English to Simplified Chinese?
| 参数 | 类型 | 描述 |
|---|---|---|
appsflyer_id | String | AppsFlyer ID(通过 SDK 采集)。 |
eventName | String | AppsFlyer 事件名称(由 Adapty 事件映射而来)。 |
eventTime | String | 事件发生的日期和时间(UTC,格式为 YYYY-MM-DD HH:MM:SS)。 |
eventValue | String | 包含事件详情的 JSON 字符串(见下文)。 |
os | String | 操作系统版本。 |
bundleIdentifier | String | 应用的 Bundle ID / 包名。 |
customer_user_id | String | 用户的 Customer User ID。 |
eventCurrency | String | 货币代码(例如 “USD”)。 |
ip | String | 用户的 IP 地址。 |
advertising_id | String | 仅限 Android。Google 广告 ID。 |
idfa | String | 仅限 iOS。广告商标识符(ID for Advertisers)。 |
idfv | String | 仅限 iOS。供应商标识符(ID for Vendors)。 |
att | String | 仅限 iOS。App Tracking Transparency 状态(例如 “3” 表示已授权)。 |
eventValue 参数是一个 JSON 编码的字符串,包含以下字段: | ||
| 参数 | 类型 | 描述 |
| :------------------ | :------- | :---------------------------------------------- |
af_content_id | String | 应用商店中的产品 ID。 |
af_order_id | String | 原始交易 ID。 |
store_country | String | 应用商店用户的国家/地区代码。 |
profile_country | String | 基于用户 IP 的国家/地区代码。 |
af_content_type | String | 若存在收入,始终为 in_app。 |
af_revenue | String | 保留 4 位小数的收入金额。 |
af_currency | String | 货币代码。 |
af_quantity | String | 若存在收入,始终为 1。 |
故障排查
收益数据差异
如果 Adapty 和 AppsFlyer 之间存在收益数据差异,可能是因为并非所有用户都在使用包含 Adapty SDK 的应用版本。为确保数据一致性,您可以强制用户升级到包含 Adapty SDK 的应用版本。
缺少集成数据
如果事件发送失败,通常是由于缺少集成数据。请确认以下几点以解决此问题:
- 您的应用已安装 AppsFlyer SDK。
- 您正在调用
getAppsFlyerUID方法。
认证失败
如果控制台出现 Failed to authenticate 错误,可能是由于 AppsFlyer 版本与凭据版本不匹配导致的。