Sending ad revenue data on Flutter

Step 1. Make sure that the SDK is activated

Activation example:

AppMetricaConfig config = AppMetricaConfig("API_KEY");
AppMetrica.activate(config);

Step 2. Set up sending ad revenue data

  1. Create a PluginErrorDetails class object.

     Map<String, String> adRevenuePayload = {
         "payload_key_1": "payload_value_1",
         "payload_key_2": "payload_value_2"
     };
    
     AdRevenue adRevenue = AdRevenue(
         adRevenue: Decimal.parse("100.100"),
         currency: "USD",
         adNetwork: "ad_network", // Optional
         adPlacementId: "ad_placement_id", // Optional
         adPlacementName: "ad_placement_name", // Optional
         adType: AdType.NATIVE, // Optional
         adUnitId: "ad_unit_id", // Optional
         adUnitName: "ad_unit_name", // Optional
         precision: "some precision", // Optional
         payload: adRevenuePayload // Optional
         );
    
  2. Send the AdRevenue instance using the reportAdRevenue(AdRevenue); method.

    AppMetrica.reportAdRevenue(adRevenue);
    

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