From 82fa21e7abd7b88b4a78db516e07d58e7b40ca34 Mon Sep 17 00:00:00 2001 From: idettman Date: Wed, 29 Jul 2020 11:15:46 -0700 Subject: [PATCH 1/4] add pbadslot docs --- dev-docs/modules/pbadslot.md | 43 ++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 dev-docs/modules/pbadslot.md diff --git a/dev-docs/modules/pbadslot.md b/dev-docs/modules/pbadslot.md new file mode 100644 index 0000000000..e56c9fb744 --- /dev/null +++ b/dev-docs/modules/pbadslot.md @@ -0,0 +1,43 @@ +--- +layout: page_v2 +page_type: module +title: Module - GPT Pre-Auction +description: Adds PB Ad Slot and matching GAM ad unit name to each ad unit's first-party data before bid requests are sent to the adapters +module_code : gptAPreAuction +display_name : GPT Pre-Auction +enable_download : false +sidebarType : 1 +--- + +# GPT Pre-Auction Module +{:.no_toc} + +* TOC +{:toc} + +## Overview + +New 'GPT Pre-Auction" module that, when enabled, will add PB Ad Slot and matching GAM ad unit name to each ad unit's first-party data before bid requests are sent to the adapters. + +* **Prebid Server Adapter** - pass fpd.context.adserver.name in the OpenRTB as imp[].ext.context.data.adserver.name and fpd.context.adserver.adSlot in the OpenRTB as imp[].ext.context.data.adserver.adslot + +## How It Works + +accept optional initialization parameters: +-ability to turn off module (on by default) +-customGptSlotMatching function +-customPbAdSlot function +if the module is on, use the BEFORE_REQUEST_BIDS hook to define a function that: +loops through each adunit in the auction +-maps the adunit to the GPT slot using the same algorithm as setTargetingForGPTAsync including customGptSlotMatching +-if GPT slot matching succeeded: +--set fpd.context.adserver.name to 'gam' +--copy the resulting GPT slot name to fpd.context.adserver.adSlot +-if customPbAdSlot function was specified, invoke it, writing the results to fpd.context.pbAdSlot. +-Else use a default algorithm to determine fpd.context.pbAdSlot: +--First use the AdUnit's context.pbAdSlot if defined +--Else, see if the AdUnit.code corresponds to a div and if so, try to retrieve a data element from the div called data-adslotid. +--Else if the GPT slot matching succeeded, use the GPT slot name +--Else, just use the AdUnit.code, assuming that that's the ad unit slot + +customGptSlotMatchingFunction should be function(adUnitCode). For targeting, each slot is being matched to an ad unit. Since the input from the hook is the list of ad units, this module will work the other way: loop over the ad units and try to match each to a slot. The function should return a filter function for slot. \ No newline at end of file From bea975f401b2c53a662597e13d4943d8def561a0 Mon Sep 17 00:00:00 2001 From: idettman Date: Wed, 29 Jul 2020 11:19:26 -0700 Subject: [PATCH 2/4] add pbadslot docs --- dev-docs/modules/{pbadslot.md => gpt-pre-auction.md} | 0 dev-docs/modules/index.md | 1 + 2 files changed, 1 insertion(+) rename dev-docs/modules/{pbadslot.md => gpt-pre-auction.md} (100%) diff --git a/dev-docs/modules/pbadslot.md b/dev-docs/modules/gpt-pre-auction.md similarity index 100% rename from dev-docs/modules/pbadslot.md rename to dev-docs/modules/gpt-pre-auction.md diff --git a/dev-docs/modules/index.md b/dev-docs/modules/index.md index 385b5545bc..ec0360b8ab 100644 --- a/dev-docs/modules/index.md +++ b/dev-docs/modules/index.md @@ -38,6 +38,7 @@ If you are looking for bidder adapter parameters, see [Bidders' Params]({{site.b | [**Browsi Viewability**]({{site.baseurl}}/dev-docs/modules/browsiRtdProvider.html) | Browsi provider for real time data module. | | [**Advanced Size Mapping**](/dev-docs/modules/sizeMappingV2.html) | Display Responsive AdUnits in demanding page environments. | | [**Price Floors Module**](/dev-docs/modules/floors.html) | Configure and enforce minimum bids. | +| [**GPT Pre-Auction Module**](/dev-docs/modules/gpt-pre-auction.html) | PB Ad Slot and matching GAM ad unit name to each ad unit's first-party data before bid requests are sent to the adapters. | ## Video Modules From 07784badf0420143111b6c6a98980bee61ee7574 Mon Sep 17 00:00:00 2001 From: Jean Stemp <38964447+jeanstemp@users.noreply.github.com> Date: Fri, 31 Jul 2020 12:18:54 -0700 Subject: [PATCH 3/4] Update index.md Minor edit --- dev-docs/modules/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-docs/modules/index.md b/dev-docs/modules/index.md index ec0360b8ab..c7731e994a 100644 --- a/dev-docs/modules/index.md +++ b/dev-docs/modules/index.md @@ -38,7 +38,7 @@ If you are looking for bidder adapter parameters, see [Bidders' Params]({{site.b | [**Browsi Viewability**]({{site.baseurl}}/dev-docs/modules/browsiRtdProvider.html) | Browsi provider for real time data module. | | [**Advanced Size Mapping**](/dev-docs/modules/sizeMappingV2.html) | Display Responsive AdUnits in demanding page environments. | | [**Price Floors Module**](/dev-docs/modules/floors.html) | Configure and enforce minimum bids. | -| [**GPT Pre-Auction Module**](/dev-docs/modules/gpt-pre-auction.html) | PB Ad Slot and matching GAM ad unit name to each ad unit's first-party data before bid requests are sent to the adapters. | +| [**GPT Pre-Auction Module**](/dev-docs/modules/gpt-pre-auction.html) | Adds a PB Ad Slot and matching GAM ad unit name to each ad unit's first-party data before bid requests are sent to the adapters. | ## Video Modules From 635c09c81640328f89d8cc8c7a894c4d21541e7b Mon Sep 17 00:00:00 2001 From: Jean Stemp <38964447+jeanstemp@users.noreply.github.com> Date: Fri, 31 Jul 2020 12:26:16 -0700 Subject: [PATCH 4/4] Update gpt-pre-auction.md fixing formatting issues --- dev-docs/modules/gpt-pre-auction.md | 46 ++++++++++++++++------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/dev-docs/modules/gpt-pre-auction.md b/dev-docs/modules/gpt-pre-auction.md index e56c9fb744..4e7f20e5e5 100644 --- a/dev-docs/modules/gpt-pre-auction.md +++ b/dev-docs/modules/gpt-pre-auction.md @@ -17,27 +17,33 @@ sidebarType : 1 ## Overview -New 'GPT Pre-Auction" module that, when enabled, will add PB Ad Slot and matching GAM ad unit name to each ad unit's first-party data before bid requests are sent to the adapters. +When enabled, this module will add PB Ad Slot and matching GAM ad unit name to each ad unit's first-party data before bid requests are sent to the adapters. -* **Prebid Server Adapter** - pass fpd.context.adserver.name in the OpenRTB as imp[].ext.context.data.adserver.name and fpd.context.adserver.adSlot in the OpenRTB as imp[].ext.context.data.adserver.adslot +* **Prebid Server Adapter** - pass `fpd.context.adserver.name` in the OpenRTB as `imp[].ext.context.data.adserver.name`, and pass `fpd.context.adserver.adSlot` in the OpenRTB as `imp[].ext.context.data.adserver.adslot` ## How It Works -accept optional initialization parameters: --ability to turn off module (on by default) --customGptSlotMatching function --customPbAdSlot function -if the module is on, use the BEFORE_REQUEST_BIDS hook to define a function that: -loops through each adunit in the auction --maps the adunit to the GPT slot using the same algorithm as setTargetingForGPTAsync including customGptSlotMatching --if GPT slot matching succeeded: ---set fpd.context.adserver.name to 'gam' ---copy the resulting GPT slot name to fpd.context.adserver.adSlot --if customPbAdSlot function was specified, invoke it, writing the results to fpd.context.pbAdSlot. --Else use a default algorithm to determine fpd.context.pbAdSlot: ---First use the AdUnit's context.pbAdSlot if defined ---Else, see if the AdUnit.code corresponds to a div and if so, try to retrieve a data element from the div called data-adslotid. ---Else if the GPT slot matching succeeded, use the GPT slot name ---Else, just use the AdUnit.code, assuming that that's the ad unit slot - -customGptSlotMatchingFunction should be function(adUnitCode). For targeting, each slot is being matched to an ad unit. Since the input from the hook is the list of ad units, this module will work the other way: loop over the ad units and try to match each to a slot. The function should return a filter function for slot. \ No newline at end of file +Accepts optional initialization parameters: + +- ability to turn off module (on by default) +- customGptSlotMatching function +- customPbAdSlot function + +If the module is on, use the BEFORE_REQUEST_BIDS hook to define a function that: + +- loops through each adunit in the auction +- maps the adunit to the GPT slot using the same algorithm as setTargetingForGPTAsync including customGptSlotMatching + +If GPT slot matching succeeded: + +- set fpd.context.adserver.name to 'gam' +- copy the resulting GPT slot name to fpd.context.adserver.adSlot + +If customPbAdSlot function was specified, invoke it, writing the results to fpd.context.pbAdSlot. If not, use a default algorithm to determine fpd.context.pbAdSlot: + +- first use the AdUnit's context.pbAdSlot if defined +- else, see if the AdUnit.code corresponds to a div and if so, try to retrieve a data element from the div called data-adslotid. +- else if the GPT slot matching succeeded, use the GPT slot name +- else, just use the AdUnit.code, assuming that that's the ad unit slot + +customGptSlotMatchingFunction should be function(adUnitCode). For targeting, each slot is being matched to an ad unit. Since the input from the hook is the list of ad units, this module will work the other way: loop over the ad units and try to match each to a slot. The function should return a filter function for slot.