Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gpt pre auction docs #2168

Merged
merged 4 commits into from
Jul 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions dev-docs/modules/gpt-pre-auction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
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

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 pass `fpd.context.adserver.adSlot` in the OpenRTB as `imp[].ext.context.data.adserver.adslot`

## How It Works

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.
1 change: 1 addition & 0 deletions dev-docs/modules/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) | 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

Expand Down