SDK Documentation
HomeBlogSign up
English
English
  • 🏠Homepage
  • 🧪Test Ad Units
  • Privacy
    • ✅Google Data Safety
  • Android SDK
    • ⌨️SDK integration
      • App Open
      • Banner
      • Interstitial
      • Rewarded
      • Native (Google)
      • Targeting
      • Revenue reporting
    • 🙎User consent
    • 🔓Privacy
    • 🛠️ProGuard
  • iOS SDK
    • ⌨️SDK integration
      • App Open
      • Banner
      • Interstitial
      • Rewarded
      • Native (Google)
      • Revenue reporting
    • 🙍User consent
    • 🔓Privacy
  • Unity SDK
    • ⌨️SDK integration
      • App Open
      • Banner
      • Interstitial
      • Rewarded
      • Targeting
      • Revenue reporting
    • 🙎User consent
    • 🔓Privacy
  • Flutter SDK
    • ⌨️SDK integration
      • App Open
      • Banner
      • Interstitial
      • Rewarded
      • Native (Google)
      • Targeting
      • Revenue reporting
    • 🙎User consent
    • 🔓Privacy
  • React Native
    • ⌨️SDK integration
      • App Open
      • Banner
      • Interstitial
      • Rewarded
      • Targeting
      • Revenue reporting
    • 🙎User consent
    • 🔓Privacy
  • Web SDK
    • ⌨️SDK integration
Con tecnología de GitBook
En esta página
  • Implementation
  • Integration with Firebase
  1. Flutter SDK
  2. SDK integration

Revenue reporting

Implementation

Since version 1.7.0, apps can receive an estimated revenue that has likely been generated by an ad.

To do this, it is just needed to implement the corresponding listener for each ad format, as shown in the example below:

BannerAd(
  ...
  listener: (event, args) {
    if (event == BannerAdEvent.REVENUE_PAID) {
      // El anuncio ha sido generado un ingreso
    }
  },
)

The listener receives an object as argument that contains the following fields:

Field
Type
Description

revenue

Map

The revenue generated by the ad

source

String

The revenue source

In addition, the revenue object contains the following fields that represent the revenue:

Field
Type
Description

currency

String

The currency corresponding to the revenue

precision

String

The accuracy of the information. It can be ESTIMATED, PRECISE or PUBLISHER_DEFINED

value

double

The revenue value

Integration with Firebase

Below, a basic example is shown of how to report the revenue information to Firebase:

final analytics = FirebaseAnalytics();

BannerAd(
  ...
  listener: (event, args) {
    if (event == BannerAdEvent.REVENUE_PAID) {
      analytics.logEvent(
        name: 'ad_revenue',
        parameters: {
          'currency':  args['revenue']['currency'],
          'precision': args['revenue']['precision'],
          'source':    args['source'],
          'value':     args['revenue']['value'],
        },
      );
    }
  },
)
AnteriorTargetingSiguienteUser consent

Última actualización hace 3 días

⌨️