Sending ad revenue data on iOS

Step 1. Make sure that the SDK is activated

Activation example:

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

  1. Initialize the MutableAdRevenueInfo instance.

  2. Send the MutableAdRevenueInfo instance to the main API key using the +reportAdRevenue:onFailure: method of the AppMetrica class.

    [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.

  1. View ads in the app.

  2. 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.

Contact support