From 383a9822256aa2acf90bc1306a95564b99b183ad Mon Sep 17 00:00:00 2001 From: Olivier Sazos Date: Tue, 23 Feb 2021 15:54:40 +0100 Subject: [PATCH 1/3] Native: add Custom Assets section --- prebid/native-implementation.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/prebid/native-implementation.md b/prebid/native-implementation.md index dec0303eae..9946a41f33 100644 --- a/prebid/native-implementation.md +++ b/prebid/native-implementation.md @@ -101,6 +101,30 @@ Specific bidders may not support all of the fields listed below or may return di {% include dev-docs/native-image-asset-sizes.md %} +### 3.2 Native custom assets + +Prebid.js allows custom assets in order to fit some bidder's requirements through the special `mediaTypes.native.ext` key. The assets under this key will be whitelisted and could be retrieved during the rendering. + +The custom assets are declared in the same way as the Prebid standard ones. + +Note: on the rendering side, `native-render.js::renderNativeAd()` must be called with `requestAllAssets: true`. + +BidderAdapter should declare which custom assets they support in their own documentation. It is recommended to prefix the asset name with the bidderCode to avoid collision issues. + +```javascript +mediaTypes { + native: { + body: { + required: true + }, + ext: { + bidderCode_customAssetName: { + required: false + } + } +} +``` + ## 4. Implementing the Native Template - If you want to manage your creative within the ad server (e.g. Google Ad Manager), follow the instructions for [AdServer-Defined Creative](#4-implementing-adserver-defined-creative). From d37e0dfacdb66e9f2af58258ec2efe5c7ee91738 Mon Sep 17 00:00:00 2001 From: bretg Date: Tue, 2 Mar 2021 17:28:56 -0500 Subject: [PATCH 2/3] wordsmithing --- prebid/native-implementation.md | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/prebid/native-implementation.md b/prebid/native-implementation.md index 9946a41f33..2ff5267920 100644 --- a/prebid/native-implementation.md +++ b/prebid/native-implementation.md @@ -88,6 +88,7 @@ The Prebid.js AdUnit needs to defines a native mediatype object to tell bidders | ASSETCODE. aspect_ratios.min_height | optional | Part of the aspect_ratios object, bidders may pass this value through to the endpoint. Prebid.js does not enforce the responses and there’s no default. | 75 | integer | | ASSETCODE. aspect_ratios.ratio_width | optional | Part of the aspect_ratios object, bidders may pass this value through to the endpoint. Prebid.js does not enforce the responses and there’s no default. | 2 | integer | | ASSETCODE. aspect_ratios.ratio_height | optional | Part of the aspect_ratios object, bidders may pass this value through to the endpoint. Prebid.js does not enforce the responses and there’s no default. | 3 | integer | +| ext.CUSTOMASSET | optional | Non-standard or bidder-specific assets can be supplied on the `ext` here. Attributes on custom assets are documented by the vendor. | | | **Table 3: Native Assets Recognized by Prebid.js** @@ -101,15 +102,16 @@ Specific bidders may not support all of the fields listed below or may return di {% include dev-docs/native-image-asset-sizes.md %} -### 3.2 Native custom assets +### 3.2 Custom native assets -Prebid.js allows custom assets in order to fit some bidder's requirements through the special `mediaTypes.native.ext` key. The assets under this key will be whitelisted and could be retrieved during the rendering. +In order to fit special bidder requirements, Prebid.js supports assets beyond the standard set. Define custom attributes at mediaTypes.native.ext. When `sendTargetingKeys` is false, the assets under the `native.ext` key can be retrieved during the render. -The custom assets are declared in the same way as the Prebid standard ones. +Other than being under the `ext` object, custom assets are declared in the same way as the standard ones. -Note: on the rendering side, `native-render.js::renderNativeAd()` must be called with `requestAllAssets: true`. +{: .alert.alert-success :} +Note: The `native-render.js::renderNativeAd()` function must be called with `requestAllAssets: true`. -BidderAdapter should declare which custom assets they support in their own documentation. It is recommended to prefix the asset name with the bidderCode to avoid collision issues. +Bid adapters will declare which custom assets they support in their documentation. It is recommended to prefix the asset name with the bidderCode to avoid collision issues. ```javascript mediaTypes { @@ -118,13 +120,22 @@ mediaTypes { required: true }, ext: { - bidderCode_customAssetName: { + bidderA_specialtracking: { // custom asset required: false } } } ``` +In the native template, simply access the custom value with the normal Prebid ##macro## format assuming `hb_native_` as the prefix. For example: + +``` +
+ ... render a lovely creative ... + ... refer to ##hb_native_bidderA_specialtracking## when appropriate ... +
+``` + ## 4. Implementing the Native Template - If you want to manage your creative within the ad server (e.g. Google Ad Manager), follow the instructions for [AdServer-Defined Creative](#4-implementing-adserver-defined-creative). From ae28df5192523759c4878b2d91874b839fccf91b Mon Sep 17 00:00:00 2001 From: bretg Date: Wed, 3 Mar 2021 10:37:17 -0500 Subject: [PATCH 3/3] Update native-implementation.md --- prebid/native-implementation.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/prebid/native-implementation.md b/prebid/native-implementation.md index 2ff5267920..704fc5f89a 100644 --- a/prebid/native-implementation.md +++ b/prebid/native-implementation.md @@ -104,9 +104,7 @@ Specific bidders may not support all of the fields listed below or may return di ### 3.2 Custom native assets -In order to fit special bidder requirements, Prebid.js supports assets beyond the standard set. Define custom attributes at mediaTypes.native.ext. When `sendTargetingKeys` is false, the assets under the `native.ext` key can be retrieved during the render. - -Other than being under the `ext` object, custom assets are declared in the same way as the standard ones. +In order to fit special bidder requirements, Prebid.js supports defining assets beyond the standard set. Simply define custom attributes in mediaTypes.native.ext, and they can be retrieved at render time. Other than being under the `ext` object, custom assets are declared in the same way as the standard ones. {: .alert.alert-success :} Note: The `native-render.js::renderNativeAd()` function must be called with `requestAllAssets: true`.