AppsFlyerAdRevenue

Overview

AppsFlyerAdRevenue is the parent class for the ad revenue SDK.

Methods

initaliaze

Method signature

public static void initialize(AppsFlyerAdRevenue revenue)

Description
Initializes the ad revenue SDK.

Input arguments

TypeNameDescription
AppsFlyerAdRevenuerevenueCreates and initializes an AdRevenue singleton object.

Returns
void.

Usage example

AppsFlyerAdRevenue.Builder afRevenueBuilder = new AppsFlyerAdRevenue.Builder( this);
AppsFlyerAdRevenue.initialize(afRevenueBuilder.build());

logAdRevenue

Method signature

public static void logAdRevenue(@NonNull String monetizationNetwork, @NonNull MediationNetwork mediationNetwork, @NonNull Currency eventRevenueCurrency, @NonNull Double eventRevenue, @Nullable Map<String, String> nonMandatory)

Description
Logs an ad revenue impression.

Input arguments

TypeNameDescription
StringmonetizationNetworkThe name of the monetization network.
MediationNetworkmediationNetworkEnum of the medation network.
CurrencyeventRevenueCurrencyCurrency of the ad revenue event.
DoubleeventRevenueAmount of the ad revenue event.
Map<String, String>nonMandatoryContains native and custom fields for the ad revenue payload, as described in the following usage example.

Returns
void.

Usage example

// Creating optional customParams
        Map<String, String> customParams = new HashMap<>();
        customParams.put(Scheme.COUNTRY, "US");
        customParams.put(Scheme.AD_UNIT, "89b8c0159a50ebd1");
        customParams.put(Scheme.AD_TYPE, AppsFlyerAdNetworkEventType.BANNER.toString());
        customParams.put(Scheme.PLACEMENT, "place");
        customParams.put(Scheme.ECPM_PAYLOAD, "encrypt");
        customParams.put("foo", "test1");
        customParams.put("bar", "test2");

        // Actually recording a single impression
        AppsFlyerAdRevenue.logAdRevenue(
                "ironsource",
                MediationNetwork.googleadmob,
                Currency.getInstance(Locale.US),
                0.99,
                customParams
        );

Variables

MediationNetwork

Constants

TypeNameDescription
StringironsourceThe name of the mediation network.
StringapplovinmaxThe name of the mediation network.
StringgoogleadmobThe name of the mediation network.
StringfyberThe name of the mediation network.
StringappodealThe name of the mediation network.
StringadmostThe name of the mediation network.
StringtoponThe name of the mediation network.
StringtradplusThe name of the mediation network.
StringyandexThe name of the mediation network.
StringchartboostThe name of the mediation network.
StringunityThe name of the mediation network.

Did this page help you?