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

Adpone Bid Adapter: remove usersync and pass gpdr via querystring #6326

Merged
merged 97 commits into from
Apr 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
c390301
remove usersync and add gpdr via querystring
seergiioo6 Feb 18, 2021
20cf945
kick off CircleCI tests
Mar 2, 2021
94dea84
mediasquare fix userId (#6321)
matthieularere-msq Feb 18, 2021
39e33d1
Change the EU consent string parameter name to the company-wide stand…
slimkrazy Feb 18, 2021
0d9b088
adding support in pbsAdapter for getFloor (#6273)
robertrmartinez Feb 18, 2021
b3293e9
AdHash Bidder Adapter: initial prebid.js integration (#6274)
wyand-sp Feb 18, 2021
a397ae1
PBJS Video Cache Update (#6295)
mmoschovas Feb 19, 2021
1beebbd
Support bidder aliasing by not using bid.bidder to retrieve configs (…
cciocov Feb 19, 2021
8cbd273
Fabrick ID System : updates to _setReferrer and appending urls (#6322)
andersonbd1 Feb 19, 2021
b1f1d17
Configureable option to delay auction event + fix bug with googletag …
robertrmartinez Feb 23, 2021
4bfc62a
Adhese Bid Adapter: replace id5 with eid (#6339)
mefjush Feb 23, 2021
1f19794
FID-287: Update Reconciliation RTD delivery id format (#6343)
vfedoseev Feb 23, 2021
420e435
Inskin Bid Adapter: send screen size in the ad call (#6316)
cciocov Feb 23, 2021
1c293a8
Ozone Bid Adapter: added or updated support for multiple modules (#6324)
afsheenb Feb 24, 2021
06bcf9f
Triplelift Bid Adapter: add PubCommon ID support (#6352)
nllerandi3lift Feb 24, 2021
18d07ca
Prebid 4.28.0 Release
Feb 24, 2021
4279d19
Increment pre version
Feb 24, 2021
a8e1d37
GMOSSP Bid Adapter : add refererInfo from bidderRequest (#6319)
KazuakiM Feb 25, 2021
f2ca498
Axonix Bid Adapter: add new bid adapter (#6341)
cesarfd Feb 25, 2021
63d8b6b
Documentation: Prebid Server and Postbid integration example ( ad ser…
ysfbsf Feb 25, 2021
bb3acb9
Native: add custom data assets capability (#6220)
osazos Feb 25, 2021
06b4742
iPROM adapter upload - adapter (#6334)
iprom-adserver Feb 25, 2021
2a5ee8c
Ucfunnel Bid Adapter: update currency parameter in ad response (#6357)
jackhsiehucf Feb 26, 2021
3b31cf4
TheMediaGrid Bid Adapter: fix trouble with alias using (#6363)
TheMediaGrid Mar 1, 2021
c0d1b14
Rubicon Analytics Adapter: pass along advertiserDomains (#6356)
robertrmartinez Mar 1, 2021
4f4b49e
support setting coopSync in s2sConfig (#6330)
msm0504 Mar 2, 2021
c746982
TrustX Bid Adapter: Fix alias error (#6373)
PWyrembak Mar 2, 2021
4d90576
Adform Bid Adapter: add global targeting to the request query as para…
Pupis Mar 2, 2021
ee05c41
Prebid 4.29.0 Release
smenzer Mar 2, 2021
57d14e1
Increment pre version
smenzer Mar 2, 2021
6debd2b
Gamoshi Bid Adapter: update adaptor aliases (#6355)
Mar 2, 2021
e5bd7f2
Marsmedia Bid Adapter: add support for viewability, floor price modul…
vladi-mmg Mar 2, 2021
a821c84
fix bidderRequest matching for finding a renderer (#6359)
JulieLorin Mar 4, 2021
1b0d7b8
Seedtag Bid Adapter: add support for inArticle placement (#6369)
lauramorillo Mar 4, 2021
8432c42
improve robustness on OnEvent fields (#6384)
guiann Mar 4, 2021
11017ae
oneVideo Bid Adapter: remove adapter adId because of conflict with pb…
adam-browning Mar 4, 2021
86bb938
PBS Bid Adapter: add dchain (demand chain object) to prebid server ad…
patmmccann Mar 4, 2021
ad649b7
Gulp Build: fix to populate modules list when gulp bundle is executed…
pm-harshad-mane Mar 5, 2021
3ae5ea0
Smartx Bid Adapter: updated out-stream render to support smartPlay 5.…
Skylinar Mar 5, 2021
d474a46
Fpd 2.0 Update (#6293)
mmoschovas Mar 5, 2021
25459d4
PBS Bid Adapter: fix s2s alias collision with built-in adapter aliasi…
Mar 8, 2021
1d7ab80
Clean side-effect when checking that local storage is enabled (#6323)
TurpIF Mar 8, 2021
387394d
updates docs and demo for fpd changes (#6302)
karimMourra Mar 9, 2021
e089f70
Changed net revenue to True (#6387)
pm-azhar-mulla Mar 9, 2021
fe93361
adagioBidAdapter: add Native support (#6368)
osazos Mar 9, 2021
3648cfd
EIDS Support Update (#6394)
rtuschkany Mar 10, 2021
d7c0fd7
TheMediaGridNM Bid Adapter: fix trouble with alias (#6371)
TheMediaGrid Mar 10, 2021
8de0498
Grab sourceAgnostic IDs first, then fallback to regular IDs (#6400)
robertrmartinez Mar 10, 2021
306d59f
Permutive - add AC support for TrustX (#6393)
dreischer Mar 10, 2021
261d1b3
SmartRTB Bid Adapter: add alias and update valid opts (#6365)
evanmsmrtb Mar 10, 2021
26f52ac
Prebid 4.30.0 Release
robertrmartinez Mar 10, 2021
f5fb640
Increment pre version
robertrmartinez Mar 10, 2021
c0073f5
Sonobi Bid Adapter: send eids in bid request. (#6364)
JonGoSonobi Mar 11, 2021
e2db950
Apacdex Bid Adapter: userId module support, show demo ads in debug mo…
thuyhq Mar 12, 2021
1a47cd3
Novatiq ID System: add snowflake userId submodule (#6350)
Mar 12, 2021
0e7cbea
Rise Bid Adapter: add session_id & is_wrapper params to adapter (#6407)
lasloche Mar 15, 2021
ca646a8
IronSource Bid Adapter: add session_id & is_wrapper params to adapter…
lasloche Mar 15, 2021
e51d1fa
AMX Bid Adapter: add or update general adapter support and code refac…
nickjacob Mar 15, 2021
926c6d0
VOX Bid adapter, Hybrid Bid adapter: fix global var name to avoid con…
hybrid-ai Mar 16, 2021
97e033d
LiveIntent Id System: fix for parsing response twice (#6418)
Mar 16, 2021
7eddc4b
PBJS Core: use mediaType renderer when backupOnly and no bid.renderer…
aleksatr Mar 16, 2021
a8f8b89
GumGum Bid Adapter: pass bidfloor currency in bidrequest (#6391)
susyt Mar 16, 2021
97f71b2
Documentation: fixed a typo and sentence structure (#6421)
ChrisHuie Mar 17, 2021
ff1890d
Bid Glass Bid Adapter: pass options in bid request (#6424)
dliebner Mar 17, 2021
5688fee
Spotx Bid Adapter: add publisher support for cache.ignoreBidderCacheK…
npeceniak Mar 17, 2021
5adeb0a
update prebid adapter. Add at, ccpa, gdpr and coppa support (#6405)
BizzClick Mar 17, 2021
620acff
Qwarry Bid Adapter: add referer detection (#6412)
pro-nsk Mar 17, 2021
69872ef
Smartyads Bid Adapter: add coppa field from config (#6402)
SmartyAdsSSP Mar 17, 2021
d3bf135
PBS Bid Adapter: Fpd2.0 bug fix for first party data issue (#6428)
mmoschovas Mar 17, 2021
f7ac0ba
Prebid 4.31.0 Release
Mar 17, 2021
0d1a30e
Increment pre version
Mar 17, 2021
4104179
a4g Bid Adapter: delete adid and use crid if it exists (#6409)
Junus Mar 18, 2021
c58c609
Mediawallah ID System: add openlink userId submodule (#5921)
ericrenebrown Mar 18, 2021
25e857f
Documentation: Adjust desired bitrate examples smartx adapter (#6438)
Skylinar Mar 18, 2021
35ec006
Remove adId (autogenerated by Prebid) (#6441)
jbartek25 Mar 18, 2021
30baced
RichAudience Bid Adapter: add render video in banner (#6392)
richaudience Mar 19, 2021
78605f3
Integration Example: ID import library example (#6434)
SKOCHERI Mar 19, 2021
4412b08
Mass Module: add module to support MASS protocol (#6332)
cciocov Mar 19, 2021
03eac74
Axonix bid adapter: set both connectiontype & effectivetype in the re…
Mar 19, 2021
f0db266
Sublime Bid Adapter: v0.7.1 & add extra information in tracking pixel…
JeremiePat Mar 19, 2021
7b189d7
Interactive Offers Bid Adapter: add new bid adapter (#6399)
IOTiagoFaria Mar 19, 2021
2ba0c96
AdYouLike Bid Adapter: replace shorthand "image" native config (#6401)
guiann Mar 19, 2021
55f0e39
AMX Bid Adapter: Video Bugfix (#6435)
nickjacob Mar 19, 2021
b35dd05
LiveWrapper Bid Adapter: use userIdAsEids to handle all user ids (#6445)
bjorn-lw Mar 19, 2021
12266da
wrap tests under describe adponeBidAdapter
seergiioo6 Mar 23, 2021
ebf1ca5
fix tests
seergiioo6 Mar 25, 2021
52a3720
revert
seergiioo6 Mar 25, 2021
9184546
merge master
seergiioo6 Apr 6, 2021
61a8431
fix merge
seergiioo6 Apr 6, 2021
d619ad0
fix merge
seergiioo6 Apr 6, 2021
980fd0f
fix merge
seergiioo6 Apr 6, 2021
867a4a3
fix merge
seergiioo6 Apr 6, 2021
c2db510
fix merge
seergiioo6 Apr 6, 2021
5461641
remove bid.meta.advertiserDomains
seergiioo6 Apr 6, 2021
e97e027
support adomain
seergiioo6 Apr 6, 2021
c817b3d
fix adpone advertiserDomains
seergiioo6 Apr 13, 2021
7f49d42
fix test
seergiioo6 Apr 14, 2021
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
56 changes: 28 additions & 28 deletions modules/adponeBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,20 @@ import {triggerPixel} from '../src/utils.js';

const ADPONE_CODE = 'adpone';
const ADPONE_ENDPOINT = 'https://rtb.adpone.com/bid-request';
const ADPONE_SYNC_ENDPOINT = 'https://eu-ads.adpone.com';
const ADPONE_REQUEST_METHOD = 'POST';
const ADPONE_CURRENCY = 'EUR';

function _createSync() {
return {
type: 'iframe',
url: ADPONE_SYNC_ENDPOINT
}
}

function getUserSyncs(syncOptions) {
return (syncOptions && syncOptions.iframeEnabled) ? _createSync() : ([]);
}

export const spec = {
code: ADPONE_CODE,
supportedMediaTypes: [BANNER],

getUserSyncs,

isBidRequestValid: bid => {
return !!bid.params.placementId && !!bid.bidId && bid.bidder === 'adpone'
},

buildRequests: bidRequests => {
buildRequests: (bidRequests, bidderRequest) => {
return bidRequests.map(bid => {
const url = ADPONE_ENDPOINT + '?pid=' + bid.params.placementId;
let url = ADPONE_ENDPOINT + '?pid=' + bid.params.placementId;
const data = {
at: 1,
id: bid.bidId,
Expand All @@ -49,6 +35,11 @@ export const spec = {
withCredentials: true
};

if (bidderRequest && bidderRequest.gdprConsent) {
url += '&gdpr_applies=' + bidderRequest.gdprConsent.gdprApplies;
url += '&consentString=' + bidderRequest.gdprConsent.consentString;
}

return {
method: ADPONE_REQUEST_METHOD,
url,
Expand All @@ -67,18 +58,27 @@ export const spec = {

serverResponse.body.seatbid.forEach(seatbid => {
if (seatbid.bid.length) {
answer = [...answer, ...seatbid.bid.filter(bid => bid.price > 0).map(bid => ({
id: bid.id,
requestId: bidRequest.data.id,
cpm: bid.price,
ad: bid.adm,
width: bid.w || 0,
height: bid.h || 0,
currency: serverResponse.body.cur || ADPONE_CURRENCY,
netRevenue: true,
ttl: 300,
creativeId: bid.crid || 0
}))];
answer = [...answer, ...seatbid.bid.filter(bid => bid.price > 0).map(adponeBid => {
const bid = {
id: adponeBid.id,
requestId: bidRequest.data.id,
cpm: adponeBid.price,
ad: adponeBid.adm,
width: adponeBid.w || 0,
height: adponeBid.h || 0,
currency: serverResponse.body.cur || ADPONE_CURRENCY,
netRevenue: true,
ttl: 300,
creativeId: adponeBid.crid || 0
};

if (adponeBid.meta && adponeBid.meta.adomain && adponeBid.meta.adomain.length > 0) {
bid.meta = {};
bid.meta.advertiserDomains = adponeBid.meta.adomain;
}

return bid
})];
}
});

Expand Down
203 changes: 95 additions & 108 deletions test/spec/modules/adponeBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,122 +110,109 @@ describe('adponeBidAdapter', function () {
expect(spec.isBidRequestValid(invalidBid)).to.be.false;
});
});
});

describe('interpretResponse', function () {
let serverResponse;
let bidRequest = { data: {id: '1234'} };

beforeEach(function () {
serverResponse = {
body: {
id: '2579e20c0bb89',
seatbid: [
{
bid: [
{
id: '613673EF-A07C-4486-8EE9-3FC71A7DC73D',
impid: '2579e20c0bb89_0',
price: 1,
adm: '<html><a href="https://www.adpone.com" target="_blank"><img src ="https://placehold.it/300x250" /></a></html>',
adomain: [
'www.addomain.com'
],
iurl: 'https://localhost11',
crid: 'creative111',
h: 250,
w: 300,
ext: {
dspid: 6
describe('interpretResponse', function () {
let serverResponse;
let bidRequest = { data: {id: '1234'} };

beforeEach(function () {
serverResponse = {
body: {
id: '2579e20c0bb89',
seatbid: [
{
bid: [
{
id: '613673EF-A07C-4486-8EE9-3FC71A7DC73D',
impid: '2579e20c0bb89_0',
price: 1,
adm: '<html><a href="https://www.adpone.com" target="_blank"><img src ="https://placehold.it/300x250" /></a></html>',
meta: {
adomain: [
'adpone.com'
]
},
iurl: 'https://localhost11',
crid: 'creative111',
h: 250,
w: 300,
ext: {
dspid: 6
}
}
}
],
seat: 'adpone'
}
],
cur: 'USD'
},
};
});

it('validate_response_params', function() {
const newResponse = spec.interpretResponse(serverResponse, bidRequest);
expect(newResponse[0].id).to.be.equal('613673EF-A07C-4486-8EE9-3FC71A7DC73D');
expect(newResponse[0].requestId).to.be.equal('1234');
expect(newResponse[0].cpm).to.be.equal(1);
expect(newResponse[0].width).to.be.equal(300);
expect(newResponse[0].height).to.be.equal(250);
expect(newResponse[0].currency).to.be.equal('USD');
expect(newResponse[0].netRevenue).to.be.equal(true);
expect(newResponse[0].ttl).to.be.equal(300);
expect(newResponse[0].ad).to.be.equal('<html><a href="https://www.adpone.com" target="_blank"><img src ="https://placehold.it/300x250" /></a></html>');
});
],
seat: 'adpone'
}
],
cur: 'USD'
},
};
});

it('should correctly reorder the server response', function () {
const newResponse = spec.interpretResponse(serverResponse, bidRequest);
expect(newResponse.length).to.be.equal(1);
expect(newResponse[0]).to.deep.equal({
id: '613673EF-A07C-4486-8EE9-3FC71A7DC73D',
requestId: '1234',
cpm: 1,
width: 300,
height: 250,
creativeId: 'creative111',
currency: 'USD',
netRevenue: true,
ttl: 300,
ad: '<html><a href="https://www.adpone.com" target="_blank"><img src ="https://placehold.it/300x250" /></a></html>'
it('validate_response_params', function() {
const newResponse = spec.interpretResponse(serverResponse, bidRequest);
expect(newResponse[0].id).to.be.equal('613673EF-A07C-4486-8EE9-3FC71A7DC73D');
expect(newResponse[0].requestId).to.be.equal('1234');
expect(newResponse[0].cpm).to.be.equal(1);
expect(newResponse[0].width).to.be.equal(300);
expect(newResponse[0].height).to.be.equal(250);
expect(newResponse[0].currency).to.be.equal('USD');
expect(newResponse[0].netRevenue).to.be.equal(true);
expect(newResponse[0].ttl).to.be.equal(300);
expect(newResponse[0].ad).to.be.equal('<html><a href="https://www.adpone.com" target="_blank"><img src ="https://placehold.it/300x250" /></a></html>');
});
});

it('should not add responses if the cpm is 0 or null', function () {
serverResponse.body.seatbid[0].bid[0].price = 0;
let response = spec.interpretResponse(serverResponse, bidRequest);
expect(response).to.deep.equal([]);
it('should correctly reorder the server response', function () {
const newResponse = spec.interpretResponse(serverResponse, bidRequest);
expect(newResponse.length).to.be.equal(1);
expect(newResponse[0]).to.deep.equal({
id: '613673EF-A07C-4486-8EE9-3FC71A7DC73D',
meta: {
advertiserDomains: [
'adpone.com'
]
},
requestId: '1234',
cpm: 1,
width: 300,
height: 250,
creativeId: 'creative111',
currency: 'USD',
netRevenue: true,
ttl: 300,
ad: '<html><a href="https://www.adpone.com" target="_blank"><img src ="https://placehold.it/300x250" /></a></html>'
});
});

serverResponse.body.seatbid[0].bid[0].price = null;
response = spec.interpretResponse(serverResponse, bidRequest);
expect(response).to.deep.equal([])
});
it('should add responses if the cpm is valid', function () {
serverResponse.body.seatbid[0].bid[0].price = 0.5;
let response = spec.interpretResponse(serverResponse, bidRequest);
expect(response).to.not.deep.equal([]);
});
});
it('should not add responses if the cpm is 0 or null', function () {
serverResponse.body.seatbid[0].bid[0].price = 0;
let response = spec.interpretResponse(serverResponse, bidRequest);
expect(response).to.deep.equal([]);

describe('getUserSyncs', function () {
it('Verifies that getUserSyncs is a function', function () {
expect((typeof (spec.getUserSyncs)).should.equals('function'));
});
it('Verifies getUserSyncs returns expected result', function () {
expect((typeof (spec.getUserSyncs)).should.equals('function'));
expect(spec.getUserSyncs({iframeEnabled: true})).to.deep.equal({
type: 'iframe',
url: 'https://eu-ads.adpone.com'
serverResponse.body.seatbid[0].bid[0].price = null;
response = spec.interpretResponse(serverResponse, bidRequest);
expect(response).to.deep.equal([])
});
it('should add responses if the cpm is valid', function () {
serverResponse.body.seatbid[0].bid[0].price = 0.5;
let response = spec.interpretResponse(serverResponse, bidRequest);
expect(response).to.not.deep.equal([]);
});
});
it('Verifies that iframeEnabled: false returns an empty array', function () {
expect(spec.getUserSyncs({iframeEnabled: false})).to.deep.equal(EMPTY_ARRAY);
});
it('Verifies that iframeEnabled: null returns an empty array', function () {
expect(spec.getUserSyncs(null)).to.deep.equal(EMPTY_ARRAY);
});
});

describe('test onBidWon function', function () {
beforeEach(function() {
sinon.stub(utils, 'triggerPixel');
});
afterEach(function() {
utils.triggerPixel.restore();
});
it('exists and is a function', () => {
expect(spec.onBidWon).to.exist.and.to.be.a('function');
});
it('should return nothing', function () {
var response = spec.onBidWon({});
expect(response).to.be.an('undefined')
expect(utils.triggerPixel.called).to.equal(true);
describe('test onBidWon function', function () {
beforeEach(function() {
sinon.stub(utils, 'triggerPixel');
});
afterEach(function() {
utils.triggerPixel.restore();
});
it('exists and is a function', () => {
expect(spec.onBidWon).to.exist.and.to.be.a('function');
});
it('should return nothing', function () {
var response = spec.onBidWon({});
expect(response).to.be.an('undefined')
expect(utils.triggerPixel.called).to.equal(true);
});
});
});