Skip to content

Understitial

Integration

Understitials are typically displayed inside some scrollview, behind the content so the user show it themselves while going through the natural navigation so it doesn't negatively impact the user experience.

When an app shows an understitial ad, the user has the choice to either tap on the ad and will be forwarded or close it and return to the app. Understitials are very similar to the interstitials, but the place for their presentation is more specific.

The understitial ad is a special ad format. Please contact us upfront if you want to use it.

Prerequisites


  • Import the ADvantage SDK

Integration of the understitial ads


To integrate the understitial ad make sure that:

  • All elements that are on the same page as the ad must have a background-color/image. So that the background-image from the understitial ad is never visible through your content
  • The container where you put the ADvantage object should not have any background-color/image and you must set the ADvantage instance as transparent
  • We recommend that you use an ad position outside of the screen to have the full parallax effect

The ADvantage understitial ad will add containers below the current ADvantage instance in your structure.

Schematic representation: Banners

Implementing an understitial ad:

// Initializing the banner
var understitial = ADvantage(bannerWithLicenseKey: "...", siteId: "...", position: "...")

override func viewDidLoad() {
    super.viewDidLoad()
    // Good to use the container where you want to use understitial as base for it
    understitial.view.frame = CGRect(origin: tableView.frame.origin, size: tableView.frame.size)
    understitial.delegate = self

    // In understitial it is necessary to set the max dimension for the banner otherwise it will not work
    // this value represents the Transparent AD space, it can be the size of the container or smaller
    understitial.setMaxDimensionForBanner(tableView.frame.inset(by: tableView.safeAreaInsets).size)
}

// Adding in which row you want it be show
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
    let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath)

    if indexPath.row == rowToShow {
        cell.addSubview(understitial.view)
        self.understitial.requestAd()
    }
}

// Since iOS re-use cells it is a good ideia to remove it after use
func tableView(_ tableView: UITableView, didEndDisplaying cell: UITableViewCell, forRowAt indexPath: IndexPath) {
    if indexPath.row == rowToShow {
        understitial.view.removeFromSuperview()
    }
}
- (void)viewDidLoad {
    // Initializing the banner
    self.understitial = [[ADvantage alloc] initBannerWithLicenseKey:@"..." SSLEnabled:YES SiteId:@"..." Position:@"..."];

    // Good to use the container where you want to use understitial as base for it
    [self.understitial.view setFrame:CGRectMake(self.tableView.frame.origin.x, self.tableView.frame.origin.y, tableView.frame.size.width, tableView.frame.size.height)];

    self.understitial.delegate = self;
    [self.understitial requestAd];

    // In understitial it is important to set the max dimension for the banner
    // this value represents the Transparent AD space, it can be the size of the container or smaller
    [self.understitial setMaxDimensionForBanner:visibleDimensions];
}

// Adding in which row you want it be show
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

    if (indexPath.row == rowToShow) {
        [cell addSubview:understitial.view];
        [self.understitial requestAd];
    }
}

// Since iOS re-use cells it is a good ideia to remove it after use
- (void)tableView:(UITableView *)tableView didEndDisplayingCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
    if (indexPath.row == rowToShow) {
        [understitial.view removeFromSuperview];
    }
}

We strongly recommend the use of a Consent Management Platform (CMP) compliant with TCF 2.0 if your audience on your website/app, in whole or in part, is located within the EU.

Click here for instructions on how to hand over TCF 2.0 Consent to ADvantage.