# Interstitial Ad

To receive Interstitial Ads, you need to conform to the `MediationAdDelegate` protocol. Once the ad is loaded, it can be presented by calling `presentInterstitial(from:)`.

**Implementation:**

```swift
extension InterstitialAdManager: MediationAdDelegate {
    func onInterstitialAdLoaded(interstitialAd: AdsFramework.MediationInterstitialAd) {
        interstitialAd.presentInterstitial(from: self)
        interstitialAd.eventDelegate = self
    }
    
    func onAdFailedToLoad(error: AdsFramework.AdError) {
        print("Interstitial Ad request failed with reason \(error.description)")
    }
    
    func onAdRevenuePaid(revenue: Double, adUnitId: String, network: String, currency: String, precisionType: AdsFramework.PrecisionType) {
        print("Revenue: \(revenue) \(currency), adUnitId: \(adUnitId), network: \(network), precision: \(precisionType)")
        
    }
}
```

**Tracking Events:**

To track click, impression, and fullscreen events, conform to `MediationInterstitialAdEventDelegate`:

```swift
extension InterstitialAdManager: MediationInterstitialAdEventDelegate {
    func recordInterstitialClick() {
        print("Interstitial clicked")
    }
    
    func recordInterstitialImpression() {
        print("Interstitial impression recorded")
    }
    
    func ad(didFailToPresentFullScreenContentWithError error: AdsFramework.AdError) {
        print("Interstitial failed to present: \(error.description)")
    }
    
    func adWillPresentFullScreenContent() {
        print("Interstitial will present full screen content")
    }
    
    func adDidDismissFullScreenContent() {
        print("Interstitial dismissed full screen content")
    }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ios-docs.adster.tech/ad-types/interstitial-ad.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
