Login
Welcome
Login

Prebid Mobile SDK - TeadsPluginRenderer

  1. Prerequisites
  2. Installation
  3. Register the teads plugin renderer
  4. Specify contextUrl targeting
  5. TeadsMediationSettings
  6. Ad Formats
  7. Ad Request
  8. Ad Listener
  9. Ad Resizing
  10. PluginRenderer under the hood
  11. Prebid Server setup
  12. Check list
  13. Ad settings

This article shows you how to deliver Teads ads on your application using the Prebid Mobile SDK.

Using CocoaPods to have Teads Prebid plugin will automatically import the Teads inApp SDK framework.

Sample App on GitHub
Teads inApp SDK iOS sample App

Prerequisites

Installation

Before installing the Teads Prebid plugin, you will need to integrate PrebidMobile SDK into your application.

CocoaPods

If your project is managing dependencies through CocoaPods, you just need to add this pod in your Podfile.

It will install the Teads adapter along with the Teads inApp SDK.

  1. Add Pod named TeadsPrebidPlugin in your Podfile:
pod 'TeadsPrebidPlugin', '~> 5.1.0'
  1. Run the following to install the adapter in your project.
$ pod install --repo-update to install

Swift Package Manager

TeadsPrebidPlugin is not available due to the fact that PrebidMobile is not available through SPM

Register the teads plugin renderer

You need to register the Teads plugin renderer. Such registration can be done just once during the initialisation of your app in AppDelegate or in UIViewController.

import TeadsPrebidPlugin
import PrebidMobile

Prebid.registerPluginRenderer(TeadsPBMPluginRenderer())

You can also pass in the plugin renderer constructor a TeadsAdapterSettings class.

import TeadsPrebidPlugin
import PrebidMobile

let teadsSettings = TeadsAdapterSettings { (settings) in
    settings.enableDebug()
}


Prebid.registerPluginRenderer(TeadsPBMPluginRenderer(settings: teadsSettings))

Specify contextUrl targeting

Set the publisher http page url that matches the content where Teads Ad will be loaded.
This values helps to target context and also guaranty brand safety to our advertisers.

Targeting.shared.addContextData(key: "contextUrl", value: "https://example.com/my_article_1")

TeadsMediationSettings

Find the full settings list here

Ad Formats

Currently the Teads plugin renderer supports Banner only.

ℹ️ Notice that banners could serve image and video as well according to your banner ad unit setup.

If you make use of other ad formats in your Prebid SDK implementation, other demand partners will continue to be able to serve your bid requests normally.

Ad Request

No additional step should be made on your app implementation in order to request ads, just integrate your Prebid BannerView normally according to the Prebid SDK docs.

Ad Listener

To be fully aware of Teads ad lifecycle, conforms on your Prebid BannerView to the TeadsPBMEventDelegate interface.

Other ad events such as onAdClicked, onAdDisplayed and so on can be listened by implementing Prebid BannerViewDelegate interface directly. Please check all events on the Prebid SDK docs.

Ad Resizing

This part is a must and not implementing it will drastically affect the fill rate from Teads demand.

Having the ad creative correctly rendered is crucial to ensure great user experience and good performance measurement.

Allowed by VPAID standard; ads can adopt modular dimensions and ratio in place of pre-defined fixed sizes making necessary to be able to dynamically adapt the size and ratio of the ad view depending on the loaded creative.

Even though resize requests occur generally in the ad initialisation steps, it is necessary to be able to satisfy them all along the ad experience.

It is mandatory to programmatically adapt the size of the Ad container.
The Teads inApp SDK will notify you each resize request coming from the creative.

AdRatio contains all information to calculate the corresponding height for the requested width.
Use calculateHeight to ease the calculation.

import TeadsPrebidPlugin
import PrebidMobile

class MyViewController : UIViewController, TeadsInReadAdPlacementDelegate {

    @IBOutlet weak var slotHeightConstraint: NSLayoutConstraint! // set to 0 in InterfaceBuilder
    var bannerView: BannerView?

    override func viewDidLoad() {
        super.viewDidLoad()
        bannerView = BannerView(configID: prebidConfigId,  eventHandler: adEventHandler)
        bannerView?.setPluginEventDelegate(self)
    }

    func didUpdateRatio(ad: TeadsInReadAd, adRatio: TeadsAdRatio) {
        guard let bannerView else {
            return
        }
        slotHeightConstraint.constant = adRatio.calculateHeight(for: bannerView.frame.width)
    }

PluginRenderer under the hood

If you look for more understanding regarding how a plugin renderer works over the Prebid Mobile SDK, please find more here.

Prebid Server setup

Notice that in order to turn your Teads plugin renderer fully functional and leverage from Teads demand you need to wire the Teads Adapter to your Prebid Server, please find more here.

you will then need to put a little configuration for each of your ad slots name:

name: imp-300x250-banner

{
  "ext": {
    "teads": {
      "placementId": 204344 // Your Teads placement ID (PID) provided by the publisher manager
    }
  }
}

Check list

  • ✅ Register the Teads plugin renderer
  • ✅ Subscribe to the event listeners
  • ✅ Implement ad view resizing
  • ✅ Setup your Prebid Server with the Teads Adapter
  • ✅ Ensure Brand Safety is enabled
  • ✅ Ensure you comply with privacy legal requirements (GDPR/CCPA).
  • ✅ Comply with app-ads.txt

Ad settings

Find the full settings list here

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.