可以通过 Google 设备端转化衡量 (ODM),将投放在 Google iOS 应用上的广告归因于相应的应用安装,从而在提高评估准确性的同时保护用户隐私。这种方法确保您或 Google 无法识别个人用户、设备或相关应用。
要启用 Google 设备端转化衡量,您需要在 Podfile
中将以下依赖项添加到应用的目标中:
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', { 'Debug' => :debug, 'Profile' => :release, 'Release' => :release,}
def flutter_root generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) unless File.exist?(generated_xcode_build_settings_path) raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" end
File.foreach(generated_xcode_build_settings_path) do |line| matches = line.match(/FLUTTER_ROOT\=(.*)/) return matches[1].strip if matches end raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
target 'Runner' do use_frameworks!
pod 'Adjust/AdjustGoogleOdm' pod 'GoogleAdsOnDeviceConversion', '2.0.0'
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) target 'RunnerTests' do inherit! :search_paths endend
post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) endend
记录应用启动时间
使用“设备端转化衡量”进行准确归因时,其中一个最关键的因素是尽可能精确地记录应用启动时间。Adjust SDK 会在初始化过程中自动处理此操作。因此,务必在应用启动序列中尽早调用 initSdk
方法。
如需延迟启动 Adjust SDK,仍强烈建议您及时调用 initSdk
方法,并使用“首次会话延迟”功能来协调 Adjust SDK 的实际启动与应用的逻辑。