跳转到正文

iOS Attribution

GitHub

Apple 没有提供类似于 Google Play Install Referrer 的通用 App Store 安装来源。在 iOS 上,此插件使用 Apple AdServices 归因。

默认情况下, getReferrer() 返回一个 AdServices 归因 token,你可以将其发送到你的后端或移动测量合作伙伴 (MMP)。

const result = await InstallReferrer.getReferrer();
console.log(result.attributionToken);

该插件还可以通过原生 code 将 token 发送到 Apple 的 AdServices 端点。

const result = await InstallReferrer.getReferrer({
fetchAppleAttribution: true,
});
console.log(result.appleAttribution);

当 App 本身应接收 Apple 的归因 payload 时,使用此模式。保持 fetchAppleAttribution false(当您的后端或归因服务商需要交换 token 时)。

字段描述
platform始终 ios.
attributionTokenApple AdServices 归因 token。
appleAttribution可选的 Apple 归因 payload,当条件 fetchAppleAttribution 为 true 时。
  • Apple AdServices 归因 Token 在 iOS 14.3 及更高版本中可用。
  • 归因负载仅涵盖 Apple Search Ads 归因,不包括任意 App Store 来源 URL。
  • 仅请求 AdServices 归因 Token 时,无需显示 App Tracking Transparency 弹窗。

如果你正在使用 iOS Attribution 要规划原生插件工作,请将其与 使用 @capgo/capacitor-install-referrer 以使用 @capgo/capacitor-install-referrer 中的原生能力, Capgo 插件目录 查看 Capgo 插件目录中的产品工作流, Capgo 提供的 Capacitor 插件 查看由 Capgo 提供的 Capacitor 插件中的实现细节, 添加或更新插件 关于“添加或更新插件”中的实现细节,以及 Ionic Enterprise 插件替代方案 关于“Ionic Enterprise 插件替代方案”中的产品工作流。