<br />

When an impression occurs, Google Mobile Ads SDK for React Native provides ad revenue data
associated with that impression. Use this data to calculate a user's lifetime
value (LTV), or forward the data to analytics platforms or third-party
attribution partners.

This guide covers implementing impression-level ad revenue data capture in
your React Native app.

## Prerequisites

Before you continue, do the following:

- Turn on impression-level ad revenue in the AdMob UI. For
  details, see

  [Use impression-level ad revenue](https://support.google.com/admob/answer/11322405)

  in the AdMob UI.

- [Set up Google Mobile Ads SDK for React Native](https://developers.google.com/admob/react-native/quick-start.md.txt).

- Implement at least one ad format:

  - [App open](https://developers.google.com/admob/react-native/app-open.md.txt)
  - [Banner](https://developers.google.com/admob/react-native/banner.md.txt)
  - [Interstitial](https://developers.google.com/admob/react-native/interstitial.md.txt)
  - [Rewarded](https://developers.google.com/admob/react-native/rewarded.md.txt)
  - [Rewarded interstitial](https://developers.google.com/admob/react-native/rewarded-interstitial.md.txt)
  - [Native](https://developers.google.com/admob/react-native/native.md.txt)

## Register a paid event handler

Each ad format supports an [`onAdPaid`](https://developers.google.com/admob/react-native/reference/interface/AdEventCallback.md.txt#AdEventCallback.onAdPaid) event
callback. During an ad lifecycle, Google Mobile Ads SDK for React Native monitors impression
events and invokes the handler with an earned [`AdValue`](https://developers.google.com/admob/react-native/reference/interface/AdValue.md.txt)
payload.

The following example registers a paid event listener on a rewarded ad, logs the
earned ad revenue data, and shows the ad:

```tsx
const rewarded = await RewardedAd.load(adRequest);

rewarded.adEventCallback = {
  onAdPaid(adValue: AdValue) {
    const revenue = adValue.amountMicros / 1000000;
    console.log(`Earned ad revenue: ${revenue} ${adValue.currencyCode}`);
    console.log(`Precision level: ${adValue.precision}`);
  },
};

rewarded.show();
```

We recommend you do the following:

- For full-screen ads, set the listener on the ad object after you load the
  ad and before showing the ad. For banner and native ads, pass the `onAdPaid`
  callback as a prop to the `<BannerAdView />` or `<NativeAdView />` component.
  This process makes sure that you don't miss any paid event callbacks.

- Send the impression-level ad revenue information to your preferred
  analytics server when Google Mobile Ads SDK for React Native calls the `onAdPaid` callback.
  This process makes sure that you don't miss callbacks and keeps
  your data consistent.

### Learn about AAP integration

For details on forwarding ad revenue data to analytics platforms,
see the following App Attribution Partners (AAP) guides:

- [Adjust](https://dev.adjust.com/en/sdk/react-native)
- [AppsFlyer](https://dev.appsflyer.com/hc/docs/react-native-plugin)
- [Singular](https://support.singular.net/hc/en-us/articles/360038415852-React-Native-SDK-Basic-Integration)
- [Tenjin](https://www.npmjs.com/package/react-native-tenjin)

## Understand the `AdValue` object

An `AdValue` object represents the monetary value earned for an ad,
including the currency code and precision type. The following table lists the
`AdValue` object properties:

| Property | Description |
|---|---|
| `amountMicros` | The ad revenue in micro-units, where `1000000` micros equals one unit of currency, such as US$1.00 or €1.00. |
| `currencyCode` | The ISO 4217 currency code of the ad value, for example, `USD` or `EUR`. |
| `precision` | The precision level of the ad value. The following list details each precision level: - `UNKNOWN`: An unknown ad value. This value returns when LTV pingback is enabled without enough data. - `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 an ad. |

In AdMob Mediation, AdMob attempts to provide an `ESTIMATED`
value for ad sources that

are optimized. For details, see
[Optimize waterfall ad sources in mediation](https://support.google.com/admob/answer/7374110).

If an ad source isn't optimized, or lacks enough aggregated
data for an estimate, Google Mobile Ads SDK for React Native returns the `PUBLISHER_PROVIDED` precision
type.

> [!NOTE]
> **Note:** In live ad requests, bidding ad sources provide the `PRECISE` precision type.

### 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.

For details on sending a test ad request, see
[Enable test devices](https://developers.google.com/admob/react-native/test-ads.md.txt#enable-test-devices).