Sending ad revenue data on iOS
Step 1. Make sure that the SDK is activated
Activation example:
Objective-C
Swift
AMAAppMetricaConfiguration *configuration = [[AMAAppMetricaConfiguration alloc] initWithApiKey:@"API_key"];
[AMAAppMetrica activateWithConfiguration:configuration];
let configuration = AppMetricaConfiguration.init(apiKey: "API key")
AppMetrica.activate(with: configuration!)
Step 2. Set up sending ad revenue data
-
Initialize the
MutableAdRevenueInfo
instance. -
Send the
MutableAdRevenueInfo
instance to the main API key using the+reportAdRevenue:onFailure:
method of theAppMetrica
class.Objective-CSwift[AMAAppMetrica reportAdRevenue:[adRevenueInfo copy] onFailure:^(NSError *error) { NSLog(@"AdRevenue error: %@", error); }];
AppMetrica.report(adRevenue: adRevenueInfo) { error in print("AdRevenue error: \(error)") }
Step 3. Make sure that the ad revenue data is included in the reports.
-
View ads in the app.
-
Make sure that the Revenue report shows the same number of ad revenue events as the number of ad views.
If you didn't find the answer you were looking for, you can use the feedback form to submit your question. Please describe the problem in as much detail as possible. Attach a screenshot if possible.