可以通过 Google 设备端转化衡量 (ODM),将投放在 Google iOS 应用上的广告归因于相应的应用安装,从而在提高评估准确性的同时保护用户隐私。这种方法确保您或 Google 无法识别个人用户、设备或相关应用。
要启用 Google 设备端转化衡量,您需要在 Podfile
中将以下依赖项添加到应用的目标中:
# Resolve react_native_pods.rb with node to allow for hoistingrequire Pod::Executable.execute_command('node', ['-p', 'require.resolve( "react-native/scripts/react_native_pods.rb", {paths: [process.argv[1]]}, )', __dir__]).strip
platform :ios, min_ios_version_supportedprepare_react_native_project!
linkage = ENV['USE_FRAMEWORKS']if linkage != nil Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green use_frameworks! :linkage => linkage.to_symend
target 'AdjustExample' do
pod 'Adjust/AdjustGoogleOdm' pod 'GoogleAdsOnDeviceConversion', '2.0.0'
config = use_native_modules!
use_react_native!( :path => config[:reactNativePath], # An absolute path to your application root. :app_path => "#{Pod::Config.instance.installation_root}/.." )
target 'AdjustExampleTests' do inherit! :complete # Pods for testing end
post_install do |installer| react_native_post_install( installer, config[:reactNativePath], :mac_catalyst_enabled => false, # :ccache_enabled => true ) endend
如果使用 Firebase 数据分析 11.14.0 及更新版本 ,则无需手动添加 GoogleAdsOnDeviceConversion
依赖项,因为您的应用会自动纳入相关内容。
记录应用启动时间
使用“设备端转化衡量”进行准确归因时,其中一个最关键的因素是尽可能精确地记录应用启动时间。Adjust SDK 会在初始化过程中自动处理此操作。因此,务必在应用启动序列中尽早调用 initSdk
方法。
如需延迟启动 Adjust SDK,仍强烈建议您及时调用 initSdk
方法,并使用“首次会话延迟”功能来协调 Adjust SDK 的实际启动与应用的逻辑。