Skip to content

Commit

Permalink
Prebid sdk 1 7 (prebid#2125)
Browse files Browse the repository at this point in the history
* Floors Module: new analytics fields

* Floors Module: added skipRate

* Prebid SDK1.7: docs

* Prebid SDK 1.7: cathage

* Prebid SDK 1.7: milestone items

* Prebid SDK 1.7: latest changes

* prebid sdk 1.7: corrections

* PrebidSDK1.7: reformating with some corrections

* PrebidSDK1.7: reformating with some corrections
  • Loading branch information
bszekely1 authored Jul 16, 2020
1 parent cd8a68a commit bd3f76f
Show file tree
Hide file tree
Showing 10 changed files with 236 additions and 7 deletions.
25 changes: 24 additions & 1 deletion prebid-mobile/pbm-api/android/pbm-adunit-android.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ The `AdUnit` object is an abstract object that cannot be instantiated. Use the [
- `periodMillis`: Integer defining the refresh time in milliseconds. Default = 0, meaning no auto refresh.
- `keywords`: ArrayList containing keys and values.

#### pbAdSlot

PB Ad Slot is an identifier tied to the placement the ad will be delivered in. The use case for PB Ad Slot is to pass to exchange an ID they can use to tie to reporting systems or use for data science driven model building to match with impressions sourced from alternate integrations. A common ID to pass is the ad server slot name.

`adUnit.pbAdSlot = "/1111111/homepage/med-rect-2"`

---

## Methods

### fetchDemand
Expand All @@ -41,12 +49,14 @@ Trigger a call to Prebid Server to retrieve demand for this Prebid Mobile ad uni

**Parameters**

- `adObj`: bid request object
- `adObj`: This is the ad server request object (for [Google Ad Manager](https://developers.google.com/android/reference/com/google/android/gms/ads/doubleclick/PublisherAdRequest) and for [Mopub](https://developers.mopub.com/publishers/reference/android/MoPubView/)). If you do not wish to add any additional /custom key values to the ad server after the Prebid auction, pass `adObj` to the fetchDemand function, where Prebid SDK will set all the Prebid targeting keys as well as any keys added prior to auction
- As of Prebid SDK 1.7, a publisher can optionally pass the Google Ad Manager `builder` object of the [Google Ad Manager Mobile Ads SDK](https://developers.google.com/android/reference/com/google/android/gms/ads/doubleclick/PublisherAdRequest.Builder) to pass custom keys to Google Ad Manager after the Prebid Auction
- `onCompleteListener`: listener object





### setAutoRefreshPeriodMillis

If set on a given Prebid Mobile ad unit, the `fetchDemand` function will be called every `periodMillis` until `stopAutoRefresh` is called. Each call to `fetchDemand` will invoke the `onComplete` function. This refresh only pertains to Prebid Mobile and not to any ad server refresh processes. It is suggested that the adServers refresh be turned off.
Expand Down Expand Up @@ -209,6 +219,19 @@ interstitialAdUnit.fetchDemand(publisherAdRequest, new onCompleteListener() {
dfpInterstitial.loadAd(publisherAdRequest);
}
});
//As of Prebid SDK 1.7, the fetchDemand method supports passing a request builder object to append custom key values to the build object. See fetchDemand above for furher details.
final PublisherAdRequest.Builder builder = new PublisherAdRequest.Builder();
adUnit.fetchDemand(builder, new OnCompleteListener() {
@Override
public void onComplete(ResultCode resultCode) {
builder.addCustomTargeting("key1", "value1");
PublisherAdRequest request = builder.build();
amBanner.loadAd(request);
}
});
```

## Related Topics
Expand Down
27 changes: 26 additions & 1 deletion prebid-mobile/pbm-api/android/pbm-banneradunit-android.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,26 @@ Create a new Banner Ad Unit associated with a Prebid Server configuration ID and
- `width`: Integer; Width of the ad unit.
- `height`: Integer; Height of the ad unit.


#### Parameters


Parameters is a sub class of BannerAdUnit. Create a new Parameters class to define the parameters of the video ad unit. Parameters contain the OpenRTB video attributes.

`api: [int]`: OpenRTB placement

**Parameters**

Array of integers or a predefined constant representing the supported [OpenRTB 2.5](https://www.iab.com/wp-content/uploads/2016/03/OpenRTB-API-Specification-Version-2-5-FINAL.pdf) Frameworks. While OpenRTB allows additional API Frameworks, they were intentionally left out as constants since they do not make sense in a banner context. If there is a desire to pass API Frameworks that are not represented as a constants within Parameters, they can be passed an integer, where Prebid SDK will pass Prebid Server whatever is present:

* `3` or `Signals.Api.MRAID_1` : MRAID-1 support signal
* `5` or `Signals.Api.MRAID_2` : MRAID-2 support signal
* `6` or `Signals.Api.MRAID_3` : MRAID-3 support signal
* `7` or `Signals.Api.OMID_1` : signals OMSDK support




## Methods

`BannerAdUnit` inherits all methods from the [AdUnit](/prebid-mobile/pbm-api/android/pbm-adunit-android.html) object. It also includes the following additional methods:
Expand All @@ -50,7 +70,7 @@ none

## Example

```
```java
PublisherAdView dfpAdView = new PublisherAdView(context);
dfpAdView.setAdUnitId("/12345/foo");
dfpAdView.setAdSizes(new AdSize(300, 250));
Expand All @@ -59,6 +79,11 @@ final PublisherAdRequest request = builder.build();

BannerAdUnit bannerAdUnit = new BannerAdUnit("PREBID_SERVER_CONFIGURATION_ID", 300, 250);
bannerAdUnit.setUserKeyword("my_key", "my_value");
BannerBaseAdUnit.Parameters parameters = new BannerBaseAdUnit.Parameters();
parameters.setApi(Arrays.asList(new Signals.Api(6, 7)));
// alternate representation using an enum parameters.setApi(Arrays.asList(Signals.Api.MRAID_3, Signals.Api.OMID_1));

bannerAdUnit.setParameters(parameters);
bannerAdUnit.fetchDemand(request, new onCompleteListener() {
@Override
public void onComplete(ResultCode resultCode) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,23 @@ Prebid Server will send the eligible size list to each bidder to solicit a bid.
InterstitialAdUnit(@NonNull String configId, int minWidthPerc, int minHeightPerc)
```

#### Parameters


Parameters is a sub class of BannerAdUnit. Create a new Parameters class to define the parameters of the video ad unit. Parameters contain the OpenRTB video attributes.

`api: [int]`: OpenRTB placement

**Parameters**

Array of integers or a predefined constant representing the supported [OpenRTB 2.5](https://www.iab.com/wp-content/uploads/2016/03/OpenRTB-API-Specification-Version-2-5-FINAL.pdf) Frameworks. While OpenRTB allows additional API Frameworks, they were intentionally left out as constants since they do not make sense in a banner context. If there is a desire to pass API Frameworks that are not represented as a constants within Parameters, they can be passed an integer, where Prebid SDK will pass Prebid Server whatever is present:

* `3` or `Signals.Api.MRAID_1` : MRAID-1 support signal
* `5` or `Signals.Api.MRAID_2` : MRAID-2 support signal
* `6` or `Signals.Api.MRAID_3` : MRAID-3 support signal
* `7` or `Signals.Api.OMID_1` : signals OMSDK support


## Methods

`InterstitialAdUnit` inherits all methods from the [AdUnit](/prebid-mobile/pbm-api/android/pbm-adunit-android.html) object.
Expand All @@ -49,6 +66,10 @@ InterstitialAdUnit(@NonNull String configId, int minWidthPerc, int minHeightPerc

```java
AdUnit interstitialAdUnit = new InterstitialAdUnit("12345", 50, 70);
BannerBaseAdUnit.Parameters parameters = new BannerBaseAdUnit.Parameters();
parameters.setApi(Arrays.asList(new Signals.Api(6, 7)));
// alternate representation using an enum parameters.setApi(Arrays.asList(Signals.Api.MRAID_3, Signals.Api.OMID_1));
interstitialAdUnit.setParameters(parameters);
interstitialAdUnit.fetchDemand(publisherAdRequest, new onCompleteListener() {
@Override
public void onComplete(ResultCode resultCode) {
Expand Down
9 changes: 9 additions & 0 deletions prebid-mobile/pbm-api/android/prebidmobile-object-android.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,15 @@ none
void clearStoredBidResponses()
```

### pbsDebug

`pbsDebug`: adds the debug flag ("test":1) on the outbound http call to Prebid Server. The test:1 flag will signal to Prebid Server to emit the full resolved request (resolving any Stored Request IDs) as well as the full Bid Request and Bid Response to and from each bidder.
```java
pbsDebug(Boolean)
```

Example:
PrebidMobile.setPbsDebug(true);

## Related Topics

Expand Down
48 changes: 48 additions & 0 deletions prebid-mobile/pbm-api/ios/code-integration-ios.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,54 @@ target 'MyAmazingApp' do
end
```

### Include with Carthage

If you are not familiar with the Carthage package builder, please refere to the project [github page](https://github.com/Carthage/Carthage) for more details.

Since Prebid SDK architecture supports a multi-module feature for future enhancements, that currently use the same module name for every schema, please use CarthageBuild.sh script to build a necessary binary.

There are two shared schemes available ([issue #239](https://github.com/prebid/prebid-mobile-ios/issues/239)):

- PrebidMobile
- PrebidMobileCore

Follow the next steps:

1. Add PrebidSDK dependency into Cartfile. Release notes
```
github "prebid/prebid-mobile-ios" == 1.5
```
2. Update Carthage
```
carthage update
```

3. Build the specific schema `CarthageBuild.sh`

**Variant 1**

- Run CarthageBuild.sh script from Cartfile folder. The path should be:
`.../Carthage/Checkouts/prebid-mobile-ios/scripts/CarthageBuild.sh`

- Enter Schema name (PrebidMobile or PrebidMobileCore)
- If you run CarthageBuild.sh and see Permission denied use:
`chmod +x <path_to_CarthageBuild.sh>`

**Variant 2**

- Open `PrebidMobile.xcodeproj` at `.../Carthage/Checkouts/prebid-mobile-ios/PrebidMobile.xcodeproj` using Xcode

- Manage Schemes -> Check Shared checkbox for a necessary schema

- run `carthage build prebid-mobile-ios`
4. Integrate the binary into your project



You can find the schema name in the build PrebidSDK framework inside Info.plist with `PrebidMobileName` key



### Build framework from source

Build Prebid Mobile from source code. After [cloning the repo](https://github.com/prebid/prebid-mobile-ios), use Terminal or another command line tool, change to the root directory and run:
Expand Down
14 changes: 12 additions & 2 deletions prebid-mobile/pbm-api/ios/pbm-adunit-ios.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ Create a new Banner Ad Unit or Interstitial Ad Unit with a Prebid Server configu

`adSizes`: An Array of CGSizes to be used for AdUnit sizes.


#### pbAdSlot

PB Ad Slot is an identifier tied to the placement the ad will be delivered in. The use case for PB Ad Slot is to pass to exchange an ID they can use to tie to reporting systems or use for data science driven model building to match with impressions sourced from alternate integrations. A common ID to pass is the ad server slot name.

`adUnit.pbAdSlot = "/1111111/homepage/med-rect-2"`

---

## Methods
Expand Down Expand Up @@ -115,9 +122,9 @@ func clearContextKeywords()



### First Party Data
### Data Object

First Party Data (FPD) is free form data supplied by the publisher to provide additional targeting of the user or inventory context, used primarily for striking PMP (Private MarketPlace) deals with Advertisers. Data supplied in the data parameters are typically not sent to DSPs whereas information sent in non-data objects (i.e. `setYearOfBirth`, `setGender`, etc.) will be. Access to FPD can be limited to a supplied set of Prebid bidders via an access control list.
The Data object is free form data (also known as First Party Data)supplied by the publisher to provide additional targeting of the user or inventory context, used primarily for striking PMP (Private MarketPlace) deals with Advertisers. Data supplied in the data parameters are typically not sent to DSPs whereas information sent in non-data objects (i.e. `setYearOfBirth`, `setGender`, etc.) will be. Access to FPD can be limited to a supplied set of Prebid bidders via an access control list.

Data is broken up into two different data types:
* User
Expand Down Expand Up @@ -163,6 +170,8 @@ func removeContextData(forKey: String)
func clearContextData()
```



## Examples

**fetchDemand**
Expand All @@ -176,6 +185,7 @@ func clearContextData()
func loadDFPBanner(bannerUnit : AdUnit){

let bannerUnit = BannerAdUnit(configId: "6ace8c7d-88c0-4623-8117-75bc3f0a2e45", size: CGSize(width: 300, height: 250))
bannerUnit.pbAdSlot = "/1111111/homepage/med-rect-2"`

let dfpBanner = DFPBannerView(adSize: kGADAdSizeMediumRectangle)
dfpBanner.adUnitID = "/19968336/PriceCheck_300x250"
Expand Down
35 changes: 35 additions & 0 deletions prebid-mobile/pbm-api/ios/pbm-banneradunit-ios.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,24 @@ See [AdUnit]({{site.baseurl}}/prebid-mobile/pbm-api/ios/pbm-adunit-ios.html) for

`size (CGSize)`: Width and height of the banner.


#### Parameters


Parameters is a sub class of BannerAdUnit. Create a new Parameters class to define the parameters of the video ad unit. Parameters contain the OpenRTB video attributes.

`api: [int]`: OpenRTB placement

**Parameters**

Array of integers or a predefined constant representing the supported [OpenRTB 2.5](https://www.iab.com/wp-content/uploads/2016/03/OpenRTB-API-Specification-Version-2-5-FINAL.pdf) Frameworks. While OpenRTB allows additional API Frameworks, they were intentionally left out as constants since they do not make sense in a banner context. If there is a desire to pass API Frameworks that are not represented as a constants within Parameters, they can be passed an integer, where Prebid SDK will pass Prebid Server whatever is present:

* `3` or `Signals.Api.MRAID_1` : MRAID-1 support signal
* `5` or `Signals.Api.MRAID_2` : MRAID-2 support signal
* `6` or `Signals.Api.MRAID_3` : MRAID-3 support signal
* `7` or `Signals.Api.OMID_1` : signals OMSDK support


## Methods

### addAdditionalSize
Expand Down Expand Up @@ -56,6 +74,23 @@ bannerUnit.addAdditionalSizes(sizes: CGSize(width: 320, height: 50))
```
Once a BannerAdUnit is created use Google Mobile Ads or MoPub to retrieve and display creatives.

** Define any appropriate API Frameworks **

Swift
```swift
let parameters = BannerAdUnit.Parameters()
parameters.api = [Signals.Api.MRAID_2] //parameters.api = [Signals.Api(5)]
adUnit.setParameters(parameters);
```

Objective C
```
PBBannerAdUnitParameters* parameters = [[PBBannerAdUnitParameters alloc] init];
parameters.api = @[PBApi.MRAID_2];
//parameters.api = @[[[PBApi alloc] initWithIntegerLiteral:5]];
bannerAdUnit.parameters = parameters;
```

**Google Mobile Ads**

Import the GoogleMobileAds from the [google-mobile-sdk](https://developers.google.com/admob/ios/download) into the UIViewController displaying the BannerAdUnit
Expand Down
46 changes: 45 additions & 1 deletion prebid-mobile/pbm-api/ios/pbm-bannerinterstitialadunit-ios.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ PBS with interstitial support will come preconfigured with a list of common ad s
Prebid Server will send the eligible size list to each bidder to solicit a bid. For a full description of the Prebid Server logic, please refer to the [Prebid Server PR 797](https://github.com/prebid/prebid-server/pull/797/files).

```
init(configId: String, minWidthPerc: Int, minHeightPerc: Int)
BannerInterstitialAdUnit(configId: String, minWidthPerc: Int, minHeightPerc: Int)
```

**Parameters**
Expand All @@ -38,11 +38,55 @@ init(configId: String, minWidthPerc: Int, minHeightPerc: Int)

`minHeightPrec`: Optional parameter to specify the minimum height percent an ad may occuy of a device's real estate. Support in SDK version 1.2+

#### Parameters


Parameters is a sub class of BannerAdUnit. Create a new Parameters class to define the parameters of the video ad unit. Parameters contain the OpenRTB video attributes.

`api: [int]`: OpenRTB placement

**Parameters**

Array of integers or a predefined constant representing the supported [OpenRTB 2.5](https://www.iab.com/wp-content/uploads/2016/03/OpenRTB-API-Specification-Version-2-5-FINAL.pdf) Frameworks. While OpenRTB allows additional API Frameworks, they were intentionally left out as constants since they do not make sense in a banner context. If there is a desire to pass API Frameworks that are not represented as a constants within Parameters, they can be passed an integer, where Prebid SDK will pass Prebid Server whatever is present:

* `3` or `Signals.Api.MRAID_1` : MRAID-1 support signal
* `5` or `Signals.Api.MRAID_2` : MRAID-2 support signal
* `6` or `Signals.Api.MRAID_3` : MRAID-3 support signal
* `7` or `Signals.Api.OMID_1` : signals OMSDK support



## Examples

**Create an InterstitialAdUnit**

```
let bannerUnit = BannerAdUnit(configId: "6ace8c7d-88c0-4623-8117-75bc3f0a2e45", size: CGSize(width: 300, height: 250))
```
**Add additional ad sizes**

```
bannerUnit.addAdditionalSizes(sizes: CGSize(width: 320, height: 50))
```
Once a BannerAdUnit is created use Google Mobile Ads or MoPub to retrieve and display creatives.

** Define any appropriate API Frameworks **

Swift
```swift
let parameters = BannerAdUnit.Parameters()
parameters.api = [Signals.Api.MRAID_2] //parameters.api = [Signals.Api(5)]
adUnit.setParameters(parameters);
```

Objective C
```
PBBannerAdUnitParameters* parameters = [[PBBannerAdUnitParameters alloc] init];
parameters.api = @[PBApi.MRAID_2];
//parameters.api = @[[[PBApi alloc] initWithIntegerLiteral:5]];
bannerAdUnit.parameters = parameters;
```

**Google Mobile Ads**

**Swift**
Expand Down
4 changes: 2 additions & 2 deletions prebid-mobile/pbm-api/ios/pbm-targeting-ios.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ Targeting.shared.domain = domain
```
### Store URL

Retrieve and set the domain of your store URL with the following commands:
Retrieve and set the domain of your store URL with the following command:

```
Targeting.shared.storeURL
Expand All @@ -141,7 +141,7 @@ Targeting.shared.storeURL = "itunes store URL string"

### iTunesID

Retrieve and set the domain of your store URL with the following commands:
Retrieve and set the domain of your iTunes ID with the below command. This field will be transmitted to buyers as the bundle ID as recommended in OpenRTB 2.5. Failure to supply this value can have a negative monetary impact.

```
Targeting.shared.itunesID
Expand Down
Loading

0 comments on commit bd3f76f

Please sign in to comment.