AdMob SDK 集成 如果您想使用 AdMob SDK 监测广告收入,可以借助 SDK 到 SDK 集成,将数据发送到 Adjust 服务器。 操作前须知 配置 Adjust SDK 并将其集成至您的应用。 在 AdMob 中配置展示层级广告收入 (ILAR)。请参考 Google 的说明文档。 示例 1- (void)requestRewardedAd {2 __weak ViewController *weakSelf = self;3 4 GADRequest *request = [GADRequest request];5 [GADRewardedAd6 loadWithAdUnitID:@"ad unit ID"7 request:request8 completionHandler:^(GADRewardedAd *ad, NSError *error) {9 self.rewardedAd = ad;10 self.rewardedAd.paidEventHandler = ^void(GADAdValue *_Nonnull value) {11 ViewController *strongSelf = weakSelf;12 // for more information, please check AdMob official docs at:13 // https://developers.google.com/admob/ios/impression-level-ad-revenue14 GADAdNetworkResponseInfo *loadedAdNetworkResponseInfo = strongSelf.rewardedAd.responseInfo.loadedAdNetworkResponseInfo;15 16 // send ad revenue info to Adjust17 ADJAdRevenue *adRevenue = [[ADJAdRevenue alloc]18 initWithSource:@"admob_sdk"];19 [adRevenue setRevenue:value.value currency:value.currencyCode];20 [adRevenue setAdRevenueNetwork:loadedAdNetworkResponseInfo.adSourceName]21 [Adjust trackAdRevenue:adRevenue];22 }23 }24 ];25}