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
-
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 );
-
Send the
AdRevenue
instance using thereportAdRevenue(AdRevenue);
method.AppMetrica.reportAdRevenue(adRevenue);
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.
Was the article helpful?
Previous