Impression Delegate (ILRD)

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

Impression Delegate

AATImpressionDelegate allows publishers to monitor impression events across all ad formats. The impression delegate provides impression-level revenue data (ILRD) through an instance of AATImpression class (see details below).

Listen to Placement Impressions

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

placement.impressionDelegate = self

If the ad network provides impression-level revenue data, AATKit will use this information during the AATImpression instantiation and pass it to AATImpressionDelegate via the didCountImpression(placement:_:) callback. Otherwise, AATKit will detect and collect the impression-level information internally and provide it to the impression delegate via the same didCountImpression(placement:_:) 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 func getAdNetworkName() -> String method to get the string representation of the AATAdNetwork enum.

Price Info

An instance of AATPriceInfo that holds price details and includes the following properties:

  • Precision: Specifies the precision type of an impression. This should be one of the cases defined in AATImpressionPricePrecisionType.

  • Price: The monetary value.

  • Currency: The currency type of the price.

The price value passed in the impression object is the 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

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.


class ViewController: UIViewController {
    override func viewDidAppear(_ animated: Bool) {
	super.viewDidAppear(animated)
        AATSDK.controllerViewDidAppear(controller: self)
        
        // Setting the impression delegate for the infeed-banner placement
        inFeedBannerPlacement?.impressionDelegate = self
        let request = AATBannerRequest(delegate: self)
        inFeedBannerPlacement?.requestAd(request: request, completion: {[weak self] bannerView, error in
            // Display banner view if not nil and the error is nil
        })
    }
}

extension ViewController: AATImpressionDelegate {
    func didCountImpression(placement: AATPlacement?, _ impression: AATImpression) {
        print("placement: \(placement) - impression: \(impression)")
        print("Banner Size: \(impression.bannerSize)")
        print("Network Key: \(impression.networkKey)")
        print("Ad Network: \(impression.adNetwork)")
        print("Direct Deal: \(impression.isDirectDeal)")
        print("CPM Price: \(impression.priceInfo)")
        print("Ad Network Name: \(impression.getAdNetworkName())")
    }
}

Last updated