Impression-level ad revenue
When an impression occurs, Google Mobile Ads SDK provides ad revenue data associated with that impression. You can use the data to calculate a user's lifetime value, or forward the data downstream to other relevant systems.
Prerequisites
- Make sure you have turned on the impression-level ad revenue feature in the AdMob UI.
-
Complete the following steps described in the Get Started guide:
-
Before you can receive any impression-level ad revenue, you need to implement at least one ad format:
Paid event delegate
Each ad format has an OnPaidEvent
delegate. During the lifecycle of an ad event, Google Mobile Ads SDK monitors impression events and broadcasts the delegate with an earned value.
#include "GoogleAdMobAdValue.h"
// ...
Ad->OnPaidEvent.AddDynamic(this, &UYourClass::OnPaidEvent);
// ...
void UYourClass::OnPaidEvent(const FGoogleAdMobAdValue& AdValue)
{
AdValue.ValueMicros;
AdValue.PrecisionType;
AdValue.Domain; // Currency Code
}
AdValue
UGoogleAdMobAdValue
is a struct that represents the monetary value earned for an ad, including the value's currency code and its precision type encoded as follows.
Note
ValueMicros
property represents the value of the ad in micro units. For example, a ValueMicros
value of 5,000 means the ad is estimated to be worth $0.005.
PrecisionType | Description |
---|---|
UNKNOWN |
An ad value that's unknown. This gets returned when LTV pingback is enabled but there isn't enough data available. |
ESTIMATED |
An ad value estimated from aggregated data. |
PUBLISHER_PROVIDED |
A publisher provided ad value, such as manual CPMs in a mediation group. |
PRECISE |
The precise value paid for this ad. |
In the case of AdMob Mediation, AdMob tries to provide an ESTIMATED
value for ad sources that are optimized.
For non-optimized ad sources, or in cases where there aren't enough aggregated data to report a meaningful estimation, the PUBLISHER_PROVIDED
value is returned.
Test impressions from bidding ad sources
After an impression-level ad revenue event occurs for a bidding ad source through a test request, you receive only the following values:
UNKNOWN
: indicates the precision type.0
: indicates the ad value.
Previously, you might have seen the precision type as a value other than UNKNOWN
and an ad value more than 0
.
For details on sending a test ad request, see Enable test devices.