Skip to content

Commit

Permalink
Adkernel Bid Adapter: add voisetech alias (#11942)
Browse files Browse the repository at this point in the history
* Adkernel Bid Adapter: add voisetech alias

* Adkernel Bid Adapter: add voisetech alias
  • Loading branch information
ckbo3hrk authored Jul 8, 2024
1 parent 3511b54 commit c140dc0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 25 deletions.
11 changes: 11 additions & 0 deletions libraries/adkernelUtils/adkernelUtils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export function getBidFloor(bid, mediaType, sizes) {
var floor;
var size = sizes.length === 1 ? sizes[0] : '*';
if (typeof bid.getFloor === 'function') {
const floorInfo = bid.getFloor({currency: 'USD', mediaType, size});
if (typeof floorInfo === 'object' && floorInfo.currency === 'USD' && !isNaN(parseFloat(floorInfo.floor))) {
floor = parseFloat(floorInfo.floor);
}
}
return floor;
}
13 changes: 1 addition & 12 deletions modules/adkernelAdnBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {deepAccess, deepSetValue, isArray, isNumber, isStr, logInfo, parseSizesI
import {registerBidder} from '../src/adapters/bidderFactory.js';
import {BANNER, VIDEO} from '../src/mediaTypes.js';
import {config} from '../src/config.js';
import {getBidFloor} from '../libraries/adkernelUtils/adkernelUtils.js'

const DEFAULT_ADKERNEL_DSP_DOMAIN = 'tag.adkernel.com';
const DEFAULT_MIMES = ['video/mp4', 'video/webm', 'application/x-shockwave-flash', 'application/javascript'];
Expand Down Expand Up @@ -143,18 +144,6 @@ function fillBidMeta(bid, tag) {
}
}

function getBidFloor(bid, mediaType, sizes) {
var floor;
var size = sizes.length === 1 ? sizes[0] : '*';
if (typeof bid.getFloor === 'function') {
const floorInfo = bid.getFloor({currency: 'USD', mediaType, size});
if (typeof floorInfo === 'object' && floorInfo.currency === 'USD' && !isNaN(parseFloat(floorInfo.floor))) {
floor = parseFloat(floorInfo.floor);
}
}
return floor;
}

export const spec = {
code: 'adkernelAdn',
gvlid: GVLID,
Expand Down
16 changes: 3 additions & 13 deletions modules/adkernelBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {registerBidder} from '../src/adapters/bidderFactory.js';
import {find} from '../src/polyfill.js';
import {config} from '../src/config.js';
import {getAdUnitSizes} from '../libraries/sizeUtils/sizeUtils.js';
import {getBidFloor} from '../libraries/adkernelUtils/adkernelUtils.js'

/**
* In case you're AdKernel whitelable platform's client who needs branded adapter to
Expand Down Expand Up @@ -96,7 +97,8 @@ export const spec = {
{code: 'digiad'},
{code: 'monetix'},
{code: 'hyperbrainz'},
{code: 'globalsun'}
{code: 'globalsun'},
{code: 'voisetech'}
],
supportedMediaTypes: [BANNER, VIDEO, NATIVE],

Expand Down Expand Up @@ -247,18 +249,6 @@ function groupImpressionsByHostZone(bidRequests, refererInfo) {
);
}

function getBidFloor(bid, mediaType, sizes) {
var floor;
var size = sizes.length === 1 ? sizes[0] : '*';
if (typeof bid.getFloor === 'function') {
const floorInfo = bid.getFloor({currency: 'USD', mediaType, size});
if (typeof floorInfo === 'object' && floorInfo.currency === 'USD' && !isNaN(parseFloat(floorInfo.floor))) {
floor = parseFloat(floorInfo.floor);
}
}
return floor;
}

/**
* Builds rtb imp object(s) for single adunit
* @param bidRequest {BidRequest}
Expand Down

0 comments on commit c140dc0

Please sign in to comment.