diff --git a/PrebidMobile/Rendering/Documentation/README.md b/PrebidMobile/Rendering/Documentation/README.md new file mode 100644 index 000000000..6227f8097 --- /dev/null +++ b/PrebidMobile/Rendering/Documentation/README.md @@ -0,0 +1,53 @@ +# Prebid Rendering Module iOS +The current SDK version is **x.x.x**. +Go to [release notes]() for all SDK versions. + + +## Quick Start + +#### CocoaPods integration + +To download and integrate the SDK into your project using CocoaPods, add the following line to your project’s podfile: + +``` +pod 'prebid-mobile-sdk-rendering' +``` + +If you integrate Prebid Rendering Module with GAM or MoPub add these pods respectively + +``` +# + Google Ad Manager (optional) +pod 'prebid-mobile-sdk-gam-event-handlers' + +# + MoPub (optional) +pod 'prebid-mobile-sdk-mopub-adapters' +``` + +## Prebid Rendering Module Overview + +For the overview of the In-App Bidding technology, see [Getting started with In-App Bidding](info/ios-in-app-bidding-getting-started.md). + +Here are key capabilities of the iOS Rendering Module: + +- **Integration Scenarios** + - [Pure In-App Bidding](info/integration-prebid/ios-in-app-bidding-pb-info.md) + - [Google Ad Manager](info/integration-gam/ios-in-app-bidding-gam-info.md) + - [MoPub](info/integration-mopub/ios-in-app-bidding-mopub-info.md) + + +- **Support of these premium ad formats:** + - Banner + - Display Interstitial + - Video Interstitial + - [Native](info/ios-in-app-bidding-native-guidelines-info.md) + - Rich media and MRAID 3.0 support + - Rewarded Video + - Outstream Video +- **Open Measurement Support.** +- **Direct SDK integration**. Allows you to pass first-party app data, + user data, device data, and location data. +- **Privacy Regulation Compliance**. The In-App Bidding SDK meets **GDPR**, **CCPA**, **COPPA** requirements according to the IAB specifications. +- **App targeting campaigns**. With the [support of deeplink+](info/ios-sdk-deeplinkplus.md) SDK is able to manage the ads with premium UX for retargeting campaigns. +- **Targeting**. Use [custom ad parameters](info/ios-sdk-parameters.md) to increase the chance to win an impression and to improve ad views' UX. +- **Tracking of render impression**. Prebid Rendering Module tracks [render impressions](info/ios-sdk-impression-tracking.md) according to the IAB Measurement Guidelines for all managed ads. Ads rendered by Primary Ad Server SDK track an impression beacon according to the internal algorithms. +- **Fast and seamless integration.** \ No newline at end of file diff --git a/PrebidMobile/Rendering/Documentation/info/integration-gam/ios-in-app-bidding-gam-info.md b/PrebidMobile/Rendering/Documentation/info/integration-gam/ios-in-app-bidding-gam-info.md new file mode 100644 index 000000000..6b6493ccd --- /dev/null +++ b/PrebidMobile/Rendering/Documentation/info/integration-gam/ios-in-app-bidding-gam-info.md @@ -0,0 +1,285 @@ +# Google Ad Manager Integration + +The integration of Prebid Rendering Module with Google Ad Manager (GAM) assumes that publisher has an account on GAM and has already integrated the Google Mobile Ads SDK (GMA SDK) into the app project. + +If you do not have GAM SDK in the app yet, refer the the [Google Integration Documentation](https://developers.google.com/ad-manager/mobile-ads-sdk/ios/quick-start). + +## GAM Integration Overview + +Pipeline Screenshot + +**Steps 1-2** Prebid Rendering Module makes a bid request. Prebid server runs an auction and returns the winning bid. + +**Step 3** Prebid Rendering Module via GAM Event Handler sets up the targeting keywords into the GAM's ad unit. + +**Step 4** GMA SDK makes an ad request. GAM returns the winner of the waterfall. + +**Step 5** Basing on the ad response Prebid GAM Event Handler decided who won on the GAM - the Prebid bid or another ad source on GAM. + +**Step 6** The winner is displayed in the App with the respective rendering engine. + + +Prebid Rendering Module supports these ad formats: + +- Display Banner +- Display Interstitial +- Native +- [Native Styles](ios-in-app-bidding-gam-native-integration.md) +- Video Interstitial +- Rewarded Video +- Outstream Video + +They can be integrated using these API categories. + +- [**Banner API**](#banner-api) - for *Display Banner* and *Outstream Video* +- [**Interstitial API**](#interstitial-api) - for *Display* and *Video* Interstitials +- [**Rewarded API**](#rewarded-api) - for *Rewarded Video* +- [**Native API**](ios-in-app-bidding-gam-native-integration.md) - for *Native Ads* + + +## Init Prebid Rendering Module + +Add the following line to your project’s podfile and install the pod: + +``` +pod 'prebid-mobile-sdk-rendering' +``` + +Provide an **Account Id** of your organization on Prebid server: + +``` +PrebidRenderingConfig.shared.accountID = YOUR_ACCOUNT_ID +PrebidRenderingConfig.shared.bidServerHost = HOST +``` + +The best place to do it is the `application:didFinishLaunchingWithOptions` method. + +> **NOTE:** The account ID is an identifier of the **Stored Request**. + +### Event Handlers + +GAM Event Handlers is a set of classes that wrap the GAM Ad Units and manage them respectively to the In-App Bidding flow. These classes are provided in the form of framework that could be added to the app via CocoaPods: + +``` +pod 'prebid-mobile-sdk-gam-event-handlers' +``` + +## Banner API + +To integrate a banner ad you have to implement three easy steps: + + +``` swift +// 1. Create an Event Handler +let eventHandler = PBMBannerEventHandler(adUnitID: GAM_AD_UNIT_ID, + validGADAdSizes: [NSValueFromGADAdSize(adSize)]) + +// 2. Create a Banner View +let banner = BannerView(configId: CONFIG_ID, + eventHandler: eventHandler) +banner.delegate = self + +addBannerToUI(banner: banner) + +// 3. Load an Ad +banner.loadAd() +``` + +#### Step 1: Create Event Handler + +GAM event handlers are special containers that wrap GAM Ad Views and help to manage collaboration between GAM and Prebid views. + +**Important:** you should create and use a unique event handler for each ad view. + +To create the event handler you should provide a GAM Ad Unit Id and the list of available sizes for this ad unit. + + +#### Step 2: Create Ad View + +**BannerView** - is a view that will display the particular ad. It should be added to the UI. To create it you should provide: + +- **configId** - an ID of Stored Impression on the Prebid server +- **eventHandler** - the instance of the banner event handler + +Also, you should add the instance of `BannerView` to the UI. + +#### Step 3: Load the Ad + +Simply call the `loadAd()` method to start the [In-App Bidding](../ios-in-app-bidding-getting-started.md) flow. Prebid Rendering Module will start the bidding process right away. + +### Outstream Video + +For **Outstream Video** you also need to specify the kind of expected ad: + +``` swift +banner.adFormat = .video +``` + +And all the rest code will be the same as for integration of display banner. + + +## Interstitial API + +To integrate interstitial ad you need to implement four easy steps: + + +``` swift +// 1. Create Event Handler +let eventHandler = GAMInterstitialEventHandler(adUnitID: GAM_AD_UNIT_ID) + +// 2. Create Interstitial Ad Unit +interstitial = InterstitialAdUnit(configId: CONFIG_ID, + minSizePercentage: CGSize(width: 30, height: 30), + eventHandler: eventHandler) + +interstitial.delegate = self + +// 3. Load an Ad +interstitial.loadAd() + +/// ....... + +// 4. Show Ad +if interstitial.isReady { + interstitial.show(from: self) +} + +``` + +The way of displaying **Video Interstitial Ad** is almost the same with two differences: + +- Need to customize the ad unit kind +- No need to set up `minSizePercentage` + +``` swift + // 1. Create Event Handler +let eventHandler = GAMInterstitialEventHandler(adUnitID: GAM_AD_UNIT_ID) + +// 2. Create Interstitial Ad Unit +interstitial = InterstitialAdUnit(configId: CONFIG_ID, + eventHandler: eventHandler) + +interstitial.adFormat = .video +interstitial.delegate = self + +// 3. Load an Ad +interstitial.loadAd() + +/// ....... + +// 4. Show Ad +if interstitial.isReady { + interstitial.show(from: self) +} + +``` + + +#### Step 1: Create Event Handler + +GAM's event handlers are special containers that wrap the GAM Ad Views and help to manage collaboration between GAM and Prebid views. + +**Important:** you should create and use a unique event handler for each ad view. + +To create an event handler you should provide a GAM Ad Unit. + +#### Step 2: Create Interstitial Ad Unit + +**InterstitialAdUnit** - is an object that will load and display the particular ad. To create it you should provide: + +- **configId** - an ID of Stored Impression on the Prebid server +- **minSizePercentage** - specifies the minimum width and height percent an ad may occupy of a device’s real estate. +- **eventHandler** - the instance of the interstitial event handler + +> **NOTE:** minSizePercentage - plays an important role in a bidding process for display ads. If provided space is not enough demand partners won't respond with the bids. + + +#### Step 3: Load the Ad + +Simply call the `loadAd()` method to start [In-App Bidding](../ios-in-app-bidding-getting-started.md) flow. The ad unit will load an ad and will wait for explicit instructions to display the Interstitial Ad. + + +#### Step 4: Show the Ad when it is ready + +``` swift +// MARK: PBMInterstitialAdUnitDelegate + +func interstitialDidReceiveAd(_ interstitial: InterstitialAdUnit) { + // Now the ad is ready for display +} +``` + +## Rewarded API + +To display an Rewarded Ad need to implement four easy steps: + + +``` swift + // 1. Create an Event Handler +let eventHandler = GAMRewardedEventHandler(adUnitID: GAM_AD_UNIT_ID) + +// 2. Create an Ad Unit +rewardedAd = RewardedAdUnit(configId: CONFIG_ID, + eventHandler: eventHandler) + +rewardedAd.delegate = self + +// 3. Load an Ad +rewardedAd.loadAd() + +/// ....... + +// 4. Display Ad +if rewardedAd.isReady { + rewardedAd.show(from: self) +} + +``` + +The way of displaying the **Rewarded Ad** is totally the same as for the Interstitial Ad. + + +To be notified when user earns a reward - implement the method of `PBMRewardedAdUnitDelegate`: + +``` swift +- (void)rewardedAdUserDidEarnReward:(RewardedAdUnit *)rewardedAd; +``` + +The actual reward object is stored in the `RewardedAdUnit`: + +``` +if let reward = rewardedAd.reward as? GADAdReward { + // ... +} +``` + +#### Step 1: Create Event Handler + +GAM's event handlers are special containers that wrap the GAM Ad Views and help to manage collaboration between GAM and Prebid views. + +**Important:** you should create and use a unique event handler for each ad view. + +To create an event handler you should provide a GAM Ad Unit. + + +#### Step 2: Create Rewarded Ad Unit + +**RewardedAdUnit** - is an object that will load and display the particular ad. To create it you should provide: + +- **configId** - an ID of Stored Impression on the Prebid server +- **eventHandler** - the instance of rewarded event handler + +#### Step 3: Load the Ad + +Simply call the `loadAd()` method to start [In-App Bidding](../ios-in-app-bidding-getting-started.md) flow. The ad unit will load an ad and will wait for explicit instructions to display the Interstitial Ad. + + +#### Step 4: Show the Ad when it is ready + +``` swift +// MARK: PBMRewardedAdUnitDelegate + +func rewardedAdDidReceiveAd(_ rewardedAd: RewardedAdUnit) { + // Now the ad is ready for display +} +``` diff --git a/PrebidMobile/Rendering/Documentation/info/integration-gam/ios-in-app-bidding-gam-native-integration.md b/PrebidMobile/Rendering/Documentation/info/integration-gam/ios-in-app-bidding-gam-native-integration.md new file mode 100644 index 000000000..7b524dd8e --- /dev/null +++ b/PrebidMobile/Rendering/Documentation/info/integration-gam/ios-in-app-bidding-gam-native-integration.md @@ -0,0 +1,144 @@ +# GAM: Native Ads Integration + +## Unified Native Ads + +The general integration scenario requires these steps from publishers: + +1. Prepare the ad layout. +2. Create Native Ad Unit and appropriate GAM ad loader. +3. Configure the Native Ad unit using [NativeAdConfiguration](../native/ios-native-ad-configuration.md). + * Provide the list of **[Native Assets](../ios-in-app-bidding-native-guidelines-info.md#components)** representing the ad's structure. + * Tune other general properties of the ad. +4. Make a bid request. +5. Prepare publisherAdRequest using `GamUtils.prepare` +6. After receiving response from GAM - check if prebid has won and find native ad using `GamUtils` +7. Bind the winner data from the native ad response with the layout. + +``` swift +func loadAd() { + guard let nativeAdConfig = nativeAdConfig else { + return + } + adUnit = NativeAdUnit(configID: prebidConfigId, nativeAdConfiguration: nativeAdConfig) + + if let adUnitContext = AppConfiguration.shared.adUnitContext { + for dataPair in adUnitContext { + adUnit?.addContextData(dataPair.value, forKey: dataPair.key) + } + } + + adUnit?.fetchDemand { [weak self] demandResponseInfo in + guard let self = self else { + return + } + let dfpRequest = GAMRequest() + GAMUtils.shared.prepareRequest(dfpRequest, demandResponseInfo: demandResponseInfo) + + self.adLoader = GADAdLoader(adUnitID: self.gamAdUnitId, + rootViewController: self.rootController, + adTypes: self.adTypes, + options: []) + self.adLoader?.delegate = self + self.adLoader?.load(dfpRequest) + } +} +``` + +Example of handling NativeAd response (the same applies to Custom): + +``` swift +GAMUtils.shared.findNativeAd(for: nativeAd, nativeAdDetectionListener: nativeAdDetectionListener) +``` + +## Native Styles + +[See Google Ad Manager Integration page](ios-in-app-bidding-gam-info.md) for more info about GAM order setup and GAM Event Handler integration. + +To integrate a banner ad you need to implement three easy steps: + +``` swift +// 1. Create an Event Handler +let eventHandler = PBMBannerEventHandler(adUnitID: GAM_AD_UNIT_ID, + validGADAdSizes: [NSValueFromGADAdSize(adSize)]) + +// 2. Create a Banner View +let banner = BannerView(configId: CONFIG_ID, + eventHandler: eventHandler) +banner.delegate = self + +// 3. Setup Native Ad Configuration +banner.nativeAdConfig = NativeAdConfiguration(testConfigWithAssets: assets) + +// 4. Load an Ad +banner.loadAd() +``` + + +#### Step 1: Create Event Handler + +GAM's event handlers are special containers that wrap GAM Ad Views and help to manage collaboration between GAM and Prebid views. + +**Important:** you should create and use a unique event handler for each ad view. + +To create the event handler you should provide a GAM Ad Unit Id and the list of available sizes for this ad unit. + + +#### Step 2: Create Ad View + +**BannerView** - is a view that will display the particular ad. It should be added to the UI. To create it you should provide: + +- **configId** - an ID of Stored Impression on the Prebid server +- **eventHandler** - the instance of the banner event handler + +Also, you should add the instance of `BannerView` to the UI. + +#### Step 3: Create and provide Native Assets + +The make a proper bid request publishers should provide the needed assets to the NativeAdConfiguration class. Each asset describes the UI element of the ad according to the [OpenRTB standarts](https://www.iab.com/wp-content/uploads/2018/03/OpenRTB-Native-Ads-Specification-Final-1.2.pdf). + +``` swift +let assets = [ + { + let title = NativeAssetTitle(length: 90) + title.required = true + return title + }(), + { + let icon = NativeAssetImage() + icon.widthMin = 50 + icon.heightMin = 50 + icon.required = true + icon.imageType = NSNumber(value: PBMImageAssetType.icon.rawValue) + return icon + }(), + { + let image = NativeAssetImage() + image.widthMin = 150 + image.heightMin = 50 + image.required = true + image.imageType = NSNumber(value: PBMImageAssetType.main.rawValue) + return image + }(), + { + let desc = NativeAssetData(dataType: .desc) + desc.required = true + return desc + }(), + { + let cta = NativeAssetData(dataType: .ctaText) + cta.required = true + return cta + }(), + { + let sponsored = NativeAssetData(dataType: .sponsored) + sponsored.required = true + return sponsored + }(), +] +``` + +See the full description of NativeAdConfiguration options [here](../native/ios-native-ad-configuration.md). + +#### Step 4: Load the Ad + +Simply call the `loadAd()` method to start [In-App Bidding](../ios-in-app-bidding-getting-started.md) flow. \ No newline at end of file diff --git a/PrebidMobile/Rendering/Documentation/info/integration-gam/ios-in-app-bidding-gam-order-setup.md b/PrebidMobile/Rendering/Documentation/info/integration-gam/ios-in-app-bidding-gam-order-setup.md new file mode 100644 index 000000000..5035c0a25 --- /dev/null +++ b/PrebidMobile/Rendering/Documentation/info/integration-gam/ios-in-app-bidding-gam-order-setup.md @@ -0,0 +1,189 @@ +# Google Ad Manager Setup + +### Step 1: Create New Order + + Pipeline Screenshot + +### Step 2: Create Line Item + +To integrate the In-App Bidding into the app you have to create a Line Item with a specific price and targeting keyword. + +> Even though a Line Item can be named in any way, we strongly recommend to use the price or targeting keyword in the name. It will help to navigate through hundreds of them. + +#### Select Type + +Create a Line Item depending on the type of expected creative kind: + +* **Display** - for the Banner, HTML Interstitial and Native ads +* **Video and Audio** - for the Video Interstitial, Rewarded Video, and Outstream Video ads. + +Pipeline Screenshot + +Set sizes respectively to expected creatives. + +#### Select Price + +The Line Item price should be chosen according to the price granularity policy. + +Pipeline Screenshot + +#### Set Targeting Keywords + +The **Custom targeting** property should contain a special keyword with the price of winning bid. The same as a Rate of the Line Item. + +Pipeline Screenshot + +### Step 3: Prepare Prebid Creative + + +#### Display Banner, Display Interstitial, Video Interstitial, Outstream Video. + + +The In-App Bidding Facade for GAM is based on [App Events](https://developers.google.com/ad-manager/mobile-ads-sdk/ios/banner#app_events) feature almost for all kinds of ads. That means that creative should contain a special tag that will be processed by GAM Event Handlers. + +If GAM Event Handler receives the `PrebidAppEvent` event it will render the winning bid. Otherwise the control will be passed to the GAM ad view and it will render the received creative. + +``` js + + +``` + +Pipeline Screenshot + + +#### Rewarded Video + +In-App Bidding facade for Rewarded video ads is based on [GADRewardedAdMetadataDelegate](https://developers.google.com/admob/ios/api/reference/Protocols/GADRewardedAdMetadataDelegate). So you need to set up a special VAST tag in the creative. + +``` js +https://sdk.prod.gcp.openx.org/ads/inapp_bidding/gam_rewarded.xml +``` + +Pipeline Screenshot + +If GAM Event Handler receives the tag's info it will render the winning bid. Otherwise the control will be passed to the GAM ad view and it will render the received creative. + +#### Native: Unified Ad + +Click on **ADD CREATIVE** -> **New Creative** -> **Native Format** -> **Select Template...** and chose one of the predefined system templates. + +Fill the template with any default values but put the **obligotary** value for the Body - **isPrebid**. This value will show Prebid SDK that it should render the ad from the winning bid. + +Create Native Ad Screenshot + +#### Native: Custom Template + +First need to create custom Native Format. For this go to **Delivery** -> **Native** -> **Create Native Ad** -> **Android & iOS app code**. At the page for the new ad format click on **ADD VARIABLE** and create a special text entry with name **isPrebid** and default value **1**. + +Create Native Ad Screenshot + +This variable will show Prebid SDK that it should render the ad from the winning bid. The final custom format should look like this: + +Create Native Ad Screenshot + +Now need to create a Creative based on this Native Ad Format. Click on **ADD CREATIVE** -> **New Creative** -> **Native Format** -> **Select Template...** and choose the newly created format. + +Fill all needed fields for the new creative and make sure that variable **isPrebid** is present in the form: + +Create Native Ad Screenshot + + +#### Native Styles + +##### Step 1: Create a native ad + +Go to `Google Ad Manager`, select `Delivery` > `Native`. Click `Create Native Ad`. + +Create Native Ad Screenshot + +Select the `HTML & CSS editor` option. + +Ways to create Native Ad Screenshot + + +##### Step 2: Define ad settings + +For Ad size you can specify a specific size for the ad unit or specify the `fluid` size. + +Define Native Ad settings Screenshot + +##### Step 3: Style your native ad + +You can add HTML and CSS to define your native ad template. + +Style Native Ad Screenshot + +Example HTML: + +``` html + + + +``` + +Example CSS: + +``` css +.sponsored-post { + background-color: #fffdeb; + font-family: sans-serif; +} + +.content { + overflow: hidden; +} + +.thumbnail { + width: 50px; + height: 50px; + float: left; + margin: 0 20px 10px 0; + background-size: cover; +} + +h1 { + font-size: 18px; + margin: 0; +} + +a { + color: #0086b3; + text-decoration: none; +} + +p { + font-size: 16px; + color: #000; + margin: 10px 0 10px 0; +} + +.attribution { + color: #000; + font-size: 9px; + font-weight: bold; + display: inline-block; + letter-spacing: 2px; + background-color: #ffd724; + border-radius: 2px; + padding: 4px; +} +``` + + diff --git a/PrebidMobile/Rendering/Documentation/info/integration-mopub/ios-in-app-bidding-mopub-info.md b/PrebidMobile/Rendering/Documentation/info/integration-mopub/ios-in-app-bidding-mopub-info.md new file mode 100644 index 000000000..8f89cb21f --- /dev/null +++ b/PrebidMobile/Rendering/Documentation/info/integration-mopub/ios-in-app-bidding-mopub-info.md @@ -0,0 +1,265 @@ +# MoPub Integration + +The integration of Prebid Rendering Module with MoPub assumes that publisher has an account on MoPub and has already integrated the MoPub SDK into the app project. + +If you do not have MoPub SDK in the app yet, refer the [MoPub's Documentation](https://github.com/mopub/mopub-ios-sdk). + +⚠️⚠️⚠️ **WARNING**: MoPub Adapters for the Prebid Rendering Module are compatible with **MoPub 5.13** and above. The ads won't be shown with earlier versions of MoPub SDK. + +## MoPub Integration Overview + +The integration of header bidding into MoPub monetization is based on MoPub's Mediation feature. + +Pipeline Screenshot + +**Steps 1-2** Prebid Rendering Module makes a bid request. Prebid server runs an auction and returns the winning bid to the SDK. + +**Step 3** Prebid Rendering Module via MoPub Adapters Framework sets up targeting keywords into the MoPub's ad unit. + +**Step 4** MoPub SDK makes an ad request. MoPub returns the winner of the waterfall. + +**Step 5** If Prebid's creative won then the MoPub SDK will instantiate respective Prebid Adapter which will render the winning bid. + +**Step 6** The winner is displayed in the App with the respective rendering engine. + +Prebid Rendering Module provides ability to integrate header bidding for these ad kinds: + +- Display Banner +- Display Interstitial +- Native +- [Native Styles](../integration-mopub/ios-in-app-bidding-mopub-native-integration.md) +- Video Interstitial +- Rewarded Video + +They can be integrated using these API categories. + +- [**Banner API**](#banner-api) - for **Display Banner** +- [**Interstitial API**](#interstitial-api) - for **Display** and **Video** Interstitials +- [**Rewarded API**](#rewarded-api) - for **Rewarded Video** +- [**Native API**](ios-in-app-bidding-mopub-native-integration.md) + + +## Init Prebid Rendering Module + +Add the following line to your project’s podfile and install the pod: + +``` +pod 'prebid-mobile-sdk-rendering' +``` + +Provide an **Account Id** of your organization on Prebid server: + +``` +PrebidRenderingConfig.shared.accountID = YOUR_ACCOUNT_ID +PrebidRenderingConfig.shared.bidServerHost = HOST +``` + +The best place to do it is the `application:didFinishLaunchingWithOptions` method. + + +The account ID is an identifier of the **Stored Request**. + +### Prebid Adapters + +Adapters for Prebid Rendering Module are classes that serve like proxies between MoPub SDK and any other one. For more details about Mediation and Adapters read the [MoPub's Documentation](https://developers.mopub.com/networks/integrate/mopub-network-mediation-guidelines/). + +The framework could be added to the app via CocoaPods: + +``` +pod 'prebid-mobile-sdk-mopub-adapters' +``` + +## Banner API + +To display an ad you need to implement three easy steps: + +``` swift +// 1. Create an AdView +banner = MPAdView(adUnitId: MOPUB_AD_UNIT_ID) +banner.delegate = self + +// 2. Create an In-App Bidding Ad Unit +adUnit = MoPubBannerAdUnit(configId: CONFIG_ID, size: adSize) + +// 3. Run an Header Bidding auction on Prebid +adUnit.fetchDemand(with: banner!) { [weak self] result in + + // 4. Load an Ad + self?.banner.loadAd() +} +``` + +#### Step 1: Create Ad View + +In the scenario with MoPub integration the MoPub's SDK plays the central role in managing ad views in the application's UI. You have to create and place MoPub's Ad View into the app page. If a winning bid on Prebid wins in the MoPub waterfall it will be rendered via Mediation in the place of original MoPub's Ad View by Prebid Rendering Module. + +#### Step 2: Create Ad Unit + +Create the **MoPubBannerAdUnit** object with parameters: + +- **configId** - an ID of Stored Impression on the Prebid server +- **size** - the size of the ad unit which will be used in the bid request. + +#### Step 3: Fetch Demand + +To run an auction on Prebid run the `fetchDemand()` method which performs several actions: + +- Makes a bid request to Prebid +- Sets up the targeting keywords to the MoPub's ad unit +- Passes the winning bid to the MoPub's ad unit +- Returns the result of bid request for future processing + +#### Step 4: Load the Ad + +When the bid request has completed, the responsibility of making the Ad Request is passed to the publisher. That is why you have to invoke `loadAd()` on the MoPub's Ad View explicitly in the completion handler of `fetchDemand()`. + +#### Step 5: Rendering + +If the Prebid bid wins on MoPub it will be rendered by `PrebidBannerAdapter`. You don't have to do anything for this. Just make sure that your order had been set up correctly and an adapter is added. + +## Interstitial API + +To display an ad you need to implement these easy steps: + +``` swift +// 1. Create an MoPub's Interstitial Controller +interstitialController = MPInterstitialAdController.init(forAdUnitId: MOPUB_AD_UNIT_ID) +interstitialController.delegate = self + +// 2. Create an In-App Bidding Interstitial Ad Unit +interstitialAdUnit = MoPubInterstitialAdUnit(configId: CONFIG_ID, + minSizePercentage: CGSize(width: 30, height: 30)) + +// 3. Run an Header Bidding auction on Prebid +interstitialAdUnit.fetchDemand(with: interstitialController!) { [weak self] result in + + // 4. Load an Ad + self?.interstitialController.loadAd() +} + +// ..... + +// 5. Show the ad +if interstitialController.ready { + interstitialController.show(from: self) +} +``` + +The way of displaying **Video Interstitial Ad** is almost the same with two differences: + +- Need customize the ad unit kind +- No need to set up `minSizePercentage` + +``` swift +// 1. Create an MoPub's Interstitial Controller +interstitialController = MPInterstitialAdController.init(forAdUnitId: MOPUB_AD_UNIT_ID) +interstitialController.delegate = self + +// 2. Create an In-App Bidding Interstitial Ad Unit +interstitialAdUnit = MoPubInterstitialAdUnit(configId: CONFIG_ID, + minSizePercentage: CGSize(width: 30, height: 30)) +interstitialAdUnit.adFormat = .video + +// 3. Run an Header Bidding auction on Prebid +interstitialAdUnit.fetchDemand(with: interstitialController!) { [weak self] result in + + // 4. Load an Ad + self?.interstitialController.loadAd() +} +// ..... + +// 5. Show the ad +if interstitialController.ready { + interstitialController?.show(from: self) +} +``` + +#### Step 1: Create Ad View + +In the scenario with MoPub integration the MoPub SDK plays the central role in managing ad views in the application's UI. If a winning bid on Prebid wins in the MoPub waterfall it will be rendered via Mediation by Prebid Rendering Module. + +#### Step 2: Create Ad Unit + +Create the **MoPubInterstitialAdUnit** object with parameters: + +- **configId** - an ID of Stored Impression on the Prebid server + +#### Step 3: Fetch Demand + +To run an auction on Prebid run the `fetchDemand()` method which performs several actions: + +- Makes a bid request to Prebid +- Sets up the targeting keywords to the MoPub's ad unit +- Passes the winning bid to the MoPub's ad unit +- Returns the result of bid request for future processing + +#### Step 4: Load the Ad + +When the bid request has been completed the responsibility of making the Ad Request is passed on the publisher. That is why you have to invoke the `loadAd()` on the MoPub Ad View explicitly in the completion handler of the `fetchDemand()`. + +#### Step 5: Rendering + +If the Prebid bid wins on MoPub it will be rendered by `OXAMoPubInterstitialAdapter`. You do not have to do anything for this. Just make sure that your order had been set up correctly and an adapter is added to the application target in the Xcode project + +However, due to the expiration, the ad could become invalid with time. So it is always useful to check it with `interstitialController?.isReady` before display. + +## Rewarded API + +To display an ad you need to implement these easy steps: + +``` swift +// 1. Create an In-App Bidding Interstitial Ad Unit +rewardedAdUnit = MoPubRewardedAdUnit(configId: CONFIG_ID) + +// 2. Run an Header Bidding auction on Prebid +let bidInfoWrapper = MoPubBidInfoWrapper() +rewardedAdUnit.fetchDemand(with: bidInfoWrapper) { [weak self] result in + guard let self = self else { + return + } + + // 3. Load an Ad + MPRewardedVideo.setDelegate(self, forAdUnitId: self.MOPUB_AD_UNIT_ID) + MPRewardedVideo.loadAd(withAdUnitID: self.MOPUB_AD_UNIT_ID, + keywords: bidInfoWrapper.keywords as String?, + userDataKeywords: nil, + customerId: "testCustomerId", + mediationSettings: [], + localExtras: bidInfoWrapper.localExtras) +} + +/// ....... + +// 4. Try to Display an Ad +if MPRewardedVideo.hasAdAvailable(forAdUnitID: MOPUB_AD_UNIT_ID) { + let rewards = MPRewardedVideo.availableRewards(forAdUnitID: MOPUB_AD_UNIT_ID) + guard let reward = rewards?.first as? MPRewardedVideoReward else { + return + } + + // 5. Present Ad + MPRewardedVideo.presentAd(forAdUnitID: MOPUB_AD_UNIT_ID, from: self, with: reward, customData: nil) +} +``` + +#### Step 1: Create an Rewarded Ad Unit + +Create the **RewardedAdUnit** object with parameter: + +- **configId** - an ID of Stored Impression on the Prebid server + +#### Step 2: Fetch Demand + +To run an auction on Prebid run the `fetchDemand()` method which does several things: + +- Makes a bid request to Prebid server +- Sets up the targeting keywords to auxiliary class `MoPubBidInfoWrapper` +- Returns the result of bid request for future processing + +#### Step 3: Load the Ad + +When the bid request has completed, the responsibility of making the Ad Request is passed to the publisher. That is why you have to invoke the `loadAd()` of the MoPub's Ad View explicitly in the completion handler of the `fetchDemand()`. + +#### Step 5: Present the Rewarded Ad + +If the Prebid bid wins on MoPub it will be rendered by `OXAMoPubRewardedVideoAdapter`. You do not have to do anything for this. Just make sure that your order had been set up correctly and an adapter is added to the application target in the Xcode project diff --git a/PrebidMobile/Rendering/Documentation/info/integration-mopub/ios-in-app-bidding-mopub-native-integration.md b/PrebidMobile/Rendering/Documentation/info/integration-mopub/ios-in-app-bidding-mopub-native-integration.md new file mode 100644 index 000000000..f5264572a --- /dev/null +++ b/PrebidMobile/Rendering/Documentation/info/integration-mopub/ios-in-app-bidding-mopub-native-integration.md @@ -0,0 +1,104 @@ +# MoPub: Native Ads Integration + +## Native Ads + +TODO Add content + +## Native Styles + +[See MoPub Integration page](../integration-mopub/ios-in-app-bidding-mopub-info.md) for more info about MoPub order setup and Adapter integration. + +To display an ad you need to implement these easy steps: + +``` swift +// 1. Create a MoPub AdView +banner = MPAdView(adUnitId: MOPUB_AD_UNIT_ID) +banner.delegate = self + +// 2. Create an Prebid Ad Unit +adUnit = MoPubBannerAdUnit(configId: CONFIG_ID, size: adSize) + +// 3. Provide NativeAdConfiguration +adUnit.nativeAdConfig = NativeAdConfiguration(testConfigWithAssets: assets) + +// 4. Run a Header Bidding auction on Prebid +adUnit.fetchDemand(with: banner!) { [weak self] result in + + // 5. Load an Ad + self?.banner.loadAd() +} +``` + +#### Step 1: Create Ad View + +You have to create and place MoPub's Ad View into the app page. + + +#### Step 2: Create Ad Unit + +Create the **MoPubBannerAdUnit** object with parameters: + +- **configId** - an ID of Stored Impression on the Prebid server +- **size** - the size of the ad unit which will be used in the bid request. + + +#### Step 3: Create and provide Native Assets + +To make a proper bid request publishers should provide the needed assets to the NativeAdConfiguration class. Each asset describes the UI element of the ad according to the [OpenRTB standarts](https://www.iab.com/wp-content/uploads/2018/03/OpenRTB-Native-Ads-Specification-Final-1.2.pdf). + +``` swift +let assets = [ + { + let title = NativeAssetTitle(length: 90) + title.required = true + return title + }(), + { + let icon = NativeAssetImage() + icon.widthMin = 50 + icon.heightMin = 50 + icon.required = true + icon.imageType = NSNumber(value: PBMImageAssetType.icon.rawValue) + return icon + }(), + { + let image = NativeAssetImage() + image.widthMin = 150 + image.heightMin = 50 + image.required = true + image.imageType = NSNumber(value: PBMImageAssetType.main.rawValue) + return image + }(), + { + let desc = NativeAssetData(dataType: .desc) + desc.required = true + return desc + }(), + { + let cta = NativeAssetData(dataType: .ctaText) + cta.required = true + return cta + }(), + { + let sponsored = NativeAssetData(dataType: .sponsored) + sponsored.required = true + return sponsored + }(), +] +``` + +See more NativeAdConfiguration options [here](../native/ios-native-ad-configuration.md). + +### Step 4: Fetch Demand + +To run an auction on Prebid run the `fetchDemand()` method which performs several actions: + +- Makes a bid request to Prebid +- Sets up the targeting keywords to the MoPub's ad unit +- Passes the winning bid to the MoPub's ad unit +- Returns the result of bid request for future processing + +### Step 5: Load the Ad + +When the bid request has completed, the responsibility of making the Ad Request is passed to the publisher. That is why you have to invoke `loadAd()` on the MoPub's Ad View explicitly in the completion handler of `fetchDemand()`. + diff --git a/PrebidMobile/Rendering/Documentation/info/integration-mopub/ios-in-app-bidding-mopub-order-setup.md b/PrebidMobile/Rendering/Documentation/info/integration-mopub/ios-in-app-bidding-mopub-order-setup.md new file mode 100644 index 000000000..b8be72208 --- /dev/null +++ b/PrebidMobile/Rendering/Documentation/info/integration-mopub/ios-in-app-bidding-mopub-order-setup.md @@ -0,0 +1,85 @@ +# MoPub Setup + +## Order Setup + +### Step 1: Create New Order + + Pipeline Screenshot + +### Step 2: Create Line Item + +#### Line Item: Display, Video + +To integrate the In-App Bidding into your app you have to create a Custom Ad Network Line Item with a specific Targeting keyword. Note that `Custom Ad Network` type is not suitable for Native Style Ads, see [Native Style Line Item and creative](#line-item-native) for more details. + +Regardless of the ability to name a Line Item in any way we strongly suggest using the price or targeting keyword in the name. It will help you when you will create a hundred of them. + +- **Line Item Name**: hb_pb 0.10 +- **Type & Priority**: Network Line Item +- **Network**: Custom SDK network +- **Custom event class**: + - For Banner API: **PBMMoPubBannerAdapter** + - For Interstitial API: **PBMMoPubInterstitialAdapter** + - For Rewarded API: **PBMMoPubRewardedVideoAdapter** + - For Native API: ***PrebidMoPubNativeAdAdapter*** +- **Custom event data**: {} + +Pipeline Screenshot + +#### Line Item: Native + +If you integrate Native Ads not via mediation you should create regular line items + +Pipeline Screenshot + +After that you should create a custom Native creative with **obligatory** property **isPrebid** and value **1**. + +Pipeline Screenshot + +This property will show to the Rendering Module that it should render the ad from the winning bid. + +#### Line Item: Native Style + +Native styles ads are using `non-guaranteed` line item type and Medium Rectangle format HTML creative. + +Pipeline Screenshot + +MoPub 300x250 Medium Rectangle format HTML creative example: + +Pipeline Screenshot + +**The sample of Native Styles Creative:** + +``` html + + + +``` + +#### Ad Unit Targeting + +Pipeline Screenshot + +#### Audience Targeting + +The **Keyword targeting** property should contain a special keyword with the price of winning bid. + +Pipeline Screenshot + + diff --git a/PrebidMobile/Rendering/Documentation/info/integration-prebid/ios-in-app-bidding-pb-info.md b/PrebidMobile/Rendering/Documentation/info/integration-prebid/ios-in-app-bidding-pb-info.md new file mode 100644 index 000000000..231ebc68d --- /dev/null +++ b/PrebidMobile/Rendering/Documentation/info/integration-prebid/ios-in-app-bidding-pb-info.md @@ -0,0 +1,206 @@ +# Pure In-App Bidding Integration + +## Table of Contents + +- [Mobile API](#mobile-api) +- [Banner](#banner-api) +- [Interstitial](#interstitial-api) +- [Rewarded](#rewarded-api) + +## Mobile API + +The [Integration](../../README.md) of Pure In-App Bidding is similar to the integration of any other regular Ad SDK. + +Pipeline Screenshot + + +Prebid Rendering Module provides ability to integrate these ad formats: + +- Display Banner +- Display Interstitial +- Video Interstitial +- Rewarded Video +- Outstream Video +- [Native Styles](ios-in-app-bidding-prebid-native-integration.md) + +However, the Rendering Module provides only three kinds of API classes for these ads: + +- **Banner API** - for **Display Banner** +- **Interstitial API** - for **Display** and **Video** Interstitials +- **Rewarded API** - for **Rewarded Video** + +### Banner API + +To display an ad you need to implement three easy steps: + + +``` swift +// 1. Create an Ad View +let banner = BannerView(frame: CGRect(origin: .zero, size: adSize), + configId: CONFIG_ID, + adSize: adSize) + +banner.delegate = self + +// 2. Load an Ad +banner.loadAd() +``` + +#### Step 1: Create Ad View + +In the Pure In-App Bidding scenario you just need to initialize the Banner Ad View with correct properties: + +- **frame** - the frame rectangle for the view +- **configId** - an ID of Stored Impression on the Prebid server +- **size** - the size of the ad unit which will be used in the bid request. + +#### Step 2: Load the Ad + +Simply call `loadAd()` and SDK will: + +- make a bid request to Prebid server. +- render the winning bid on display. + +#### Outstream Video + +For **Outstream Video** you also need to specify the kind of expected ad: + +``` swift +banner.adFormat = .video +``` + +### Interstitial API + +To display an ad you need to implement these easy steps: + + +``` swift +// 1. Create an Interstitial Ad Unit +interstitial = InterstitialAdUnit(configId: CONFIG_ID, + minSizePercentage: CGSize(width: 30, height: 30)) + +interstitial.delegate = self + +// 2. Load an Ad +interstitial.loadAd() + +// ..... + +// 3. Show An Ad +if interstitial.isReady { + interstitial.show(from: self) +} + +``` + +The way of displaying **Video Interstitial Ad** is almost the same with two differences: + +- Need customize the ad unit kind +- No need to set up `minSizePercentage` + +``` swift + +// 1. Create an Interstitial Ad Unit +let interstitial = InterstitialAdUnit(configId: CONFIG_ID) + +interstitial.adFormat = .video +interstitial.delegate = self + +// 2. Load an Ad +interstitial.loadAd() + +// ..... + +// 3. Show An Ad +if interstitial.isReady { + interstitial.show(from: self) +} + +``` + + +#### Step 1: Create an Ad Unit + + +In the Pure In-App Bidding scenario you just need to initialize the Banner Ad View with correct properties: + +- **configId** - an ID of Stored Impression on the Prebid server +- **minSizePercentage** - specifies the minimum width and height percent an ad may occupy of a device’s real estate. + +> **NOTE:** minSizePercentage - plays an important role in a bidding process for display ads. If provided space is not enough demand partners won't respond with the bids. + +#### Step 2: Load the Ad + +Simply call the `loadAd()` method to start [In-App Bidding](../ios-in-app-bidding-getting-started.md) flow. + + +#### Step 3: Show the Ad when it is ready + +``` swift +// MARK: PBMInterstitialAdUnitDelegate + +func interstitialDidReceiveAd(_ interstitial: InterstitialAdUnit) { + // Now the ad is ready for display +} +``` + +However, due to the expiration, the ad could become invalid with time. So it is always useful to check it with `interstitial?.isReady` before display. + + +### Rewarded API + +To display an ad you need to implement these easy steps: + + +``` swift +// 1. Create an Ad Unit +rewardedAd = RewardedAdUnit(configId: CONFIG_ID) +rewardedAd.delegate = self + +// 2. Load an Ad +rewardedAd.loadAd() + +/// ....... + +// 3. Display the Ad +if rewardedAd.isReady { + rewardedAd.show(from: self) +} +``` + +To be notified when a user earns a reward - implement the method of `PBMRewardedAdUnitDelegate`. Now this method will be called when the ad is completed. + +``` swift +func rewardedAdUserDidEarnReward(_ rewardedAd: RewardedAdUnit) { +} +``` + + +#### Step 1: Create Rewarded Ad Unit + +Create the **RewardedAdUnit** object with parameter: + +- **adUnitId** - an ID of Stored Impression on the Prebid server + +#### Step 2: Load the Ad + +Simply call the `loadAd()` method to start [In-App Bidding](../ios-in-app-bidding-getting-started.md) flow. + + +#### Step 3: Show the Ad when it is ready + +``` swift +// MARK: PBMRewardedAdUnitDelegate + +func rewardedAdDidReceiveAd(_ rewardedAd: RewardedAdUnit) { + // Now the ad is ready for display +} +``` + + + + + + + + diff --git a/PrebidMobile/Rendering/Documentation/info/integration-prebid/ios-in-app-bidding-prebid-native-integration.md b/PrebidMobile/Rendering/Documentation/info/integration-prebid/ios-in-app-bidding-prebid-native-integration.md new file mode 100644 index 000000000..fc97b4624 --- /dev/null +++ b/PrebidMobile/Rendering/Documentation/info/integration-prebid/ios-in-app-bidding-prebid-native-integration.md @@ -0,0 +1,134 @@ +# Native Ads Integration + +## Unified Native Ads + +The general integration scenario requires these steps from publishers: + +1. Prepare the ad layout. +2. Create Native Ad Unit. +3. Configure the Native Ad unit using [NativeAdConfiguration](../native/ios-native-ad-configuration.md). + * Provide the list of **[Native Assets](../ios-in-app-bidding-native-guidelines-info.md#components)** representing the ad's structure. + * Tune other general properties of the ad. +4. Make a bid request. +5. Extract NativeAd using `NativeUtils.findNativeAd` +7. Bind the data from the native ad with the layout. + +``` swift +TODO +``` + +## Native Styles + +[See Pure In-App Bidding Integration page](../integration-gam/ios-in-app-bidding-gam-info.md) for more details about SDK integration and supported ad types. + +To display an ad using Native Styles you'll need to implement these easy steps: + +``` swift +// 1. Create an Ad View +let banner = BannerView(configId: CONFIG_ID, + adSize: adSize) + +banner.delegate = self + +// 2. Set the Native Ad Configurations +let nativeAdConfig = NativeAdConfiguration(testConfigWithAssets: assets) +nativeAdConfig.nativeStylesCreative = nativeStylesCreative + +banner.nativeStylesCreative = nativeAdConfig + +// 3. Load an Ad +banner.loadAd() +``` + +#### Step 1: Create Ad View + +In the Pure In-App Bidding scenario you just need to initialize the Banner Ad View using correct properties: + +- **configId** - an ID of Stored Impression on the Apollo server. +- **size** - the size of the ad unit which will be used in the bid request. + + +**IMPORTANT:** + +You should add HTML and CSS to define your native ad template with universal creative and provide it via the nativeStylesCreative property of NativeAdConfiguration. + +#### Step 2: Create and provide Native Assets + +To make a proper bid request publishers should provide the needed assets to the NativeAdConfiguration class. Each asset describes the UI element of the ad according to the [OpenRTB standarts](https://www.iab.com/wp-content/uploads/2018/03/OpenRTB-Native-Ads-Specification-Final-1.2.pdf). + +``` swift +let assets = [ + { + let title = NativeAssetTitle(length: 90) + title.required = true + return title + }(), + { + let icon = NativeAssetImage() + icon.widthMin = 50 + icon.heightMin = 50 + icon.required = true + icon.imageType = NSNumber(value: PBMImageAssetType.icon.rawValue) + return icon + }(), + { + let image = NativeAssetImage() + image.widthMin = 150 + image.heightMin = 50 + image.required = true + image.imageType = NSNumber(value: PBMImageAssetType.main.rawValue) + return image + }(), + { + let desc = NativeAssetData(dataType: .desc) + desc.required = true + return desc + }(), + { + let cta = NativeAssetData(dataType: .ctaText) + cta.required = true + return cta + }(), + { + let sponsored = NativeAssetData(dataType: .sponsored) + sponsored.required = true + return sponsored + }(), +] +``` + +Native Styles creative example: + +``` html + + + +``` + + +See the full description of NativeAdConfiguration options [here](../native/ios-native-ad-configuration.md). + + +#### Step 3: Load the Ad + +Simply call `loadAd()` and SDK will: + +- make a bid request to Prebid server +- render the winning bid on display + + diff --git a/PrebidMobile/Rendering/Documentation/info/ios-in-app-bidding-getting-started.md b/PrebidMobile/Rendering/Documentation/info/ios-in-app-bidding-getting-started.md new file mode 100644 index 000000000..7b607ea83 --- /dev/null +++ b/PrebidMobile/Rendering/Documentation/info/ios-in-app-bidding-getting-started.md @@ -0,0 +1,80 @@ +# Getting started with In-App Bidding + +## Integration Scenarios + +There are two integration scenarios supported by Rendering Module. + +- **With Primary Ad Server** when the winning bid is rendered by Prebid SDK but other ads are rendered by Primary Ad Server SDK. +- **Pure In-App Bidding** when there is no Primary ad server and the winning bid is rendered right after an auction by Prebid SDK. + +Below you can find their description and select the most suitable for your application. + + +### Prebid Rendering Module with Primary Ad Server + +Pipeline Screenshot + +1. Prebid Rendering Module sends the bid request to the Prebid server. +2. Prebid server runs the header bidding auction among preconfigured demand partners. +3. Prebid Server responses with the winning bid that contains targeting keywords. +4. Prebid Rendering Module sets up the targeting keywords of the winning bid to the ad unit of Primary Ad Server SDK. +5. Primary Ad Server SDK sends the ad request to the primary Ad Server +6. Primary Ad Server responds with an ad +7. The info about the winning ad is passed to the Prebid Rendering Module +8. Depending on the ad response Prebid Rendering Module renders the winning bid or allows Primary Ad Server SDK to show its own winning ad. + +### Pure In-App Bidding + +Pipeline Screenshot + +1. Prebid Rendering Module sends the bid request to the Prebid server. +2. Prebid server runs the header bidding auction among preconfigured demand partners. +3. Prebid Server responses with the winning bid that contains targeting keywords. +4. Prebid Rendering Module renders the winning bid. + +## Supported Ad Formats + +Prebid Rendering Module supports next ad formats: + + - Display Banner + - Display Interstitial + - Video Interstitial + - Rewarded Video + - Outstream Video (for GAM and Pure In-App Bidding) + - Native Styles Ads + - Native Ads + +## Prebid Setup + +To start running header bidding auction you should have hosted Prebid Server with predefined auction configurations - **Stored Request** and **Stored Impression**. + +Before integrating the Prebid Rendering Module you will need next keys: + +- **Prebid Account ID** - an identifier of the **Stored Request**. +- **Configuration ID** - an identifier of the **Stored Impression** which contains information about bidders for a particular ad unit. You need as many ids as many different ad units you want to integrate. + +## Init Prebid Rendering Module + +Firstly import Rendering Module: + +``` +import PrebidMobileRenderingSdk +``` + +Then provide the **Prebid Account ID** of your organization. The best place to do it is the `application:didFinishLaunchingWithOptions` method. + +``` +PrebidRenderingConfig.shared.accountID = YOUR_ACCOUNT_ID +PrebidRenderingConfig.shared.bidServerHost = HOST +``` + +Now you are ready to integrate ad units. + + +## Integration Scenarios and Tips + +Depending on Primary Ad Server used, In-App Bidding SDK supports these kinds of integration: + +- With [Google Ad Manager (GAM)](integration-gam/ios-in-app-bidding-gam-info.md) as a Primary Ad Server +- With [MoPub](integration-mopub/ios-in-app-bidding-mopub-info.md) as a Primary Ad Server +- [Pure In-App Bidding](integration-prebid/ios-in-app-bidding-pb-info.md) as an integration without Primary Ad Server \ No newline at end of file diff --git a/PrebidMobile/Rendering/Documentation/info/ios-in-app-bidding-native-guidelines-info.md b/PrebidMobile/Rendering/Documentation/info/ios-in-app-bidding-native-guidelines-info.md new file mode 100644 index 000000000..fdea6d71f --- /dev/null +++ b/PrebidMobile/Rendering/Documentation/info/ios-in-app-bidding-native-guidelines-info.md @@ -0,0 +1,81 @@ +# Native Ads Guidelines + +## Getting Started + +Prebid Rendering Module implements the [OpenRTB Specification](https://www.iab.com/wp-content/uploads/2018/03/OpenRTB-Native-Ads-Specification-Final-1.2.pdf) for the native ads. + +The general integration scenario requires these steps from publishers: + +1. Prepare the ad layout: + * HTML and CSS for the Native Styles format. + * Native components for the Unified Ads format. +1. Configure the Native Ad using [NativeAdConfiguration](native/ios-native-ad-configuration.md). + * Provide the list of **[Native Assets](#components)** representing the ad's structure. + * Tune other general properties of the ad. +1. Make a bid request. +1. **OPTIONAL** Bind the data from the bid response with the layout, if it is needed for particular integration. + +### Native Styles + +Prebid Rendering Module supports the prebid's approach for rendering [native ads](https://docs.prebid.org/prebid-mobile/pbm-api/ios/pbm-nativeadunit-ios.html). It is similar to the Google's [Native Styles](#native-styles) ad format. In this case publisher should preare the layout of the ad using HTML and CSS and add the universal creative to the ad code. + +Pipeline Screenshot + +1. Prebid Rendering Module sends the bid request. +2. Prebid server runs the header bidding auction among preconfigured demand partners. +3. In-App Bidding SDK sets up the targeting keywords of the winning bid to the ad unit of Primary Ad Server SDK. +4. Primary Ad Server SDK sends the ad request to the Ad Server. If Prebid's line item wins the ad response will contain **Prebid Universal Creative** and **Ad Layout**. +5. The received creative will be rendered in the Web View of Primary Ad Server SDK. + +The ad will be rendered in the web view. The rendering engine will be the prebid's universal creative. It will load the winning bid from the prebid cache and substitute assets into the ad markup. For the more detailed info visit the Prebid's instructions about [How Native Ads Work](https://docs.prebid.org/dev-docs/show-native-ads.html#how-native-ads-work). + +In order to prepare the valid layout folow the instructions in the Prebid docs for [Mobile in general](https://docs.prebid.org/prebid-mobile/adops-native-setup.html) and for [Google Ad Manager](https://docs.prebid.org/adops/setting-up-prebid-native-in-dfp.html). + +In the case of integration of Native Styles ads without Primary Ad Server publishers should provide the Ad Layout to the SDK. And the winning bid will be rendered right after receiving it from Prebid. + +Pipeline Screenshot + + +1. Setup layout for the Native Styles ad. +2. Prebid Rendering Module sends the bid request. +3. Prebid server runs the header bidding auction among preconfigured demand partners. +3. The received creative will be rendered in the Web View of Prebid Rendering Module. + + +### Unified Native Ads + +The general integration scenario requires these steps from publishers: + +1. Prepare the ad layout. +2. Create Native Ad Unit. +3. Configure the Native Ad unit using [NativeAdConfiguration](native/ios-native-ad-configuration.md). + * Provide the list of **[Native Assets](#components)** representing the ad's structure. + * Tune other general properties of the ad. +4. Make a bid request. +5. Find native ad using `NativeUtils.findNativeAd`. +6. Bind the data from the native ad response with the layout. + +``` swift +``` + +## Components + +Prebid Rendering Module supports all Native Ad components proclaimed by the OpenRTB specification: **title**, **image**, **video**, **data**. + +We strongly recommend to follow the industry best practices and requirements, especially in the case of integration with Primary Ad Server: + +* [OpenRTB Specification](https://www.iab.com/wp-content/uploads/2018/03/OpenRTB-Native-Ads-Specification-Final-1.2.pdf) +* [The Native Advertizing Playbook](https://www.iab.com/wp-content/uploads/2015/06/IAB-Native-Advertising-Playbook2.pdf) +* [Google Guidelines](https://support.google.com/admanager/answer/6075370) +* [MoPub Guidelines](https://developers.mopub.com/publishers/best-practices/native-ads/) + +While preparing the layout for Native Ads, account for the **AdChoices** button placed at the **top right corner** with a size of **20x20** points. + +## Integration + +Prebid Rendering Module allows to integrate native ads into all supported scenarios: + +* [Google Ad Manager](integration-gam/ios-in-app-bidding-gam-native-integration.md) +* [MoPub](integration-mopub/ios-in-app-bidding-mopub-native-integration.md) +* [Pure In-App Bidding](integration-prebid/ios-in-app-bidding-prebid-native-integration.md) + diff --git a/PrebidMobile/Rendering/Documentation/info/ios-sdk-ats.md b/PrebidMobile/Rendering/Documentation/info/ios-sdk-ats.md new file mode 100644 index 000000000..16d02be06 --- /dev/null +++ b/PrebidMobile/Rendering/Documentation/info/ios-sdk-ats.md @@ -0,0 +1,7 @@ +# iOS App Transport Security (ATS) + +App Transport Security (ATS) is an iOS app default setting which prevents apps from making non-secure connections (see [Apple iOS release documentation](https://developer.apple.com/library/content/releasenotes/General/WhatsNewIniOS/Articles/iOS9.html)). + +Due to many network calls, related to the ad, are not secure (HTTP), such as those related to resources and events, it is recommended to allow insecure connections in the app according to he [Apple's documentation](https://developer.apple.com/documentation/bundleresources/information_property_list/nsapptransportsecurity). + + diff --git a/PrebidMobile/Rendering/Documentation/info/ios-sdk-deeplinkplus.md b/PrebidMobile/Rendering/Documentation/info/ios-sdk-deeplinkplus.md new file mode 100644 index 000000000..51d81109f --- /dev/null +++ b/PrebidMobile/Rendering/Documentation/info/ios-sdk-deeplinkplus.md @@ -0,0 +1,65 @@ +# Deep Link+ + +Prebid Rendering Module supports the premium standard for retargeting campaigns - [DeepLink+](https://developers.mopub.com/dsps/ad-formats/deep-linking/) + +## Advantages over traditional mobile deep-linking functionality + +Technology has traditionally failed in providing the ideal user experience — as processing traditional deep-links requires opening up blank browser windows, redirecting users multiple times, and sometimes breaking down completely. Additionally, buyers would lack analytics around when primary URLs worked versus when fallback URLs were required. + +Deep Link+ provides a premium user experience while letting advertisers scale retargeting campaigns with accurate analytics. + +The new deeplinking format enables buyers to submit: + + * primary URL + * fallback URL + * primary tracking URL + * fallback tracking URL + +And since Deep Link+ is built into the SDK, there is no need to pop up browser windows and re-directs that deteriorate the user experience. + +## Support + +The schema is supported for both kinds of ads - video and display. + +The JSTag integration is not supported yet. + + +## How it works + + +DSPs should rely on the SDK version in the bid request: +``` +"displaymanagerver": "x.x.x" +``` + +To leverage the retargeting campaigns buyers use a specific scheme as click URL in the ad response. That URL describes the deep-linking and failover logic: + +``` +deeplink+://navigate? + primaryUrl=PRIMARY_DEEPLINK& + primaryTrackingUrl=PRIMARY_TRACKER& + fallbackUrl=FALLBACK_URL + &fallbackTrackingUrl=FALLBACK_TRACKER +``` + +The only required parameter is `primaryUrl` and if there are no other parameters, the deeplink+ would be handled as standard deeplink URL: doing nothing if the app is missing. + +The `fallbackUrl` can be any supported URI type (e.g., http, traditional deeplink) except for another Deep Link+ URL. To specify multiple tracker URLs (primary or fallback), buyers simply need to repeat the tracker key with any desired tracker URLs. The `primaryTrackingURL` is triggered if the deeplink is successful (which occurs after the user clicks). + +For example, below is a Deep Link+ URL whose primary target is the Twitter app, with two (2) primary tracker URLs, a fallback URL directing the user to Twitter’s mobile website if the primary deeplink fails and zero (0) fallback tracker URLs: + +``` +deeplink+://navigate? + primaryUrl=twitter%3A%2F%2Ftimeline& + primaryTrackingUrl=http%3A%2F%2Fmopub.com%2Fclicktracking& + primaryTrackingUrl=http%3A%2F%2Fmopub.com%2Fmopubtracking& + fallbackUrl=http%3A%2F%2Fmobile.twitter.com +``` + +The SDK will process this scheme regarding to the standard. + +## Integration tips + +**Publishers**: No action required for full-featured support of the ads with DeepLink+ schema. All work is performed by the SDK. + +**Buyers**: Must insert the deeplink+ scheme into creative or provide it via redirect for the regular clickthrough URL. diff --git a/PrebidMobile/Rendering/Documentation/info/ios-sdk-impression-tracking.md b/PrebidMobile/Rendering/Documentation/info/ios-sdk-impression-tracking.md new file mode 100644 index 000000000..84a75f839 --- /dev/null +++ b/PrebidMobile/Rendering/Documentation/info/ios-sdk-impression-tracking.md @@ -0,0 +1,49 @@ +# Impression Tracking + +## Responsibilities + +The impression tracking depends on a certain integration approach. + +In case of GAM or MoPub integration when the Ad Server ad wins - the impression will be tracked according to the policy of the certain Primary Ad Server SDK that will handle the rendering. + +If Prebid ad wins on the Primary Ad Server Auction, the impression tracking will depend on particular integration kind: + +* **GAM** impression will be tracked only for banner ads since it allows [manual impression counting](https://developers.google.com/ad-manager/mobile-ads-sdk/android/banner#manual_impression_counting). Rendering Module is not able to track impressions for GAM Interstitial or Rewarded ads. +* **MoPub** impression will be tracked as stated in the MoPub policies since the rendering part is performed according to the Mediation feature. +* **Pure In-App Bidding** impression pixels for Open Measurement and VAST will be tracked according to the [In-App Bidding Impression](#in-app-bidding-impression) policies of the SDK. + + +## In-App Bidding Impression + +Prebid Rendering Module tracks the impression pixel as stated in a definition of **render impression** from [Mobile Application Advertising Measurement Guidelines](http://mediaratingcouncil.org/Mobile%20In-App%20Measurement%20Guidelines%20(MMTF%20Final%20v1.1).pdf): + + +> **Ad Impression**: A measurement of responses from an ad delivery system to an ad request from the user's device, which is filtered for invalid traffic and is recorded at a point as late as possible in the process of delivery of the creative material to the user's device. The ad must be loaded and at minimum begin to render in order to count it as a valid ad impression. Measurement of begin to render should include logical components necessary to display the ad, but does not necessarily include logical elements that are not essential (such as other tracking elements). +> +> In the context of the guidance above, “loaded” means the logical creative file has been transmitted and received at the client-side (user device) and “render” refers to the process of painting the creative file or adding it to any portion of the Document Object Model. + +The impression pixel is triggered when at least 1 pixel of the creative appears on the screen. +This rule is applied to all tracking pixels display, video, Open Measurement. + +## MRAID + +### MRAID 2.0 Creative + +SDK broadcasts the `mraid.viewableChange()` event when the ad becomes rendered. It means that for proper impression tracking with MRAID the creative's code for tracking impression must depend on `mraid.isViewable()`. For example: + + +``` javascript +if ( mraid.viewableChangeEventWasDetected() ) + if( mraid.isViewable() == true) + fireMyImpressionTrackers(); + else if ( mraid.isViewable() == false) + doNothing(); +``` + +Otherwise the impression tracking would be inconsistent with Prebid Rendering SDK approach. + +### MRAID 3.0 Creative + +For the ads that support the MRAID 3, the impression tracking code should be rather dependent on `exposureChange()` function. Since it provides much more information about the viewability of an Ad Container, the impression tracking could be much more accurate and correspond to the MRC and IAB guidelines. + +However, the IAB strongly recommends not to use the MRAID facilities to track impressions. The best practice is to use the **Open Measurement** framework which is supported by SDK as well. \ No newline at end of file diff --git a/PrebidMobile/Rendering/Documentation/info/ios-sdk-logging.md b/PrebidMobile/Rendering/Documentation/info/ios-sdk-logging.md new file mode 100644 index 000000000..9c3219950 --- /dev/null +++ b/PrebidMobile/Rendering/Documentation/info/ios-sdk-logging.md @@ -0,0 +1,24 @@ +Logging +======= + +If you have `PrebidRenderingConfig.debugLogFileEnabled` set to `true` and `PrebidRenderingConfig.logLevel` set to `Info`, `Warn`, or `Error`, you will be able to log messages from the SDK. + +How to get logs +--------------- + +You can get logs from your test device if it is connected to Xcode and your device has the test app on it. Note that logs are in plain text and are not encrypted, so you know what you are sending to Prebid server. The log file is in the Documents directory of the container. + +1. In Xcode, go to **Window \> Devices and Simulators**. +2. Navigate to your test device or simulator. +3. Click to select your app and then click the gear icon. In the menu + that appears, select **Download Container**. This allows you to + download the whole container for the app as an .xcappdata package. +4. Click **Save** to save the package to your local drive. +5. On the .xcappdata file, Ctrl+click and select **Show package contents** to navigate to the following file: + + App Data \> Documents \> OXALog.txt + + This is the log file of the SDK. You can now view, save, or share the file as needed. + +The SDK creates this file and logs events as long as +`debugLogFileEnabled = true`. See [Request parameters](ios-sdk-parameters.md) for details. \ No newline at end of file diff --git a/PrebidMobile/Rendering/Documentation/info/ios-sdk-parameters.md b/PrebidMobile/Rendering/Documentation/info/ios-sdk-parameters.md new file mode 100644 index 000000000..6a56f70d8 --- /dev/null +++ b/PrebidMobile/Rendering/Documentation/info/ios-sdk-parameters.md @@ -0,0 +1,75 @@ +# Request parameters + +The tables below list methods and properties that the In-App Bidding SDK allows to customize. The more info specified about the user, the app, and the device you provide the more chances to win a bid. Please strictly follow the recommendations in the below tables and provide all ❗ **Required** and **Highly Recommended** values. + + +1. [PrebidRenderingTargeting Variables](#prebidrenderingtargeting-variables) +1. [PrebidRenderingTargeting Methods](#prebidrenderingtargeting-methods) +1. [PrebidRenderingConfig](#prebidrenderingconfig) + +## PrebidRenderingTargeting variables + +| **Variable** | **Type** | **Description** | **Required?** | +| -------------------- | ---------------- | ------------------------------------------------------------ | ------------------------ | +| appStoreMarketURL | NSString | Stores URL for the mobile application. For example: `"https://itunes.apple.com/us/app/your-app/id123456789"` | ❗ Required | +|contentUrl | NSString | This is the deep-link URL for the app screen that is displaying the ad. This can be an iOS universal link. | ❗ Highly Recommended | +|publisherName| NSString | App's publisher's name. | ❗ Highly Recommended | +| userAge | UInt16 | User's age in years. For example: `35` | ❗ Highly Recommended | +| coppa | NSNumber | Flag indicating if this request is subject to the COPPA regulations + established by the USA FTC, where 0 = no, 1 = yes | ❗ Highly Recommended | +| userAnnualIncomeInUS | UInt32 | User's annual income in US dollars. For example: `55000` | ❗ Highly Recommended | +| userGender | OXAGender | User's gender (Male, Female, Other, Unknown). For example: `OXAGenderFemale` | ❗ Highly Recommended | +|userGenderDescription| NSString | String representation of the user's gender, where “M” = male, “F” = female, “O” = known to be other (i.e., omitted is unknown) | | +| userID | NSString | ID of the user within the app. For example: `"24601"` | ❗ Highly Recommended | +| buyerUID | NSString | Buyer-specific ID for the user as mapped by the exchange for the buyer. | ❗ Highly Recommended | +| userEthnicity | OXAEthnicity | User's ethnicity (African American, Asian, Hispanic, White, Other). For example: `OXAEthnicityAsian` | Recommended if available | +| userMaritalStatus | OXAMaritalStatus | User's marital status (Single, Married, Divorced, Unknown). For example: `OXAMaritalStatusDivorced` | Recommended if available | +| networkType | OXANetworkType | Network connection type of the user (offline, wifi, or cell).For example: `OXANetworkTypeWifi` | ❗ Required | +| IP | NSString | The IP address of the carrier gateway. If this is not present, Prebid retrieves it from the request header. For example: `"192.168.0.1"` | ❗ Highly Recommended | +| carrier | NSString | Mobile carrier - Defined by the Mobile Country Code (MCC) and Mobile Network Code (MNC), using the format: -. For example: `"310-410"` | Optional | +| DMA | NSString | For US locations, indicates the user's Designated Market Area. For example: `"803"` | Optional | +| keywords | NSString | Comma separated list of keywords, interests, or intent | Optional | +| userCustomData| NSString | Optional feature to pass bidder the data that was set in the exchange’s cookie. The string must be in base85 cookie safe characters and be in any format. Proper JSON encoding must be used to include “escaped” quotation marks. | Optional | +|userExt| [NSString : id] | Placeholder for exchange-specific extensions to OpenRTB. | Optional | + +The code sample: + +``` swift +let targeting = PrebidRenderingTargeting.shared +targeting.userGender = .male +targeting.userAge = 99 +targeting.userAnnualIncomeInUS = 9999 +targeting.setLatitude(123.0, longitude: 456.0) +``` + + +## PrebidRenderingTargeting methods + +| **Method** | **Description** | +| ---------------------------------------- | ------------------------------------------------------------ | +| addCustomParam:@"val1" withName:@"key1" | Adds the custom parameters. The name will be auto-prepended with `c.` to avoid collisions. Example: `addCustomParam:@"73" withName:@"temperature"` | +| setCustomParams:@["key1":@"val1"] | Adds a dictionary of name-value parameter pairs, where each parameter name will be prepended with `c.` to avoid name collisions. Example: `setCustomParams:@["key1":@"val1"]` | +| addParam:@"val1" withName:@"key1" | Adds a new `param` by name and sets its value. If an ad call parameter doesn't exist in this SDK, you can set it manually using this method.
Example: `addParam:@"73" withName:@"temperature"` | +| setLatitude:latitude longitude:longitude | Sets the latitude and longitude of a geographic location.
Latitude from -90.0 to +90.0, where negative is south.
Longitude from -180.0 to +180.0, where negative is west. | +| resetUserAge; | Sets the User Age to 0 | +| resetUserAnnualIncomeInUS; | Sets the userAnnualIncomeInUS to 0 | + + +## PrebidRenderingConfig + +| **Method** | **Description** | **Default** | +| -------------------------------------- | ------------------------------------------------------------ | ----------- | +| defaultAutoRefreshDelay | Controls the initial value of `autoRefreshDelay` for all newly created `BannerView` in seconds. | 60 | +| creativeFactoryTimeout | Controls how long in seconds each creative has to load before it is considered a failure. | 3 | +| creativeFactoryTimeoutPreRenderContent | Controls how long (in seconds) the video and display interstitial creative has to completely pre-render before it is considered a failure. | 30 | +| useInternalClickthroughBrowser | Controls whether to use in-app browser or the Safari app for displaying ad click-through content. | true | +| sendMRAIDSupportParams | If `true`, the SDK sends "`af=3,5,6`", indicating support for MRAID. | true | +| logLevel | Controls the verbosity of PrebidRenderingModule's internal logger. Options are (from most to least noisy):
- .info
- .warn
- .error
- .none | .info | +| debugLogFileEnabled | If `true`, the output of PrebidRenderingModule's internal logger is written to a text file. This can be helpful for debugging. See [Logging](ios-sdk-logging.md). | false | + +The code sample: + +``` swift +PrebidRenderingConfig.shared.creativeFactoryTimeout = 5.0 +``` + diff --git a/PrebidMobile/Rendering/Documentation/info/native/ios-native-ad-configuration.md b/PrebidMobile/Rendering/Documentation/info/native/ios-native-ad-configuration.md new file mode 100644 index 000000000..ebac5476a --- /dev/null +++ b/PrebidMobile/Rendering/Documentation/info/native/ios-native-ad-configuration.md @@ -0,0 +1,63 @@ +# NativeAdConfiguration class + + +`NativeAdConfiguration` class provides an ability to set assets, event trackers and other OpenRTB parameters required for Native Ads. + +## Parameters + +| Property | Default | Required | Description | +|:---------------|:--------|:------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| context | Undefined | recommended | The context in which the ad appears | +| contextsubtype | Undefined | optional | A more detailed context in which the ad appears | +| plcmttype | Undefined | recommended | The design/format/layout of the ad unit being offered | +| seq | - | optional | 0 for the first ad, 1 for the second ad, and so on. Note this would generally NOT be used in combination with plcmtcnt - either you are auctioning multiple identical placements (in which case plcmtcnt>1, seq=0) or you are holding separate auctions for distinct items in the feed (in which case plcmtcnt=1, seq=>=1) | +| assets | - | required | An array of Asset Objects. | +| eventtrackers | - | optional | Specifies what type of event tracking is supported | +| privacy | false | recommended | Set to 1 when the native ad supports buyer-specific privacy notice. Set to 0 when the native ad doesn’t support custom privacy links or if support is unknown | +| ext | - | optional | This object is a placeholder that may contain custom JSON | + +> **Note:** `plcmtcnt`, `aurlsupport` and `durlsupport` OpenRTB fields are not supported + +## Enums + +### PBMNativeContextType + +| Name | ID | Description | +|:----------------|:-----|:---------------------------------------------------------------------------------------------| +| Undefined | 0 | Unset | +| ContentCentric | 1 | Content-centric context such as news feed, article, image gallery, video gallery, or similar | +| SocialCentric | 2 | Social-centric context such as social network feed, email, chat, or similar | +| Product | 3 | Product context such as product listings, details, recommendations, reviews, or similar | +| ExchangeSpecific| 500+ | To be defined by the exchange | + +### PBMNativeContextSubtype + +> **NOTE**: SubType should only be combined with the primary context type as indicated (ie for a context type of 1, only context subtypes that start with 1 are valid). + +| Name | ID | Description | +|:---------------------|:-----|:---------------------------------------------------------------------------------------------| +| Undefined | 0 | Unset| +| GeneralOrMixed | 10 | General or mixed content | +| Article | 11 | Primarily article content (which of course could include images, etc as part of the article) | +| Video | 12 | Primarily video content | +| Audio | 13 | Primarily audio content | +| Image | 14 | Primarily image content | +| UserGenerated | 15 | User-generated content - forums, comments, etc | +| Social | 20 | General social content such as a general social network | +| Email | 21 | Primarily email content | +| Chat | 22 | Primarily chat/IM content | +| SellingProducts | 30 | Content focused on selling products, whether digital or physical | +| ApplicationStore | 31 | Application store/marketplace | +| ProductReview | 32 | Product reviews site primarily (which may sell product secondarily) | +| ExchangeSpecific | 500+ | To be defined by the exchange | + +### PBMNativePlacementType + +| Name | ID | Description | +|:----------------------|:-----|:-------------------------------------------------------------------------------------------------------------------------------| +| Undefined | 0 || +| FeedGridListing | 1 | In the feed of content - for example as an item inside the organic feed/grid/listing/carousel | +| AtomicUnit | 2 | In the atomic unit of the content - IE in the article page or single image page | +| OutsideCoreContent | 3 | Outside the core content - for example in the ads section on the right rail, as a banner-style placement near the content, etc | +| RecommendationWidget | 4 | Recommendation widget, most commonly presented below the article content | +| ExchangeSpecific | 500+ | To be defined by the exchange | diff --git a/PrebidMobile/Rendering/Documentation/info/native/ios-native-event-tracker.md b/PrebidMobile/Rendering/Documentation/info/native/ios-native-event-tracker.md new file mode 100644 index 000000000..9543b8815 --- /dev/null +++ b/PrebidMobile/Rendering/Documentation/info/native/ios-native-event-tracker.md @@ -0,0 +1,31 @@ +# PBMNativeEventTracker class + +`PBMNativeEventTracker` class is used to setup 'eventtrackers' field for Native OpenRTB request. Event trackers object specifies the types of events the bidder can request to be tracked in the bid response, and which types of tracking are available for each event type, and is included as an array in the request. + +## Properties + +| Name | Description | +|:---------------------|:-------------------------------------------------------------| +| eventType | Type of event available for tracking | +| eventTrackingMethods | Array of the types of tracking available for the given event | +| ext | The custom extension available to the publisher | + + +## Enums + +### PBMNativeEventType +| Name | ID | Description | +|:-----------------|:-----|:-------------------------------------------------------------------------------| +| Impression | 1 | Impression | +| MRC50 | 2 | Visible impression using MRC definition at 50% in view for 1second | +| MRC100 | 3 | 100% in view for 1 second (ie GroupM standard) | +| Video50 | 4 | Visible impression for video using MRC definition at 50% in view for 2 seconds | +| ExchangeSpecific | 500+ | Exchange specific | + +### PBMNativeEventTrackingMethod + +| Name | ID | Description | +|:-------|:-----|:------------------------------------------------------------------------------------------------------------------------------------------| +| Image | 1 | Image-pixel tracking - URL provided will be inserted as a 1x1 pixel at the time of the event | +| JS | 2 | Javascript-based tracking - URL provided will be inserted as a js tag at the time of the event | +| ExchangeSpecific | 500+ | Could include custom measurement companies such as moat, double verify, IAS, etc - in this case additional elements will often be passed | diff --git a/PrebidMobile/Rendering/Documentation/info/res/In-App-Bidding-Overview.png b/PrebidMobile/Rendering/Documentation/info/res/In-App-Bidding-Overview.png new file mode 100644 index 000000000..91e4909ca Binary files /dev/null and b/PrebidMobile/Rendering/Documentation/info/res/In-App-Bidding-Overview.png differ diff --git a/PrebidMobile/Rendering/Documentation/info/res/Native-Styles-Prebid.png b/PrebidMobile/Rendering/Documentation/info/res/Native-Styles-Prebid.png new file mode 100644 index 000000000..4a751b89b Binary files /dev/null and b/PrebidMobile/Rendering/Documentation/info/res/Native-Styles-Prebid.png differ diff --git a/PrebidMobile/Rendering/Documentation/info/res/Native-Styles-Primary-Ad-Server.png b/PrebidMobile/Rendering/Documentation/info/res/Native-Styles-Primary-Ad-Server.png new file mode 100644 index 000000000..cb127e11c Binary files /dev/null and b/PrebidMobile/Rendering/Documentation/info/res/Native-Styles-Primary-Ad-Server.png differ diff --git a/PrebidMobile/Rendering/Documentation/info/res/Prebid-In-App-Bidding-Overview-GAM.png b/PrebidMobile/Rendering/Documentation/info/res/Prebid-In-App-Bidding-Overview-GAM.png new file mode 100644 index 000000000..99e6f348c Binary files /dev/null and b/PrebidMobile/Rendering/Documentation/info/res/Prebid-In-App-Bidding-Overview-GAM.png differ diff --git a/PrebidMobile/Rendering/Documentation/info/res/Prebid-In-App-Bidding-Overview-MoPub.png b/PrebidMobile/Rendering/Documentation/info/res/Prebid-In-App-Bidding-Overview-MoPub.png new file mode 100644 index 000000000..cc5505481 Binary files /dev/null and b/PrebidMobile/Rendering/Documentation/info/res/Prebid-In-App-Bidding-Overview-MoPub.png differ diff --git a/PrebidMobile/Rendering/Documentation/info/res/Prebid-In-App-Bidding-Overview-Pure-Prebid.png b/PrebidMobile/Rendering/Documentation/info/res/Prebid-In-App-Bidding-Overview-Pure-Prebid.png new file mode 100644 index 000000000..b7ca4f9bf Binary files /dev/null and b/PrebidMobile/Rendering/Documentation/info/res/Prebid-In-App-Bidding-Overview-Pure-Prebid.png differ diff --git a/PrebidMobile/Rendering/Documentation/info/res/Pure-In-App-Bidding-Integration.png b/PrebidMobile/Rendering/Documentation/info/res/Pure-In-App-Bidding-Integration.png new file mode 100644 index 000000000..3e1d60868 Binary files /dev/null and b/PrebidMobile/Rendering/Documentation/info/res/Pure-In-App-Bidding-Integration.png differ diff --git a/PrebidMobile/Rendering/Documentation/info/res/Pure-In-App-Bidding-Overview-Prebid-with-Primary-Ad-Server.png b/PrebidMobile/Rendering/Documentation/info/res/Pure-In-App-Bidding-Overview-Prebid-with-Primary-Ad-Server.png new file mode 100644 index 000000000..2d2627453 Binary files /dev/null and b/PrebidMobile/Rendering/Documentation/info/res/Pure-In-App-Bidding-Overview-Prebid-with-Primary-Ad-Server.png differ diff --git a/PrebidMobile/Rendering/Documentation/info/res/ios-sdk-charles.png b/PrebidMobile/Rendering/Documentation/info/res/ios-sdk-charles.png new file mode 100644 index 000000000..5d2187a07 Binary files /dev/null and b/PrebidMobile/Rendering/Documentation/info/res/ios-sdk-charles.png differ diff --git a/PrebidMobile/Rendering/Documentation/info/res/ios-sdk-id-inspector.png b/PrebidMobile/Rendering/Documentation/info/res/ios-sdk-id-inspector.png new file mode 100644 index 000000000..21ce3c41c Binary files /dev/null and b/PrebidMobile/Rendering/Documentation/info/res/ios-sdk-id-inspector.png differ diff --git a/PrebidMobile/Rendering/Documentation/info/res/ios-sdk-lipo-script.png b/PrebidMobile/Rendering/Documentation/info/res/ios-sdk-lipo-script.png new file mode 100644 index 000000000..06ba7ec20 Binary files /dev/null and b/PrebidMobile/Rendering/Documentation/info/res/ios-sdk-lipo-script.png differ diff --git a/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-ad-settings.png b/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-ad-settings.png new file mode 100644 index 000000000..4da42bbaf Binary files /dev/null and b/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-ad-settings.png differ diff --git a/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-create-native-ad.png b/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-create-native-ad.png new file mode 100644 index 000000000..f6031dd97 Binary files /dev/null and b/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-create-native-ad.png differ diff --git a/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-create.png b/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-create.png new file mode 100644 index 000000000..a9a973ee4 Binary files /dev/null and b/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-create.png differ diff --git a/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-creative-banner.png b/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-creative-banner.png new file mode 100644 index 000000000..aa99c9853 Binary files /dev/null and b/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-creative-banner.png differ diff --git a/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-creative-custom-template-format-variable.png b/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-creative-custom-template-format-variable.png new file mode 100644 index 000000000..1ec4efd4f Binary files /dev/null and b/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-creative-custom-template-format-variable.png differ diff --git a/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-creative-custom-template-format.png b/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-creative-custom-template-format.png new file mode 100644 index 000000000..04631c5cf Binary files /dev/null and b/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-creative-custom-template-format.png differ diff --git a/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-creative-custom-template.png b/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-creative-custom-template.png new file mode 100644 index 000000000..1a41d6fdf Binary files /dev/null and b/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-creative-custom-template.png differ diff --git a/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-creative-rewarded.png b/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-creative-rewarded.png new file mode 100644 index 000000000..399374154 Binary files /dev/null and b/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-creative-rewarded.png differ diff --git a/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-creative-unified-ad.png b/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-creative-unified-ad.png new file mode 100644 index 000000000..697c5902c Binary files /dev/null and b/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-creative-unified-ad.png differ diff --git a/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-li-create.png b/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-li-create.png new file mode 100644 index 000000000..b55a8e458 Binary files /dev/null and b/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-li-create.png differ diff --git a/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-li-price.png b/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-li-price.png new file mode 100644 index 000000000..0d625b011 Binary files /dev/null and b/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-li-price.png differ diff --git a/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-li-targeting.png b/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-li-targeting.png new file mode 100644 index 000000000..2d4ee2d41 Binary files /dev/null and b/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-li-targeting.png differ diff --git a/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-pubmonkey-form.png b/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-pubmonkey-form.png new file mode 100644 index 000000000..a772ee33b Binary files /dev/null and b/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-pubmonkey-form.png differ diff --git a/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-pubmonkey-result.png b/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-pubmonkey-result.png new file mode 100644 index 000000000..0d3b1d50d Binary files /dev/null and b/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-pubmonkey-result.png differ diff --git a/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-style-native-ad.png b/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-style-native-ad.png new file mode 100644 index 000000000..033a6088c Binary files /dev/null and b/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-style-native-ad.png differ diff --git a/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-ways-to-create-native-ad.png b/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-ways-to-create-native-ad.png new file mode 100644 index 000000000..895d0396c Binary files /dev/null and b/PrebidMobile/Rendering/Documentation/info/res/orders/order-gam-ways-to-create-native-ad.png differ diff --git a/PrebidMobile/Rendering/Documentation/info/res/orders/order-mopub-create.png b/PrebidMobile/Rendering/Documentation/info/res/orders/order-mopub-create.png new file mode 100644 index 000000000..eccdb4f6c Binary files /dev/null and b/PrebidMobile/Rendering/Documentation/info/res/orders/order-mopub-create.png differ diff --git a/PrebidMobile/Rendering/Documentation/info/res/orders/order-mopub-creative-native.png b/PrebidMobile/Rendering/Documentation/info/res/orders/order-mopub-creative-native.png new file mode 100644 index 000000000..8390fc608 Binary files /dev/null and b/PrebidMobile/Rendering/Documentation/info/res/orders/order-mopub-creative-native.png differ diff --git a/PrebidMobile/Rendering/Documentation/info/res/orders/order-mopub-li-ad-unit.png b/PrebidMobile/Rendering/Documentation/info/res/orders/order-mopub-li-ad-unit.png new file mode 100644 index 000000000..494bc1b60 Binary files /dev/null and b/PrebidMobile/Rendering/Documentation/info/res/orders/order-mopub-li-ad-unit.png differ diff --git a/PrebidMobile/Rendering/Documentation/info/res/orders/order-mopub-li-audience.png b/PrebidMobile/Rendering/Documentation/info/res/orders/order-mopub-li-audience.png new file mode 100644 index 000000000..3f5593f95 Binary files /dev/null and b/PrebidMobile/Rendering/Documentation/info/res/orders/order-mopub-li-audience.png differ diff --git a/PrebidMobile/Rendering/Documentation/info/res/orders/order-mopub-li-list.png b/PrebidMobile/Rendering/Documentation/info/res/orders/order-mopub-li-list.png new file mode 100644 index 000000000..6942cabf8 Binary files /dev/null and b/PrebidMobile/Rendering/Documentation/info/res/orders/order-mopub-li-list.png differ diff --git a/PrebidMobile/Rendering/Documentation/info/res/orders/order-mopub-li-type.png b/PrebidMobile/Rendering/Documentation/info/res/orders/order-mopub-li-type.png new file mode 100644 index 000000000..7cbe9f664 Binary files /dev/null and b/PrebidMobile/Rendering/Documentation/info/res/orders/order-mopub-li-type.png differ diff --git a/PrebidMobile/Rendering/Documentation/info/res/orders/order-mopub-native-ad-creative.png b/PrebidMobile/Rendering/Documentation/info/res/orders/order-mopub-native-ad-creative.png new file mode 100644 index 000000000..7a2f63867 Binary files /dev/null and b/PrebidMobile/Rendering/Documentation/info/res/orders/order-mopub-native-ad-creative.png differ diff --git a/PrebidMobile/Rendering/Documentation/info/res/orders/order-mopub-native-ad-li.png b/PrebidMobile/Rendering/Documentation/info/res/orders/order-mopub-native-ad-li.png new file mode 100644 index 000000000..3d02f09ef Binary files /dev/null and b/PrebidMobile/Rendering/Documentation/info/res/orders/order-mopub-native-ad-li.png differ diff --git a/PrebidMobile/Rendering/Documentation/info/res/orders/order-mopub-order-native.png b/PrebidMobile/Rendering/Documentation/info/res/orders/order-mopub-order-native.png new file mode 100644 index 000000000..2829e9380 Binary files /dev/null and b/PrebidMobile/Rendering/Documentation/info/res/orders/order-mopub-order-native.png differ