分析/统计
如何在 EasyApp 中集成分析/统计服务
在 App Store Connect中可以看到您的 App 的分析数据,包括下载量、用户留存、用户活跃度等。
但是App Store Connect也不是那么完美,它统计的数据不是实时的,也无法统计到用户精细的行为数据。所以我们需要接入一些实时的数据分析服务,搭配 App Store Connect 使用,可以更全面的了解您的 App 的使用情况。
EasyApp 中使用 OpenPanel 作为数据分析服务。
OpenPanel有以下优点
- 完全开源,可以自己部署
- 收费友好
- 集成简单、使用方便
EasyApp 模板默认开启 openpanel,如果您不需要统计服务,可以关闭 openpanel。
打开 EasyAppSwiftUI/Constants/Constants.swift 文件,找到 Constants -> OpenPanel 枚举,配置 isEnabledOpenPanel 为 false。
enum Constants {
// ... other configurations
/// OpenPanel is enabled
static let isEnabledOpenPanel = false
// ... other configurations
}配置 OpenPanel
首先,注册一个 OpenPanel 账号。
然后,点击 Create a Project,创建一个项目
输入项目名称,选择 App,点击 Create project。

紧接着,复制 Client ID 和 Secret。

完成剩余步骤即可。
配置 EasyApp
打开 EasyAppSwiftUI/Constants/Constants.swift 文件,找到 Constants -> OpenPanel 枚举,配置您刚才复制的 clientID 和 secret。
enum Constants {
// ... other configurations
/// OpenPanel client ID
static let clientID = "your client id"
/// OpenPanel secret
static let secret = "your secret"
// ... other configurations
}EasyApp 默认开启了自动事件追踪,如果您对 App 没有特别精细化的事件追踪需求,那么您配置完上诉步骤之后,就可以开始使用 OpenPanel 了。
如果您需要更精细化的事件追踪、用户属性设置等功能,您可以参考 OpenPanel 文档。本篇文章就不在赘述了。
Last updated on