AATKit Android Integration
Release Notes
  • Start
    • Setup
      • Maven
      • Prerequisites
      • Google Family Safe Apps
    • Initialization
    • Consent
      • General Handling
      • Managed Consent
        • Google CMP
        • Sourcepoint CMP
        • SFBX (AppConsent) CMP
      • Vendor Consent
      • Simple Consent
    • Plugins documentation
    • Additional Information
  • Formats
    • Introduction
    • Banner
      • Auto Load Banner
      • Multi-Size Auto Load Banner
      • Banner Cache
      • Infeed Banner
      • Sticky Banner
      • Multi-Size Banner
    • Fullscreen (Interstitial)
    • AppOpen (Google)
    • Rewarded Video
      • Server-Side Verification (SSV)
    • Native Ad
      • Basic Integration
      • Network Specifics
        • Native Ads: Google
        • Native Ads: ApplovinMax
        • Native Ads: Bluestack
        • Native Ads: FacebookAudienceNetwork
        • Native Ads: Huawei
  • Ad Networks
    • Customize Ad Networks
    • Google Mobile Ads SDK
    • AppLovinMax Ad Review
    • AppNexus special settings
    • FeedAd Shutter Colour and Disabling Spinner
    • Kidoz
  • Advanced
    • Targeting
      • Key-Value Targeting
      • User Targeting
      • Content Targeting URL
    • Frequency Capping
    • Advanced Listeners
      • Reports Delegate
      • Impression Listener (ILRD)
      • Statistics Listener
    • AATKit's Size
    • Ad Space and Fill Rate
    • Shake Debug
    • Child-directed Support
    • Geo Tracking
    • Disabling Ad Networks
    • Huawei Support
    • Creatives History
  • Other
    • AdMob Custom Events
    • Reference
      • Classes
        • AATKit
        • AATKitUserTargeting
        • CollapsibleBannerOptions
        • AATKitDebugScreenConfiguration
        • PlacementDebugInfo
        • AATKitDebugInfo
        • AATKitConfiguration
        • AATKitRuntimeConfiguration
        • ManagedConsent
        • VendorConsent
        • SimpleConsent
        • BannerConfiguration
        • BannerRequest
        • BannerCacheConfiguration
        • AATKitReward
        • NativeAdRating
        • AATKitImpression
        • PriceInfo
        • AdInfo
        • RewardedAdSSVInfo
        • PlacementHistoryInfo
        • AATKitAdNetworkOptions
          • SuperAwesomeOptions
          • FeedAdOptions
          • AppNexusOptions
          • AdMobOptions
          • DFPOptions
      • Interfaces
        • CacheStatusDelegate
        • AATKit.Delegate
        • BannerCache
        • BannerRequestCompletionListener
        • ManagedConsentDelegate
        • VendorConsentDelegate
        • Placement
        • StickyBannerPlacement
        • StickyBannerPlacementListener
        • MultiSizeBannerPlacement
        • MultiSizeBannerPlacementListener
        • InfeedBannerPlacement
        • InfeedBannerPlacementListener
        • BannerRequestDelegate
        • CacheDelegate
        • FullscreenPlacement
        • FullscreenPlacementListener
        • AppOpenAdPlacement
        • AppOpenPlacementListener
        • RewardedVideoPlacement
        • RewardedVideoPlacementListener
        • NativeAdPlacement
        • NativePlacementListener
        • NativeAdData
        • AutoLoadBannerPlacement
        • AutoLoadBannerPlacementListener
        • AutoLoadMultiSizeBannerPlacement
        • AutoLoadMultiSizeBannerPlacementListener
        • ReportsDelegate
        • ImpressionListener
        • StatisticsListener
      • Enumerations
        • AATKitGender
        • AdNetwork
        • ManagedConsentState
        • NonIABConsent
        • BannerPlacementSize
        • BannerSize
        • MediationType
        • ImpressionPricePrecisionType
  • Samples
Powered by GitBook
On this page
  • Impression Listener
  • Listen to Placement Impressions
  • Accuracy matrix
  • Complete Code Example
  1. Advanced
  2. Advanced Listeners

Impression Listener (ILRD)

Listen to placements' impressions events (Impression-Level Revenue Data)

Last updated 1 month ago

Impression Listener

enables publishers to listen to impression events for all ad formats. Impression listener provides - amongst others - impression-level revenue data (ILRD) as an instance of object, in case the mediation type is supported (see details below).

Listen to Placement Impressions

To set the impression listener for a specific placement, use the following code:

placement.setImpressionListener(this);
placement.impressionListener = this

If the ad network provides impression-level revenue data, AATKit will use this information during the AATKitImpression instantiation and pass it to ImpressionListener via the didCountImpression callback. Otherwise, AATKit will detect and collect the impression-level information internally and provide it to the impression delegate via the same didCountImpression callback. See the accuracy matrix below to learn how exact price information should be for given network and mediation type.

Google Impression-Level Revenue

AATKit uses impression-level revenue data provided by Google to report impressions. To ensure this functionality works correctly for Google ads, please enable the impression-level ad revenue feature in your account's UI:

Ad Network

Use the getAdNetworkName() method to get the string representation of the enum.

Price Information

Use the getPriceInfo method to get the (if available), like price, currency and precision type

The price value passed in the impression object is CPM price

Accuracy matrix

The accuracy of price information and used currency varies between ad networks and mediation types. Please see the following table for more information.

AdNetwork
Mediation type
Accuracy
Currency

AmazonHB

Any

Exact

USD

AppNexus

Any

Exact

USD

Criteo

Auction

Exact

USD

Waterfall, MAYO

Exact

EUR

GraviteRTB

Any

Exact

USD

Google: AdMob, AdManager(DFP)

Any

Depends on ad response from the network

USD

Equativ (SmartAdServer)

Auction

Exact

USD

MAYO

Floor price

EUR

Waterfall

No price information

No price information

YOC

Auction

Exact

USD

Waterfall, MAYO

Exact

Depends on ad response from the network

All other networks

Waterfall

No price information

No price information

MAYO

Floor price

EUR

Complete Code Example

The below example can be applied to all types of placements.

private void requestAd() {
    // Setting the impression delegate for the infeed-banner placement
    inFeedBannerPlacement.setImpressionListener(this);
    BannerRequest request = new BannerRequest(this);
    inFeedBannerPlacement.requestAd(request, (layout, error) -> {
        // Display the banner or handle the error
    });
}

@Override
public void didCountImpression(@NonNull Placement placement, @NonNull AATKitImpression impression) {
    Log.i("ImpressionInfo", "placement: " + placement + "impression: " + impression);
    Log.i("ImpressionInfo", "Banner Size: " + impression.getBannerSize());
    Log.i("ImpressionInfo", "Network Key: " + impression.getNetworkKey());
    Log.i("ImpressionInfo", "Ad Network: " + impression.getAdNetwork());
    Log.i("ImpressionInfo", "Direct Deal: " + impression.isDirectDeal());
    Log.i("ImpressionInfo", "Price: " + impression.getPriceInfo().getPrice());
    Log.i("ImpressionInfo", "Ad Network Name: " + impression.getAdNetworkName());
}
private fun requestAd() {
    // Setting the impression delegate for the infeed-banner placement
    inFeedBannerPlacement.impressionListener = this
    val request = BannerRequest(this)
    inFeedBannerPlacement.requestAd(request,
        object : BannerRequestCompletionListener {
            override fun onRequestCompleted(layout: BannerPlacementLayout?, error: BannerRequestError?) {
                // Display the banner or handle the error
            }
        })
}

override fun didCountImpression(placement: Placement, impression: AATKitImpression) {
    Log.i("ImpressionInfo", "placement: ${placement}impression: $impression")
    Log.i("ImpressionInfo", "Banner Size: ${impression.getBannerSize()}")
    Log.i("ImpressionInfo", "Network Key: ${impression.networkKey}")
    Log.i("ImpressionInfo", "Ad Network: ${impression.adNetwork}")
    Log.i("ImpressionInfo", "Direct Deal: ${impression.isDirectDeal}")
    Log.i("ImpressionInfo", "Price: ${impression.priceInfo.price}")
    Log.i("ImpressionInfo", "Ad Network Name: ${impression.adNetworkName}")
}
ImpressionListener
AATKitImpression
Google AdMob
Google AdManager
AdNetwork
object representing detailed impression price information