Skip to content

smartadserver/smart-gma-mediation-adapter-ios

Repository files navigation

Smart AdServer - Google Mobile Ads SDK Adapter

Introduction

The Smart Display SDK can be used through Google Mobile Ads SDK using the adapter provided in this repository for banner, interstitial and rewarded video. Those adapters are compatible with:

  • Smart Display SDK v7.21+
  • Google Mobile Ads SDK v10.6.0

Setup

  1. Install the Google Mobile Ads SDK according to the official documentation https://developers.google.com/admob/ios/download.

  2. Install the Smart Display SDK by adding the pod Smart-Display-SDK to your app Podfile (more info in the documentation).

  3. Checkout this repository and copy the files you need into your Xcode Project:

  • SASGMAUtils in any cases.
  • SASGMABannerAdapter for banner ads.
  • SASGMAInterstitialAdapter for interstitial ads.
  • SASGMARewardedAdapter for rewarded video ads.
  • SASGMANativeAdapter for native ads ads.
  1. You can now declare SDK Mediation Creatives in the Google Mobile Ads interface. To setup the Custom Event (under Ad networks), you need to fill:
  • the Parameter field: set your Smart AdServer IDs using slash separator [siteID]/[pageID]/[formatID]
  • the Class Name field: set SASGMABannerAdapter for banners, SASGMAInterstitialAdapter for interstitials or SASGMARewardedAdapter for rewarded videos.
  1. If you intend to use keyword targeting in your Smart insertions, typically if you want it to match any custom targeting you have set-up on Google Ad Manager interface, you will need to set it on Google ad requests in your application.

For Banner, Interstitial and Native-Ad, this is done by using GADRequest's keywords attribut. For instance, for banner case, if your smart insertion uses "myCustomBannerTargeting" string on any Smart programmed banner insertion:

let request = GADRequest()
request.keywords = ["myCustomBannerTargeting", "and", "additional", "keywords"]
bannerView.load(request)

For Rewarded Video, this is done by registering extra on GADRequest instance using our SASGMAAdNetworkExtra class. For instance, if your smart insertion uses "myCustomTargeting" string on any Smart programmed rewarded video insertion:

let request = GADRequest()
request.register(SASGMAAdNetworkExtra(keywords: ["myCustomTargeting", "and", "additional", "keywords"]))
GADRewardedAd.load(withAdUnitID: "yourAddUnitID", request: request)

As you can see, in both solution you can set-up multiples keywords, they will be concatenated before making the ad call via Smart Display SDK.

More infos

You can find more informations about the Smart Display SDK and the Google Mobile Ads SDK in the official documentation: https://documentation.smartadserver.com/displaySDK