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

Feature/grue 339 merge to master #15

Merged
merged 22 commits into from
Jan 17, 2023
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
1238d30
Appnexus Bid Adapter : add video data from the request to the bid res…
torstendunkel Jan 5, 2023
978926d
AdagioBidAdapter: Remove some params (#9398)
osazos Jan 5, 2023
408221b
Feedad Bid Adapter: added new bid request parameters (#9397)
couchcrew-thomas Jan 5, 2023
768c1d3
Yieldlab Bid Adapter: code style updates (#9386)
kippsterr Jan 6, 2023
005d277
GPP support for the yahoo connect id module. (#9399)
radubarbos Jan 6, 2023
f5a4078
yahoospp bidder& aol bidder: GPP Support in bid requests (#9345)
radubarbos Jan 8, 2023
8afae69
Orbitsoft Bid Adapter : add adapter back to current version (#9288)
VitalyOrbit Jan 9, 2023
11d4433
extract-gpid (#9401)
ahmadlob Jan 9, 2023
b739b29
Yieldmo Adapter: Add support for structured user agent (#9380)
desidiver Jan 9, 2023
dee8f35
appnnexus bid adapter - support for adomain (#9403)
jsnellbaker Jan 9, 2023
ed6d8aa
smartx Bid Adapter: add support for sitekey (#9408)
Skylinar Jan 10, 2023
82ea027
Adloox RTD Module: fix breakage since 7.x release (#9383)
jimdigriz Jan 10, 2023
3cd452d
JW Player Video Module: trigger error when missing div id (#9407)
karimMourra Jan 12, 2023
ea51147
add gppConsent (#9415)
dalmenarDevST Jan 12, 2023
d766968
ssp added to meta.demandSource (#9409)
gchicoye Jan 12, 2023
9f0320f
GRUE-339 Updated test to cover Safari handling.
Tonsil Jan 12, 2023
578bcac
adds a safety check (#9420)
Jan 13, 2023
aa8ec7a
GRUE-340 Updated the variable name for the cookieless domain, to remo…
Tonsil Jan 13, 2023
49bf037
Alkimi Bid Adapter: using the floors convention (#9368)
pro-nsk Jan 13, 2023
e7c0872
init new Appush adapter (#9346)
nitzanappush Jan 16, 2023
a4a6513
Merge branch 'master' of github.com:Lotame/Prebid.js
Tonsil Jan 17, 2023
be88fac
Merge branch 'lotamePanoramaIdSystem_safariHandling' into feature/GRU…
Tonsil Jan 17, 2023
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
Prev Previous commit
Next Next commit
Alkimi Bid Adapter: using the floors convention (prebid#9368)
* Alkimi bid adapter

* Alkimi bid adapter

* Alkimi bid adapter

* alkimi adapter

* onBidWon change

* sign utils

* auction ID as bid request ID

* unit test fixes

* change maintainer info

* Updated the ad unit params

* features support added

* transfer adUnitCode

* transfer adUnitCode: test

* AlkimiBidAdapter getFloor() using

Co-authored-by: Alexander Bogdanov <akascheev@asteriosoft.com>
Co-authored-by: Kalidas Engaiahraj <kalidas@alkimiexchange.com>
Co-authored-by: mihanikw2g <92710748+mihanikw2g@users.noreply.github.com>
Co-authored-by: Nikulin Mikhail <mnikulin@asteriosoft.com>
  • Loading branch information
5 people authored Jan 13, 2023
commit 49bf03728146399c1859f31f24368b1de09208ee
29 changes: 23 additions & 6 deletions modules/alkimiBidAdapter.js
Original file line number Diff line number Diff line change
@@ -20,18 +20,20 @@ export const spec = {
let bidIds = [];
let eids;
validBidRequests.forEach(bidRequest => {
let sizes = prepareSizes(bidRequest.sizes)
let formatType = getFormatType(bidRequest)
let alkimiSizes = prepareAlkimiSizes(bidRequest.sizes)

if (bidRequest.userIdAsEids) {
eids = eids || bidRequest.userIdAsEids
}

bids.push({
token: bidRequest.params.token,
pos: bidRequest.params.pos,
bidFloor: bidRequest.params.bidFloor,
width: sizes[0].width,
height: sizes[0].height,
impMediaType: getFormatType(bidRequest),
bidFloor: getBidFloor(bidRequest, formatType),
width: alkimiSizes[0].width,
height: alkimiSizes[0].height,
impMediaType: formatType,
adUnitCode: bidRequest.adUnitCode
})
bidIds.push(bidRequest.bidId)
@@ -128,10 +130,25 @@ export const spec = {
}
}

function prepareSizes(sizes) {
function prepareAlkimiSizes(sizes) {
return sizes && sizes.map(size => ({ width: size[0], height: size[1] }));
}

function prepareBidFloorSize(sizes) {
return sizes && sizes.length === 1 ? sizes[0] : '*';
}

function getBidFloor(bidRequest, formatType) {
if (typeof bidRequest.getFloor === 'function') {
const bidFloorSize = prepareBidFloorSize(bidRequest.sizes)
const floor = bidRequest.getFloor({ currency: 'USD', mediaType: formatType.toLowerCase(), size: bidFloorSize });
if (floor && !isNaN(floor.floor) && (floor.currency === 'USD')) {
return floor.floor;
}
}
return bidRequest.params.bidFloor;
}

const getFormatType = bidRequest => {
if (deepAccess(bidRequest, 'mediaTypes.banner')) return 'Banner'
if (deepAccess(bidRequest, 'mediaTypes.video')) return 'Video'
18 changes: 15 additions & 3 deletions test/spec/modules/alkimiBidAdapter_spec.js
Original file line number Diff line number Diff line change
@@ -108,7 +108,7 @@ describe('alkimiBidAdapter', function () {

describe('buildRequests', function () {
let bidRequests = [REQUEST]
const bidderRequest = spec.buildRequests(bidRequests, {
let requestData = {
auctionId: '123',
refererInfo: {
page: 'http://test.com/path.html'
@@ -119,7 +119,8 @@ describe('alkimiBidAdapter', function () {
gdprApplies: true
},
uspConsent: 'uspConsent'
})
}
const bidderRequest = spec.buildRequests(bidRequests, requestData)

it('should return a properly formatted request with eids defined', function () {
expect(bidderRequest.data.eids).to.deep.equal(REQUEST.userIdAsEids)
@@ -138,7 +139,7 @@ describe('alkimiBidAdapter', function () {
expect(bidderRequest.method).to.equal('POST')
expect(bidderRequest.data.requestId).to.equal('123')
expect(bidderRequest.data.referer).to.equal('http://test.com/path.html')
expect(bidderRequest.data.schain).to.deep.contains({ver: '1.0', complete: 1, nodes: [{asi: 'alkimi-onboarding.com', sid: '00001', hp: 1}]})
expect(bidderRequest.data.schain).to.deep.contains({ ver: '1.0', complete: 1, nodes: [{ asi: 'alkimi-onboarding.com', sid: '00001', hp: 1 }] })
expect(bidderRequest.data.signRequest.bids).to.deep.contains({ token: 'e64782a4-8e68-4c38-965b-80ccf115d46f', pos: 7, bidFloor: 0.1, width: 300, height: 250, impMediaType: 'Banner', adUnitCode: 'bannerAdUnitCode' })
expect(bidderRequest.data.signRequest.randomUUID).to.equal(undefined)
expect(bidderRequest.data.bidIds).to.deep.contains('456')
@@ -147,6 +148,17 @@ describe('alkimiBidAdapter', function () {
expect(bidderRequest.options.contentType).to.equal('application/json')
expect(bidderRequest.url).to.equal(ENDPOINT)
})

it('sends bidFloor when configured', () => {
const requestWithFloor = Object.assign({}, REQUEST);
requestWithFloor.getFloor = function (arg) {
if (arg.currency === 'USD' && arg.mediaType === 'banner' && JSON.stringify(arg.size) === JSON.stringify([300, 250])) {
return { currency: 'USD', floor: 0.3 }
}
}
const bidderRequestFloor = spec.buildRequests([requestWithFloor], requestData);
expect(bidderRequestFloor.data.signRequest.bids[0].bidFloor).to.be.equal(0.3);
});
})

describe('interpretResponse', function () {