Package io.appmetrica.analytics
Class AdRevenue
java.lang.Object
io.appmetrica.analytics.AdRevenue
The class to store Ad Revenue data.
The Ad Revenue object should be passed to the AppMetrica by using the
AppMetrica.reportAdRevenue(AdRevenue)
or IReporter.reportAdRevenue(AdRevenue)
method.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionfinal String
Ad network.final String
Id of ad placement.final String
Name of ad placement.final BigDecimal
Amount of money received via ad revenue.final AdType
Ad type.final String
Id of ad unit.final String
Name of ad unit.final Currency
Currency in which money from `adRevenue` is represented.Arbitrary payload: additional info represented as key-value pairs.final String
Precision. -
Method Summary
Modifier and TypeMethodDescriptionstatic AdRevenue.Builder
newBuilder
(double adRevenue, Currency currency) Creates the new instance ofAdRevenue.Builder
.static AdRevenue.Builder
newBuilder
(long adRevenueMicros, Currency currency) Creates the new instance ofAdRevenue.Builder
.static AdRevenue.Builder
newBuilder
(BigDecimal adRevenue, Currency currency) Creates the new instance ofAdRevenue.Builder
.
-
Field Details
-
adRevenue
Amount of money received via ad revenue. It cannot be negative. -
currency
Currency in which money from `adRevenue` is represented. -
adType
Ad type. See possible values inAdType
. -
adNetwork
Ad network. Maximum length is 100 symbols. If the value exceeds this limit it will be truncated by AppMetrica. -
adUnitId
Id of ad unit. Maximum length is 100 symbols. If the value exceeds this limit it will be truncated by AppMetrica. -
adUnitName
Name of ad unit. Maximum length is 100 symbols. If the value exceeds this limit it will be truncated by AppMetrica. -
adPlacementId
Id of ad placement. Maximum length is 100 symbols. If the value exceeds this limit it will be truncated by AppMetrica. -
adPlacementName
Name of ad placement. Maximum length is 100 symbols. If the value exceeds this limit it will be truncated by AppMetrica. -
precision
Precision. Example: "publisher_defined", "estimated". Maximum length is 100 symbols. If the value exceeds this limit it will be truncated by AppMetrica. -
payload
Arbitrary payload: additional info represented as key-value pairs. Maximum size is 30 KB. If the value exceeds this limit it will be truncated by AppMetrica.
-
-
Method Details
-
newBuilder
public static AdRevenue.Builder newBuilder(@NonNull BigDecimal adRevenue, @NonNull Currency currency) Creates the new instance ofAdRevenue.Builder
.- Parameters:
adRevenue
- Amount of money received via ad revenue.currency
- Currency.- Returns:
- new
AdRevenue.Builder
instance. - See Also:
-
newBuilder
Creates the new instance ofAdRevenue.Builder
.- Parameters:
adRevenueMicros
- Amount of money received via ad revenue represented as micros (actual value multiplied by 10^6). It will be converted toBigDecimal
.currency
- Currency.- Returns:
- new
AdRevenue.Builder
instance. - See Also:
-
newBuilder
Creates the new instance ofAdRevenue.Builder
.- Parameters:
adRevenue
- Amount of money received via ad revenue represented as double. It will be converted toBigDecimal
. Note that for that purpose AppMetrica usesBigDecimal(double)
} constructor which can yield unpredictable results for values that cannot be precisely represented as double.currency
- Currency.- Returns:
- new
AdRevenue.Builder
instance. - See Also:
-