Impression Listener (ILRD)

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

Impression Listener

ImpressionListener 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 AATKitImpression object, in case the mediation type is supported (see details below).

Pass Impression Listener to Placement

Use the following code to set the impression listener for a specific placement:

placement.setImpressionListener(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.

Google Impression-Level Revenue

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

Ad Network

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

Price Information

Use the getPriceInfo method to get the object representing detailed impression price information (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

Other

Exact

EUR

GraviteRTB

Any

Exact

USD

Equativ (SmartAdServer)

Auction

Exact

USD

MAYO

Floor price

EUR

Waterfall

No price information

No price information

YOC

Auction

Exact

USD

Other

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());
}

Last updated