AdMob SDK integration If you have any questions about ad revenue tracking with AdMob, please contact your dedicated account manager or send an email to support@adjust.com .
If you want to track your ad revenue with the AdMob SDK, you can use our SDK-to-SDK integration to pass this information to the Adjust backend.
To get started with the AdMob SDK integration, follow these steps:
Configure the Adjust SDK and integrate it in your app. Configure impression-level ad revenue (ILAR) in Admob. See Google's documentation for instructions .
- (void)requestRewardedAd {
__weak ViewController *weakSelf = self;
GADRequest *request = [GADRequest request];
[GADRewardedAd
loadWithAdUnitID:@"ad unit ID"
request:request
completionHandler:^(GADRewardedAd *ad, NSError *error) {
self.rewardedAd = ad;
self.rewardedAd.paidEventHandler = ^void(GADAdValue *_Nonnull value) {
ViewController *strongSelf = weakSelf;
// for more information, please check AdMob official docs at:
// https://developers.google.com/admob/ios/impression-level-ad-revenue
GADAdNetworkResponseInfo *loadedAdNetworkResponseInfo = strongSelf.rewardedAd.responseInfo.loadedAdNetworkResponseInfo;
// send ad revenue info to Adjust
ADJAdRevenue *adRevenue = [[ADJAdRevenue alloc] initWithSource:ADJAdRevenueSourceAdMob];
[adRevenue setRevenue:value.value currency:value.currencyCode];
[adRevenue setAdRevenueNetwork:loadedAdNetworkResponseInfo.adSourceName]
[Adjust trackAdRevenue:adRevenue];
}
}
];
}