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

One Video: Added banner support for Dynamic Ad Placement (DAP) #5199

Merged
merged 9 commits into from
May 18, 2020
Merged
Show file tree
Hide file tree
Changes from 6 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
31 changes: 27 additions & 4 deletions modules/oneVideoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import {registerBidder} from '../src/adapters/bidderFactory.js';
const BIDDER_CODE = 'oneVideo';
export const spec = {
code: 'oneVideo',
VERSION: '3.0.1',
VERSION: '3.0.2',
ENDPOINT: 'https://ads.adaptv.advertising.com/rtb/openrtb?ext_id=',
SYNC_ENDPOINT1: 'https://cm.g.doubleclick.net/pixel?google_nid=adaptv_dbm&google_cm&google_sc',
SYNC_ENDPOINT2: 'https://pr-bh.ybp.yahoo.com/sync/adaptv_ortb/{combo_uid}',
SYNC_ENDPOINT3: 'https://match.adsrvr.org/track/cmf/generic?ttd_pid=adaptv&ttd_tpi=1',
supportedMediaTypes: ['video'],
supportedMediaTypes: ['video', 'banner'],
/**
* Determines whether or not the given bid request is valid.
*
Expand All @@ -25,6 +25,17 @@ export const spec = {
return false;
}

// Prevend DAP Outstream validation
if (bid.mediaTypes.video) {
if (bid.mediaTypes.video.context === 'outstream' && bid.params.video.display === 1) {
return false;
}
}
// Banner DAP validation
if (bid.mediaTypes.banner && (typeof bid.params.video.display === 'undefined' || !bid.params.video.display)) {
adam-browning marked this conversation as resolved.
Show resolved Hide resolved
return false;
}

// Pub Id validation
if (typeof bid.params.pubId === 'undefined') {
return false;
Expand Down Expand Up @@ -82,18 +93,30 @@ export const spec = {
creativeId: bid.crid,
width: size.width,
height: size.height,
mediaType: 'video',
currency: response.cur,
ttl: 100,
netRevenue: true,
adUnitCode: bidRequest.adUnitCode
};

if (bidRequest.mediaTypes.banner) {
bidResponse.mediaType = 'banner'
} else {
bidResponse.mediaType = 'video'
}

adam-browning marked this conversation as resolved.
Show resolved Hide resolved
if (bid.nurl) {
bidResponse.vastUrl = bid.nurl;
} else if (bid.adm && bidRequest.params.video.display === 1) {
bidResponse.ad = bid.adm
} else if (bid.adm) {
bidResponse.vastXml = bid.adm;
}
bidResponse.renderer = (bidRequest.mediaTypes.video.context === 'outstream') ? newRenderer(bidRequest, bidResponse) : undefined;

if (bidRequest.mediaTypes.video) {
bidResponse.renderer = (bidRequest.mediaTypes.video.context === 'outstream') ? newRenderer(bidRequest, bidResponse) : undefined;
}

return bidResponse;
},
/**
Expand Down
217 changes: 148 additions & 69 deletions modules/oneVideoBidAdapter.md
Original file line number Diff line number Diff line change
@@ -1,89 +1,168 @@
# Overview

**Module Name**: One Video Bidder Adapter
**Module Type**: Bidder Adapter
**Module Type**: Bidder Adapter
**Maintainer**: deepthi.neeladri.sravana@verizonmedia.com

# Description

Connects to One Video demand source to fetch bids.
Connects to Verizon Media's Video SSP (AKA ONE Video / Adap.tv) demand source to fetch bids.


# Test Parameters for Video
# Instream Video adUnit example & parameters
*Note:* The Video SSP ad server will respond with an VAST XML to load into your defined player.
```
var adUnits = [
{
code: 'video1',
mediaTypes: {
video: {
context: 'instream',
playerSize: [480, 640]
}
},
bids: [
{
bidder: 'oneVideo',
params: {
video: {
playerWidth: 480,
playerHeight: 640,
mimes: ['video/mp4', 'application/javascript'],
protocols: [2,5],
api: [2],
position: 1,
delivery: [2],
playbackmethod: [1,5],
sid: <scpid>,
rewarded: 1,
placement: 1,
inventoryid: 123,
minduration: 10,
maxduration: 30,
},
site: {
id: 1,
page: 'https://verizonmedia.com',
referrer: 'https://verizonmedia.com'
},
pubId: 'HBExchange'
}
}
]
}
]
```
# Outstream Video adUnit example & parameters
*Note:* The Video SSP ad server will load it's own Outstream Renderer (player) as a fallback if no player is defined on the publisher page. The Outstream player will inject into the div id that has an identical adUnit code.
```
var adUnits = [
{
code: 'video1',
mediaTypes: {
video: {
context: 'outstream',
playerSize: [480, 640]
}
},
bids: [
{
bidder: 'oneVideo',
params: {
video: {
playerWidth: 480,
playerHeight: 640,
mimes: ['video/mp4', 'application/javascript'],
protocols: [2,5],
api: [2],
position: 1,
delivery: [2],
playbackmethod: [1,5],
sid: <scpid>,
rewarded: 1,
placement: 1,
inventoryid: 123,
minduration: 10,
maxduration: 30,
},
site: {
id: 1,
page: 'https://verizonmedia.com',
referrer: 'https://verizonmedia.com'
},
pubId: 'HBExchange'
}
}
]
}
]
```
var adUnits = [

{
# S2S / Video: Dynamic Ad Placement (DAP) adUnit example & parameters
*Note:* The Video SSP ad server will respond with HTML embed tag to be injected into an iFrame you create.
```
var adUnits = [
{
code: 'video1',
sizes: [640,480],
mediaTypes: {
video: {
context: "instream"
mediaTypes: {
video: {
context: "instream",
playerSize: [480, 640]
}
},
bids: [
{
bidder: 'oneVideo',
params: {
video: {
playerWidth: 480,
playerHeight: 640,
mimes: ['video/mp4', 'application/javascript'],
position: 1,
display: 1
},
site: {
id: 1,
page: 'https://verizonmedia.com',
referrer: 'https://verizonmedia.com'
},
pubId: 'HBExchangeDAP'
}
},
bids: [
{
bidder: 'oneVideo',
params: {
video: {
playerWidth: 480,
playerHeight: 640,
mimes: ['video/mp4', 'application/javascript'],
protocols: [2,5],
api: [2],
position: 1,
delivery: [2],
playbackmethod: [1,5],
sid: <scpid>,
rewarded: 1,
placement: 1,
inventoryid: 123,
minduration: 10,
maxduration: 30,
},
site: {
id: 1,
page: 'http://abhi12345.com',
referrer: 'http://abhi12345.com'
},
pubId: 'brxd'
}
}
]
}
]
}
]
```
# Test Parameters for banner request
# Prebid.js / Banner: Dynamic Ad Placement (DAP) adUnit example & parameters
*Note:* The Video SSP ad server will respond with HTML embed tag to be injected into an iFrame created by Google Ad Manager (GAM).
```
var adUnits = [
var adUnits = [
{
code: 'banner-1',
mediaTypes: {
banner: {
sizes: [300, 250]
}
},
bids: [
{
code: 'video1',
sizes: [640,480],
mediaTypes: {
video: {
context: "instream"
}
},
bids: [
{
bidder: 'oneVideo',
params: {
video: {
playerWidth: 480,
playerHeight: 640,
mimes: ['video/mp4', 'application/javascript'],
position: 1,
display: 1
},
site: {
id: 1,
page: 'http://abhi12345.com',
referrer: 'http://abhi12345.com'
},
pubId: 'OneMDisplay'
}
}
]
}
bidder: 'oneVideo',
params: {
video: {
playerWidth: 300,
playerHeight: 250,
mimes: ['video/mp4', 'application/javascript'],
display: 1
},
site: {
id: 1,
page: 'https://verizonmedia.com',
referrer: 'https://verizonmedia.com'
},
pubId: 'HBExchangeDAP'
}
}
]
}
]
```
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading