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

Added support for NURL and ADM responses #2031

Closed
wants to merge 62 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
b84b649
+ Added support for NURL and ADM responses
optimatic58 Jan 12, 2018
a5f059b
Use sudo to workaround Travis regression (#2041)
Jan 17, 2018
108f600
Adding districtm as an alias (#2018)
stevealliance Jan 17, 2018
4418fec
Serverbid Bid Adapter: updated docs and ad sizes (#2023)
jgrimes Jan 17, 2018
f09865b
GumGum Adapter for Prebid.js 1.0 (#1966)
mxcoder Jan 18, 2018
1e8155b
Media.net adapter added (#2038)
vedantseta Jan 22, 2018
25f1e5a
1.0 adapter support for mantis (#1840)
parisholley Jan 22, 2018
c58a158
Separate bids & won calls (#2015)
Yann-Pravo Jan 22, 2018
1b20a1c
OpenX Adapter: Update to support mediaTypes field, instead of the dep…
lntho Jan 22, 2018
c1d86ea
Add eplanningBidAdapter (#2003)
Nistenf Jan 22, 2018
6456959
Add vi bid adapter (#2020)
SnoopInf Jan 22, 2018
ecc34b6
Update Atomx adapter for Prebid v1.0 (#2026)
erikdubbelboer Jan 22, 2018
a264553
PubMatic 1.0 adapter (#2011)
PubMatic-OpenWrap Jan 23, 2018
9b56b11
Update adapter to prebid v1.0 (#1908)
Spacedragoon Jan 23, 2018
8907cae
InSkin Bidder Adapter (#2016)
jgrimes Jan 23, 2018
6cfaa5c
Colossus SSP header bidding adapter 1.0.0 (#2029)
Jan 23, 2018
e4eee81
pre1api module that allows use of deprecated pre1.0 API in Prebid 1.0…
snapwich Jan 23, 2018
24033ff
Support multiple media formats within a single ad unit (#1991)
matthewlane Jan 23, 2018
e39c58e
Fix skipped test (#2059)
matthewlane Jan 23, 2018
8b23ca1
Use cross-browser integer check (#2058)
matthewlane Jan 23, 2018
2eb8cdb
Optimera Adapter for 1.0. (#1961)
mcallari Jan 23, 2018
3e6f0fb
RockYou Adapter: Added RockYou Adapter supporting Prebid 1.0 (#1977)
cameronhotchkies Jan 23, 2018
261b9b4
Use polyfilled includes method (#2061)
matthewlane Jan 23, 2018
65c76ef
Prebid 1.2.0 Release
matthewlane Jan 23, 2018
c9af917
Increment pre version
matthewlane Jan 24, 2018
aa0bee7
Add display support for Vertamedia Adapter (#1945)
Millerrok Jan 24, 2018
f838057
Add video cache key (#2064)
moonshells Jan 25, 2018
548fce2
native is reserved keyword, use bracket/quotes to reference property …
kitwestneat Jan 25, 2018
104376b
Add Yieldlab adapter (#1967)
GEMI Jan 25, 2018
70781c9
Vidazoo bid adapter (#1916)
thewizarodofoz Jan 25, 2018
e818c6c
Add automatad alais to serverbid adapter. (#2062)
jcswart Jan 25, 2018
a534e0f
uncommenting utils_spec cookie tests, because no longer supporting IE…
harpere Jan 26, 2018
e14c719
Engine base url changed (#2072)
rade-popovic Jan 26, 2018
c449aec
C1X adapter updated to Prebid v1.0 (#1946)
CathyHuangtw Jan 30, 2018
40627d7
Add AdgenerationBidAdapter (#2034)
adg-dev Jan 30, 2018
017add7
Read secure fields to send requests (#2078)
Jan 30, 2018
9688c03
Support setting outstream renderer options (#2025)
matthewlane Jan 31, 2018
c654ebc
Yieldmo Bid Adapter Update (#2054)
MelodyLi2017 Jan 31, 2018
93ce52f
Added support for ad server currency; added ad unit sizes in test req…
jbartek25 Jan 31, 2018
06e916f
Make Bid Adapter for Dentsu Aegis Network Marketplace (#1982)
danmarketplace Feb 1, 2018
301cf31
Platform.io Bidder Adapter update. Support Native Ads. (#2009)
varashellov Feb 2, 2018
a35780d
Xendiz bid adapter (#1985)
Feb 2, 2018
0b98a8c
Bugfix - interpretResponse (#2082)
rade-popovic Feb 2, 2018
1c09041
Add support for mixed errors/bids response (#2052)
lovell Feb 2, 2018
2c7f7ed
pass empty responses array for registerSyncs in prebidserverBidAdapte…
snapwich Feb 2, 2018
d7c9350
Update ucfunnelBidAdapter (#1990)
RyanChouTw Feb 2, 2018
8a50184
Serverbid server optimization (#2048)
jcswart Feb 2, 2018
8b9c20b
Update vidazooBidAdapter.js (#2076)
thewizarodofoz Feb 2, 2018
9f412aa
add digitrust support to prebidserverBidAdapter (#2075)
snapwich Feb 2, 2018
7773f58
Pass app and device fields to Prebid server (#2044)
Feb 2, 2018
b69f351
Remove extraneous x. (#2096)
jcswart Feb 5, 2018
53ab63d
Adding Sonobi Bidder Adapter (#2033)
bansawbanchee Feb 5, 2018
77ad2f1
add peak adapter (#2040)
chanand Feb 5, 2018
5c37e60
Fix getUserSync test for ios (#2100)
MelodyLi2017 Feb 6, 2018
68b7d8b
PR / Issue Review process update (#2093)
bretg Feb 6, 2018
d48d7dd
Add hfa and pv parameter to request payload (#2109)
bansawbanchee Feb 6, 2018
16c9403
Serverbid Bid Adapter: getUserSyncs and new adsizes (#2106)
jgrimes Feb 6, 2018
8608201
Update adform adapter request (#2107)
Pupis Feb 6, 2018
4c71e65
Port calling order fix to 1.x (#2067)
kitwestneat Feb 6, 2018
aee2ef0
33across Bid Adapter: Bugfix + Refactor (#2024)
curlyblueeagle Feb 6, 2018
63463ca
+ Added support for NURL and ADM responses
optimatic58 Jan 12, 2018
b53f2a3
Merge branch 'optimatic-adapter' of https://github.com/optimatic58/Pr…
optimatic58 Feb 6, 2018
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
10 changes: 8 additions & 2 deletions modules/optimaticBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { registerBidder } from 'src/adapters/bidderFactory';
export const ENDPOINT = '//mg-bid.optimatic.com/adrequest/';

export const spec = {
version: '1.0.4',

code: 'optimatic',

supportedMediaTypes: ['video'],
Expand Down Expand Up @@ -33,7 +35,7 @@ export const spec = {
} catch (e) {
response = null;
}
if (!response || !bid || !bid.adm || !bid.price) {
if (!response || !bid || (!bid.adm && !bid.nurl) || !bid.price) {
utils.logWarn(`No valid bids from ${spec.code} bidder`);
return [];
}
Expand All @@ -43,14 +45,18 @@ export const spec = {
bidderCode: spec.code,
cpm: bid.price,
creativeId: bid.id,
vastXml: bid.adm,
width: size.width,
height: size.height,
mediaType: 'video',
currency: response.cur,
ttl: 300,
netRevenue: true
};
if (bid.nurl) {
bidResponse.vastUrl = bid.nurl;
} else if (bid.adm) {
bidResponse.vastXml = bid.adm;
}
return bidResponse;
}
};
Expand Down
42 changes: 40 additions & 2 deletions test/spec/modules/optimaticBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ describe('OptimaticBidAdapter', () => {
expect(bidResponse.length).to.equal(0);
});

it('should return no bids if the response "adm" is missing', () => {
it('should return no bids if the response "nurl" and "adm" are missing', () => {
const serverResponse = {seatbid: [{bid: [{price: 5.01}]}]};
const bidResponse = spec.interpretResponse({ body: serverResponse }, { bidRequest });
expect(bidResponse.length).to.equal(0);
Expand All @@ -118,7 +118,7 @@ describe('OptimaticBidAdapter', () => {
expect(bidResponse.length).to.equal(0);
});

it('should return a valid bid response', () => {
it('should return a valid bid response with just "adm"', () => {
const serverResponse = {seatbid: [{bid: [{id: 1, price: 5.01, adm: '<VAST></VAST>'}]}], cur: 'USD'};
const bidResponse = spec.interpretResponse({ body: serverResponse }, { bidRequest });
let o = {
Expand All @@ -136,5 +136,43 @@ describe('OptimaticBidAdapter', () => {
};
expect(bidResponse).to.deep.equal(o);
});

it('should return a valid bid response with just "nurl"', () => {
const serverResponse = {seatbid: [{bid: [{id: 1, price: 5.01, nurl: 'https://mg-bid-win.optimatic.com/win/134eb262-948a-463e-ad93-bc8b622d399c?wp=${AUCTION_PRICE}'}]}], cur: 'USD'};
const bidResponse = spec.interpretResponse({ body: serverResponse }, { bidRequest });
let o = {
requestId: bidRequest.bidId,
bidderCode: spec.code,
cpm: serverResponse.seatbid[0].bid[0].price,
creativeId: serverResponse.seatbid[0].bid[0].id,
vastUrl: serverResponse.seatbid[0].bid[0].nurl,
width: 640,
height: 480,
mediaType: 'video',
currency: 'USD',
ttl: 300,
netRevenue: true
};
expect(bidResponse).to.deep.equal(o);
});

it('should return a valid bid response with "nurl" when both nurl and adm exist', () => {
const serverResponse = {seatbid: [{bid: [{id: 1, price: 5.01, adm: '<VAST></VAST>', nurl: 'https://mg-bid-win.optimatic.com/win/134eb262-948a-463e-ad93-bc8b622d399c?wp=${AUCTION_PRICE}'}]}], cur: 'USD'};
const bidResponse = spec.interpretResponse({ body: serverResponse }, { bidRequest });
let o = {
requestId: bidRequest.bidId,
bidderCode: spec.code,
cpm: serverResponse.seatbid[0].bid[0].price,
creativeId: serverResponse.seatbid[0].bid[0].id,
vastUrl: serverResponse.seatbid[0].bid[0].nurl,
width: 640,
height: 480,
mediaType: 'video',
currency: 'USD',
ttl: 300,
netRevenue: true
};
expect(bidResponse).to.deep.equal(o);
});
});
});