Skip to content

Commit

Permalink
VidazooBidAdapter: get bid floor using bid.getFloor (prebid#9238)
Browse files Browse the repository at this point in the history
* feat(module): multi size request

* fix getUserSyncs
added tests

* update(module): package-lock.json from master

* feat(module): VidazooBidAdapter - send top query params to server

* added bid.getFloor handler

Co-authored-by: roman <shmoop207@gmail.com>
Co-authored-by: Saar Amrani <89377180+saar120@users.noreply.github.com>
Co-authored-by: Saar Amrani <saar120@gmail.com>
  • Loading branch information
4 people authored and jorgeluisrocha committed May 18, 2023
1 parent c85a722 commit 84ab49a
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions modules/vidazooBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {_each, deepAccess, parseSizesInput, parseUrl, uniques} from '../src/utils.js';
import { _each, deepAccess, parseSizesInput, parseUrl, uniques, isFn } from '../src/utils.js';
import { registerBidder } from '../src/adapters/bidderFactory.js';
import { BANNER } from '../src/mediaTypes.js';
import { getStorageManager } from '../src/storageManager.js';
Expand Down Expand Up @@ -59,7 +59,8 @@ function isBidRequestValid(bid) {

function buildRequest(bid, topWindowUrl, sizes, bidderRequest) {
const { params, bidId, userId, adUnitCode, schain } = bid;
const { bidFloor, ext } = params;
const { ext } = params;
let { bidFloor } = params;
const hashUrl = hashCode(topWindowUrl);
const dealId = getNextDealId(hashUrl);
const uniqueDealId = getUniqueDealId(hashUrl);
Expand All @@ -69,6 +70,18 @@ function buildRequest(bid, topWindowUrl, sizes, bidderRequest) {
const subDomain = extractSubDomain(params);
const ptrace = getCacheOpt();

if (isFn(bid.getFloor)) {
const floorInfo = bid.getFloor({
currency: 'USD',
mediaType: '*',
size: '*'
});

if (floorInfo.currency === 'USD') {
bidFloor = floorInfo.floor;
}
}

let data = {
url: encodeURIComponent(topWindowUrl),
uqs: getTopWindowQueryParams(),
Expand Down

0 comments on commit 84ab49a

Please sign in to comment.