From 8270c1014e77c99bd4c335c01009ad70ceba469d Mon Sep 17 00:00:00 2001 From: Yuriy Velichko Date: Thu, 12 Oct 2023 17:14:37 +0300 Subject: [PATCH 1/6] mobile: config examples for the gpid --- .../android/android-sdk-integration-gam-original-api.md | 8 ++++++++ .../pbm-api/ios/ios-sdk-integration-gam-original-api.md | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/prebid-mobile/pbm-api/android/android-sdk-integration-gam-original-api.md b/prebid-mobile/pbm-api/android/android-sdk-integration-gam-original-api.md index 3e7559b162..775c2a0656 100755 --- a/prebid-mobile/pbm-api/android/android-sdk-integration-gam-original-api.md +++ b/prebid-mobile/pbm-api/android/android-sdk-integration-gam-original-api.md @@ -1551,6 +1551,14 @@ void removeContextData(String key) void clearContextData() ``` +### GPID + +Using the following method, you can set the impression-level [GPID](https://docs.prebid.org/features/pbAdSlot.html#the-gpid) value to the bid request: + +``` kotlin +adUnit?.gpid = "/36117602/hnp-sfgate.com/Homepage/AP300" +``` + ### UserKeyword #### setUserKeyword diff --git a/prebid-mobile/pbm-api/ios/ios-sdk-integration-gam-original-api.md b/prebid-mobile/pbm-api/ios/ios-sdk-integration-gam-original-api.md index e523317970..4598cbc268 100644 --- a/prebid-mobile/pbm-api/ios/ios-sdk-integration-gam-original-api.md +++ b/prebid-mobile/pbm-api/ios/ios-sdk-integration-gam-original-api.md @@ -1386,6 +1386,14 @@ func removeAppContentData(_ dataObject: ContentDataObject) func clearAppContentData() ``` +### GPID + +Using the following method, you can set the impression-level [GPID](https://docs.prebid.org/features/pbAdSlot.html#the-gpid) value to the bid request: + +``` swift +adUnit.setGPID("/36117602/hnp-sfgate.com/Homepage/AP300") +``` + ### User Data Using the following methods you can add `user.data` objects to the bid requests. From 1ae836e55539932b69f652b9be633a62fe8e7745 Mon Sep 17 00:00:00 2001 From: Yuriy Velichko Date: Thu, 12 Oct 2023 17:55:15 +0300 Subject: [PATCH 2/6] mobile: add info about extracting the events --- .../rendering/android-sdk-integration-pb.md | 27 +++++++++++++------ .../rendering/ios-sdk-integration-pb.md | 11 ++++++++ 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/prebid-mobile/modules/rendering/android-sdk-integration-pb.md b/prebid-mobile/modules/rendering/android-sdk-integration-pb.md index 4c221aaee0..ec8d097e72 100644 --- a/prebid-mobile/modules/rendering/android-sdk-integration-pb.md +++ b/prebid-mobile/modules/rendering/android-sdk-integration-pb.md @@ -22,12 +22,12 @@ The default ad server for Prebid's Mobile SDK is GAM. The SDK can be expanded to In this mode, the publisher will be responsible for the following actions: * Call fetchDemand with extended targetingDict callback -* Retrieve targeting keys from extended fetchDemand function +* Retrieve targeting keys from the extended fetchDemand function * Convert targeting keys into the format for your ad server * Pass converted keys to your ad server * Render ad with Prebid Universal Creative or custom renderer -This approach is avaliable for the following ad formats: +This approach is available for the following ad formats: * Display Banner via `BannerAdUnit` * Video Banner and Instream Video via `VideoAdUnit` @@ -36,7 +36,7 @@ This approach is avaliable for the following ad formats: * Rewarded Video via `RewardedVideoAdUnit` * Native Styles via `NativeRequest` -The basic integration steps for these ad units you can find at the page for integration using [Original API](/prebid-mobile/pbm-api/android/android-sdk-integration-gam-original-api.html). The diference is that you should use the `fetchDemand` function with following signature: +The basic integration steps for these ad units you can find on the page for integration using [Original API](/prebid-mobile/pbm-api/android/android-sdk-integration-gam-original-api.html). The difference is that you should use the `fetchDemand` function with the following signature: ```kotlin public void fetchDemand(OnFetchDemandResult listener) { ... } @@ -49,9 +49,9 @@ public interface OnFetchDemandResult { Examples: ``` kotlin -adUnit?.fetchDemand { result -> - if(result.getResultCode() == ResultCode.SUCCESS) { - val keywords = resultCode.targetingKeywords +adUnit?.fetchDemand { bidInfo -> + if(bidInfo.getResultCode() == ResultCode.SUCCESS) { + val keywords = bidInfo.targetingKeywords makeAdRequest(keywords) } @@ -64,6 +64,17 @@ The `BidInfo` provides the following properties: * `targetingKeywords` - the targeting keywords of the winning bid * `exp` - the number of seconds that may elapse between the auction and the actual impression. In this case, it indicates the approximate TTL of the bid in the Prebid Cache. Note that the actual expiration time of the bid will be less than this number due to the network and operational overhead. The Prebid SDK doesn't make any adjustments to this value. * `nativeAdCacheId` - the local cache ID of the winning bid. Applied only to the `native` ad format. +* `events` - the map of some publicly available events attached to the bid. Use one of the following keys to get the respective event: + * **EVENT_WIN** for the `ext.prebid.events.win` + * **EVENT_IMP** for the `ext.prebid.events.imp` + + +Code sample to extract the events: + +``` kotlin +val win = bidInfo.events.get(BidInfo.EVENT_WIN) +val imp = bidInfo.get(BidInfo.EVENT_IMP) +``` ## Rendering API @@ -156,9 +167,9 @@ Initialize the `InterstitialAdUnit` with properties: * `configId` - an ID of a [Stored Impression](/prebid-server/features/pbs-storedreqs.html) on the Prebid server * `minSizePercentage` - specifies the minimum width and height percent an ad may occupy of a device’s real estate. -You can also assign the listener for processing ad events. +You can also assign the listener to process ad events. -> **NOTE:** the `minSizePercentage` - plays an important role in a bidding process for display ads. If the provided space is not enough demand partners won't respond with bids. +> **NOTE:** the `minSizePercentage` - plays an important role in the bidding process for display ads. If the provided space is not enough demand partners won't respond with bids. #### Step 2: Load the Ad {:.no_toc} diff --git a/prebid-mobile/modules/rendering/ios-sdk-integration-pb.md b/prebid-mobile/modules/rendering/ios-sdk-integration-pb.md index 8fe5952a0f..6608dbe321 100644 --- a/prebid-mobile/modules/rendering/ios-sdk-integration-pb.md +++ b/prebid-mobile/modules/rendering/ios-sdk-integration-pb.md @@ -62,6 +62,17 @@ The `BidInfo` provides the following properties: * `targetingKeywords` - the targeting keywords of the winning bid * `exp` - the number of seconds that may elapse between the auction and the actual impression. In this case, it indicates the approximate TTL of the bid in the Prebid Cache. Note that the actual expiration time of the bid will be less than this number due to the network and operational overhead. The Prebid SDK doesn't make any adjustments to this value. * `nativeAdCacheId` - the local cache ID of the winning bid. Applied only to the `native` ad format. +* `events` - the map of some publicly available events attached to the bid. Use one of the following keys to get the respective event: + * **EVENT_WIN** for the `ext.prebid.events.win` + * **EVENT_IMP** for the `ext.prebid.events.imp` + + +Code sample to extract the events: + +``` swift +let win = bidInfo.events[BidInfo.EVENT_WIN] +let imp = bidInfo.events[BidInfo.EVENT_IMP] +``` ## Rendering API From 5646bf828245ccfcd7ba7d087a171c71aead236d Mon Sep 17 00:00:00 2001 From: Yuriy Velichko Date: Thu, 12 Oct 2023 19:00:39 +0300 Subject: [PATCH 3/6] mobile: fix errors --- prebid-mobile/modules/rendering/android-sdk-integration-pb.md | 1 - prebid-mobile/modules/rendering/ios-sdk-integration-pb.md | 1 - 2 files changed, 2 deletions(-) diff --git a/prebid-mobile/modules/rendering/android-sdk-integration-pb.md b/prebid-mobile/modules/rendering/android-sdk-integration-pb.md index ec8d097e72..9f039880bd 100644 --- a/prebid-mobile/modules/rendering/android-sdk-integration-pb.md +++ b/prebid-mobile/modules/rendering/android-sdk-integration-pb.md @@ -68,7 +68,6 @@ The `BidInfo` provides the following properties: * **EVENT_WIN** for the `ext.prebid.events.win` * **EVENT_IMP** for the `ext.prebid.events.imp` - Code sample to extract the events: ``` kotlin diff --git a/prebid-mobile/modules/rendering/ios-sdk-integration-pb.md b/prebid-mobile/modules/rendering/ios-sdk-integration-pb.md index 6608dbe321..a564484d9c 100644 --- a/prebid-mobile/modules/rendering/ios-sdk-integration-pb.md +++ b/prebid-mobile/modules/rendering/ios-sdk-integration-pb.md @@ -66,7 +66,6 @@ The `BidInfo` provides the following properties: * **EVENT_WIN** for the `ext.prebid.events.win` * **EVENT_IMP** for the `ext.prebid.events.imp` - Code sample to extract the events: ``` swift From 3dfcd5e252b2cfcabb003cc68565367016e198fd Mon Sep 17 00:00:00 2001 From: bretg Date: Thu, 12 Oct 2023 12:05:51 -0400 Subject: [PATCH 4/6] wordsmithing --- .../modules/rendering/android-sdk-integration-pb.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/prebid-mobile/modules/rendering/android-sdk-integration-pb.md b/prebid-mobile/modules/rendering/android-sdk-integration-pb.md index 9f039880bd..12ae41dd5e 100644 --- a/prebid-mobile/modules/rendering/android-sdk-integration-pb.md +++ b/prebid-mobile/modules/rendering/android-sdk-integration-pb.md @@ -64,9 +64,9 @@ The `BidInfo` provides the following properties: * `targetingKeywords` - the targeting keywords of the winning bid * `exp` - the number of seconds that may elapse between the auction and the actual impression. In this case, it indicates the approximate TTL of the bid in the Prebid Cache. Note that the actual expiration time of the bid will be less than this number due to the network and operational overhead. The Prebid SDK doesn't make any adjustments to this value. * `nativeAdCacheId` - the local cache ID of the winning bid. Applied only to the `native` ad format. -* `events` - the map of some publicly available events attached to the bid. Use one of the following keys to get the respective event: - * **EVENT_WIN** for the `ext.prebid.events.win` - * **EVENT_IMP** for the `ext.prebid.events.imp` +* `events` - the map of some publically available event URLs attached to the bid. These can be used to enable Prebid Server-based analytics when the Prebid Universal Creative (PUC) is not involved in the rendering process. If the PUC is used for rendering, it will take care of hitting these events. These are the available event URLs: + * **EVENT_WIN** for the `ext.prebid.events.win` - this bid was chosen by the ad server as the one to display. This is the main metric for banner and native. + * **EVENT_IMP** for the `ext.prebid.events.imp` - the ad creative for this bid was actually displayed. This is often the main metric for video ads. Code sample to extract the events: From e7d756081af2ba75ee713eab995e0fb3894178f7 Mon Sep 17 00:00:00 2001 From: bretg Date: Thu, 12 Oct 2023 12:07:35 -0400 Subject: [PATCH 5/6] wordsmithing --- prebid-mobile/modules/rendering/android-sdk-integration-pb.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prebid-mobile/modules/rendering/android-sdk-integration-pb.md b/prebid-mobile/modules/rendering/android-sdk-integration-pb.md index 12ae41dd5e..fed5646871 100644 --- a/prebid-mobile/modules/rendering/android-sdk-integration-pb.md +++ b/prebid-mobile/modules/rendering/android-sdk-integration-pb.md @@ -65,8 +65,8 @@ The `BidInfo` provides the following properties: * `exp` - the number of seconds that may elapse between the auction and the actual impression. In this case, it indicates the approximate TTL of the bid in the Prebid Cache. Note that the actual expiration time of the bid will be less than this number due to the network and operational overhead. The Prebid SDK doesn't make any adjustments to this value. * `nativeAdCacheId` - the local cache ID of the winning bid. Applied only to the `native` ad format. * `events` - the map of some publically available event URLs attached to the bid. These can be used to enable Prebid Server-based analytics when the Prebid Universal Creative (PUC) is not involved in the rendering process. If the PUC is used for rendering, it will take care of hitting these events. These are the available event URLs: - * **EVENT_WIN** for the `ext.prebid.events.win` - this bid was chosen by the ad server as the one to display. This is the main metric for banner and native. - * **EVENT_IMP** for the `ext.prebid.events.imp` - the ad creative for this bid was actually displayed. This is often the main metric for video ads. + * **EVENT_WIN** - this bid was chosen by the ad server as the one to display. This is the main metric for banner and native. (This is the OpenRTB `seatbid.bid.ext.prebid.events.win` field.) + * **EVENT_IMP** - the ad creative for this bid was actually displayed. This is often the main metric for video ads. (This is the OpenRTB `seatbid.bid.ext.prebid.events.imp` field.) Code sample to extract the events: From 2e6991a040575e25af34347187c75a9945765363 Mon Sep 17 00:00:00 2001 From: bretg Date: Thu, 12 Oct 2023 12:08:45 -0400 Subject: [PATCH 6/6] wordsmithing --- prebid-mobile/modules/rendering/ios-sdk-integration-pb.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/prebid-mobile/modules/rendering/ios-sdk-integration-pb.md b/prebid-mobile/modules/rendering/ios-sdk-integration-pb.md index a564484d9c..7d5bd3a516 100644 --- a/prebid-mobile/modules/rendering/ios-sdk-integration-pb.md +++ b/prebid-mobile/modules/rendering/ios-sdk-integration-pb.md @@ -62,9 +62,9 @@ The `BidInfo` provides the following properties: * `targetingKeywords` - the targeting keywords of the winning bid * `exp` - the number of seconds that may elapse between the auction and the actual impression. In this case, it indicates the approximate TTL of the bid in the Prebid Cache. Note that the actual expiration time of the bid will be less than this number due to the network and operational overhead. The Prebid SDK doesn't make any adjustments to this value. * `nativeAdCacheId` - the local cache ID of the winning bid. Applied only to the `native` ad format. -* `events` - the map of some publicly available events attached to the bid. Use one of the following keys to get the respective event: - * **EVENT_WIN** for the `ext.prebid.events.win` - * **EVENT_IMP** for the `ext.prebid.events.imp` +* `events` - the map of some publically available event URLs attached to the bid. These can be used to enable Prebid Server-based analytics when the Prebid Universal Creative (PUC) is not involved in the rendering process. If the PUC is used for rendering, it will take care of hitting these events. These are the available event URLs: + * **EVENT_WIN** - this bid was chosen by the ad server as the one to display. This is the main metric for banner and native. (This is the OpenRTB `seatbid.bid.ext.prebid.events.win` field.) + * **EVENT_IMP** - the ad creative for this bid was actually displayed. This is often the main metric for video ads. (This is the OpenRTB `seatbid.bid.ext.prebid.events.imp` field.) Code sample to extract the events: