关于收集统计数据的通知

您可以通知应用用户将收集统计数据,并在获得同意前将 SDK 初始化为禁用统计数据发送。 此部分介绍如何禁用和启用统计数据收集:

要初始化一个禁用统计发送选项的库,在创建扩展库配置时,将值false传入withStatisticsSending(boolean value)方法。

// Creating an extended library configuration.
AppMetricaConfig config = AppMetricaConfig.newConfigBuilder(API_key)
        // Disabling sending statistics.
        .withStatisticsSending(false)
        .build();
// Initializing the AppMetrica SDK.
AppMetrica.activate(getApplicationContext(), config);

在用户确认发送统计数据后(例如在应用设置中或在首次启动应用时的协议中),您应调用 AppMetrica.setStatisticsSending(Context context, boolean enabled 方法以启用它:

// Checking the status of the boolean variable. It shows the user confirmation.
if (flag) {
    // Enabling sending statistics.
    AppMetrica.setStatisticsSending(getApplicationContext(), true);
}

要初始化一个禁用统计发送选项的库,请为 NO 设置 statisticsSending 属性,该属性属于 YMMYandexMetricaConfiguration 配置。

// Creating an extended library configuration.
YMMYandexMetricaConfiguration *configuration = [[YMMYandexMetricaConfiguration alloc] initWithApiKey:@"API_key"];
// Disabling sending statistics.
configuration.statisticsSending = NO;
// Initializing the AppMetrica SDK.
[YMMYandexMetrica activateWithConfiguration:configuration];

在用户确认发送统计数据后(例如在应用设置中或在首次启动应用时的协议中),您应调用 +setStatisticsSending: 方法来启用它,该方法属于 YMMYandexMetrica 类。

// Checking the status of the boolean variable. It shows the user confirmation.
if (flag) {
    // Enabling sending statistics.
    [YMMYandexMetrica setStatisticsSending:YES];
}

要初始化一个禁用统计发送选项的库,请为 YMMYandexMetricaConfiguration 配置中的 statisticsSending 属性设置值 NO。

// Creating an extended library configuration.
let configuration = YMMYandexMetricaConfiguration.init(apiKey: "API key")
// Disabling sending statistics.
configuration?.statisticsSending = false
// Initializing the AppMetrica SDK.
YMMYandexMetrica.activate(with: configuration!)

在用户确认发送统计数据后(例如在应用设置中或在首次启动应用时的协议中),您应调用 setStatisticsSending(_:) 方法来启用它,该方法属于 YMMYandexMetrica 类。

// Checking the status of the boolean variable. It shows the user confirmation.
if flag {
    // Enabling sending statistics.
    YMMYandexMetrica.setStatisticsSending(true);
}

警告示例

您可以使用任何文本来告知用户统计数据的收集。 例如:

此应用使用了AppMetrica由谷歌有限责任公司(谷歌 LLC,俄罗斯莫斯科列夫·托尔斯泰街 16 号,119021)提供的分析服务(谷歌计量 — 用于应用)(以下称为“谷歌”),基于使用条款。

AppMetrica 分析应用使用数据,包括运行设备、安装来源,计算转换率、收集您的活动统计数据,用于产品分析、广告宣传分析和优化,以及排查故障。 通过这种方式收集的信息无法识别您的身份。

由 AppMetrica 工具收集的关于您使用此应用的去标识化信息将被传输至 Yandex,并存储在位于欧盟和俄罗斯联邦的 Yandex 服务器上。 雅克沙将处理这些信息,以评估您使用应用的情况、为我们编制应用运行报告以及提供其他服务。

另请参见

如果您没有找到所需答案,可以通过反馈表单提交您的问题。 请尽可能详细地描述问题。 如果可能,请附上截图。

联系支持 为文档提出改进建议