Stay organized with collections
Save and categorize content based on your preferences.
firebase::gma::AdValue
#include <types.h>
The monetary value earned from an ad.
Summary
Constructors and Destructors
|
AdValue(const char *currency_code, PrecisionType precision_type, int64_t value_micros)
Constructor.
|
Public functions
|
currency_code() const
|
const std::string &
The value's ISO 4217 currency code.
|
precision_type() const
|
The precision of the reported ad value.
|
value_micros() const
|
int64_t
The ad's value in micro-units, where 1,000,000 micro-units equal one unit of the currency.
|
Public types
PrecisionType
PrecisionType
Allowed constants for precision_type().
Properties |
kAdValuePrecisionEstimated
|
An ad value estimated from aggregated data.
|
kAdValuePrecisionPrecise
|
The precise value paid for this ad.
|
kAdValuePrecisionPublisherProvided
|
A publisher-provided ad value, such as manual CPMs in a mediation group.
|
kAdValuePrecisionUnknown
|
An ad value with unknown precision.
|
Public functions
AdValue
AdValue(
const char *currency_code,
PrecisionType precision_type,
int64_t value_micros
)
currency_code
const std::string & currency_code() const
The value's ISO 4217 currency code.
precision_type
PrecisionType precision_type() const
The precision of the reported ad value.
value_micros
int64_t value_micros() const
The ad's value in micro-units, where 1,000,000 micro-units equal one unit of the currency.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-20 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-20 UTC."],[[["\u003cp\u003e\u003ccode\u003efirebase::gma::AdValue\u003c/code\u003e represents the monetary value earned from an ad, including currency, precision, and the value itself.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods to access the currency code (\u003ccode\u003ecurrency_code()\u003c/code\u003e), precision (\u003ccode\u003eprecision_type()\u003c/code\u003e), and value in micro-units (\u003ccode\u003evalue_micros()\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ePrecisionType\u003c/code\u003e indicates the accuracy of the ad value, ranging from unknown to precise or publisher-provided.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can use \u003ccode\u003eAdValue\u003c/code\u003e to retrieve and utilize ad revenue information within their Firebase GMA applications.\u003c/p\u003e\n"]]],["The `firebase::gma::AdValue` class represents the monetary value of an ad. It can be constructed using a currency code, precision type, and value in micro-units. Key functions include retrieving the currency code (`currency_code()`), the precision of the ad value (`precision_type()`), and the value itself in micro-units (`value_micros()`). `PrecisionType` enum defines levels of precision: unknown, estimated, publisher-provided, or precise, indicating how the ad value was determined.\n"],null,["# firebase::gma::AdValue Class Reference\n\nfirebase::gma::AdValue\n======================\n\n\n`#include \u003ctypes.h\u003e`\n\nThe monetary value earned from an ad.\n\nSummary\n-------\n\n| ### Constructors and Destructors ||\n|---|---|\n| [AdValue](#classfirebase_1_1gma_1_1_ad_value_1a789e06266ee31e321d3a8f54956577c5)`(const char *currency_code, `[PrecisionType](/admob/cpp/reference/class/firebase/gma/ad-value#classfirebase_1_1gma_1_1_ad_value_1a7301e2b32526050dc930f6d5bde08eb3)` precision_type, int64_t value_micros)` Constructor. ||\n\n| ### Public types ||\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [PrecisionType](#classfirebase_1_1gma_1_1_ad_value_1a7301e2b32526050dc930f6d5bde08eb3)`{` ` `[kAdValuePrecisionUnknown](#classfirebase_1_1gma_1_1_ad_value_1a7301e2b32526050dc930f6d5bde08eb3a8679de42c2ea6f9e7a4cd6cfa620b36d)` = 0,` ` `[kAdValuePrecisionEstimated](#classfirebase_1_1gma_1_1_ad_value_1a7301e2b32526050dc930f6d5bde08eb3ae2f618e55fec703f67dd951f752981db)`,` ` `[kAdValuePrecisionPublisherProvided](#classfirebase_1_1gma_1_1_ad_value_1a7301e2b32526050dc930f6d5bde08eb3a40b071491590e2bdd32f46d84366e2ca)` = 2,` ` `[kAdValuePrecisionPrecise](#classfirebase_1_1gma_1_1_ad_value_1a7301e2b32526050dc930f6d5bde08eb3ab45bb6e6588b185181b5c53dc41db2fc)` = 3` `}` | enum Allowed constants for [precision_type()](/admob/cpp/reference/class/firebase/gma/ad-value#classfirebase_1_1gma_1_1_ad_value_1aebe0538d85150d7b9dfb4d63dd0f861a). |\n\n| ### Public functions ||\n|----------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [currency_code](#classfirebase_1_1gma_1_1_ad_value_1a68b9bf19da42414f2211a2d5ceea9c32)`() const ` | `const std::string &` The value's ISO 4217 currency code. |\n| [precision_type](#classfirebase_1_1gma_1_1_ad_value_1aebe0538d85150d7b9dfb4d63dd0f861a)`() const ` | [PrecisionType](/admob/cpp/reference/class/firebase/gma/ad-value#classfirebase_1_1gma_1_1_ad_value_1a7301e2b32526050dc930f6d5bde08eb3) The precision of the reported ad value. |\n| [value_micros](#classfirebase_1_1gma_1_1_ad_value_1ab8a25dbfbc2ffa5be036ce7636337b60)`() const ` | `int64_t` The ad's value in micro-units, where 1,000,000 micro-units equal one unit of the currency. |\n\nPublic types\n------------\n\n### PrecisionType\n\n```c++\n PrecisionType\n``` \nAllowed constants for [precision_type()](/admob/cpp/reference/class/firebase/gma/ad-value#classfirebase_1_1gma_1_1_ad_value_1aebe0538d85150d7b9dfb4d63dd0f861a).\n\n| Properties ||\n|--------------------------------------|--------------------------------------------------------------------------|\n| `kAdValuePrecisionEstimated` | An ad value estimated from aggregated data. |\n| `kAdValuePrecisionPrecise` | The precise value paid for this ad. |\n| `kAdValuePrecisionPublisherProvided` | A publisher-provided ad value, such as manual CPMs in a mediation group. |\n| `kAdValuePrecisionUnknown` | An ad value with unknown precision. |\n\nPublic functions\n----------------\n\n### AdValue\n\n```c++\n AdValue(\n const char *currency_code,\n PrecisionType precision_type,\n int64_t value_micros\n)\n``` \nConstructor. \n\n### currency_code\n\n```c++\nconst std::string & currency_code() const \n``` \nThe value's ISO 4217 currency code. \n\n### precision_type\n\n```c++\nPrecisionType precision_type() const \n``` \nThe precision of the reported ad value. \n\n### value_micros\n\n```c++\nint64_t value_micros() const \n``` \nThe ad's value in micro-units, where 1,000,000 micro-units equal one unit of the currency."]]