Skip to content

Commit

Permalink
Merge branch 'prebid:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrj-rtbh authored Aug 25, 2022
2 parents 9a3932b + 66fc005 commit 1c69c76
Show file tree
Hide file tree
Showing 50 changed files with 2,305 additions and 1,175 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/issue_tracker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@36464acb844fc53b9b8b2401da68844f6b05ebb0
uses: tibdex/github-app-token@f717b5ecd4534d3c4df4ce9b5c1c2214f0f7cd06
with:
app_id: ${{ secrets.ISSUE_APP_ID }}
private_key: ${{ secrets.ISSUE_APP_PEM }}
Expand Down
40 changes: 28 additions & 12 deletions modules/adkernelBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ import {
isPlainObject,
isStr,
mergeDeep,
parseGPTSingleSizeArrayToRtbSize
parseGPTSingleSizeArrayToRtbSize,
getDefinedParams
} from '../src/utils.js';
import {BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js';
import {registerBidder} from '../src/adapters/bidderFactory.js';
import {find, includes} from '../src/polyfill.js';
import {find} from '../src/polyfill.js';
import {config} from '../src/config.js';
import { convertOrtbRequestToProprietaryNative } from '../src/native.js';

Expand All @@ -28,10 +29,11 @@ import { convertOrtbRequestToProprietaryNative } from '../src/native.js';
*
* Please contact prebid@adkernel.com and we'll add your adapter as an alias.
*/

const VIDEO_TARGETING = Object.freeze(['mimes', 'minduration', 'maxduration', 'protocols',
'startdelay', 'linearity', 'boxingallowed', 'playbackmethod', 'delivery',
'pos', 'api', 'ext']);
const VIDEO_PARAMS = ['pos', 'context', 'placement', 'api', 'mimes', 'protocols', 'playbackmethod', 'minduration', 'maxduration',
'startdelay', 'linearity', 'skip', 'skipmin', 'skipafter', 'minbitrate', 'maxbitrate', 'delivery', 'playbackend', 'boxingallowed'];
const VIDEO_FPD = ['battr', 'pos'];
const NATIVE_FPD = ['battr', 'api'];
const BANNER_FPD = ['btype', 'battr', 'pos', 'api'];
const VERSION = '1.6';
const SYNC_IFRAME = 1;
const SYNC_IMAGE = 2;
Expand Down Expand Up @@ -275,18 +277,18 @@ function buildImp(bidRequest, secure) {
format: sizes.map(wh => parseGPTSingleSizeArrayToRtbSize(wh)),
topframe: 0
};
populateImpFpd(imp.banner, bidRequest, BANNER_FPD);
mediaType = BANNER;
} else if (deepAccess(bidRequest, 'mediaTypes.video')) {
let video = deepAccess(bidRequest, 'mediaTypes.video');
imp.video = {};
imp.video = getDefinedParams(video, VIDEO_PARAMS);
populateImpFpd(imp.video, bidRequest, VIDEO_FPD);
if (video.playerSize) {
sizes = video.playerSize[0];
imp.video = Object.assign(imp.video, parseGPTSingleSizeArrayToRtbSize(sizes) || {});
}
if (bidRequest.params.video) {
Object.keys(bidRequest.params.video)
.filter(key => includes(VIDEO_TARGETING, key))
.forEach(key => imp.video[key] = bidRequest.params.video[key]);
} else if (video.w && video.h) {
imp.video.w = video.w;
imp.video.h = video.h;
}
mediaType = VIDEO;
} else if (deepAccess(bidRequest, 'mediaTypes.native')) {
Expand All @@ -295,6 +297,7 @@ function buildImp(bidRequest, secure) {
ver: '1.1',
request: JSON.stringify(nativeRequest)
};
populateImpFpd(imp.native, bidRequest, NATIVE_FPD);
mediaType = NATIVE;
} else {
throw new Error('Unsupported bid received');
Expand Down Expand Up @@ -338,6 +341,19 @@ function buildNativeRequest(nativeReq) {
return request;
}

/**
* Populate impression-level FPD from bid request
* @param target {Object}
* @param bidRequest {BidRequest}
* @param props {String[]}
*/
function populateImpFpd(target, bidRequest, props) {
if (bidRequest.ortb2Imp === undefined) {
return;
}
Object.assign(target, getDefinedParams(bidRequest.ortb2Imp, props));
}

/**
* Builds image asset request
*/
Expand Down
17 changes: 5 additions & 12 deletions modules/adriverBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ADRIVER BID ADAPTER for Prebid 1.13
import { logInfo, getWindowLocation, getBidIdParameter, _each } from '../src/utils.js';
import {registerBidder} from '../src/adapters/bidderFactory.js';
import { registerBidder } from '../src/adapters/bidderFactory.js';
import { getStorageManager } from '../src/storageManager.js';

const BIDDER_CODE = 'adriver';
Expand All @@ -22,8 +22,6 @@ export const spec = {
},

buildRequests: function (validBidRequests, bidderRequest) {
logInfo('validBidRequests', validBidRequests);

let win = getWindowLocation();
let customID = Math.round(Math.random() * 999999999) + '-' + Math.round(new Date() / 1000) + '-1-46-';
let siteId = getBidIdParameter('siteid', validBidRequests[0].params) + '';
Expand Down Expand Up @@ -99,22 +97,17 @@ export const spec = {
});
});

let userid = validBidRequests[0].userId;
let adrcidCookie = storage.getDataFromLocalStorage('adrcid') || validBidRequests[0].userId.adrcid;

let adrcidCookie = storage.getDataFromLocalStorage('adrcid') || validBidRequests[0].userId?.adrcid;
if (adrcidCookie) {
payload.adrcid = adrcidCookie;
payload.id5 = userid.id5id;
payload.sharedid = userid.pubcid;
payload.unifiedid = userid.tdid;
payload.user.buyerid = adrcidCookie;
}
const payloadString = JSON.stringify(payload);

return {
method: 'POST',
url: ADRIVER_BID_URL,
data: payloadString,
};
data: payloadString
}
},

interpretResponse: function (serverResponse, bidRequest) {
Expand Down
3 changes: 2 additions & 1 deletion modules/adriverIdSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ export const adriverIdSubmodule = {
callback();
}
};
ajax(url, callbacks, undefined, {method: 'GET'});
let newUrl = url + '&cid=' + (storage.getDataFromLocalStorage('adrcid') || storage.getCookie('adrcid'));
ajax(newUrl, callbacks, undefined, {method: 'GET'});
}
};
return {callback: resp};
Expand Down
2 changes: 2 additions & 0 deletions modules/adtelligentBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const HOST_GETTERS = {
janet: () => 'ghb.bidder.jmgads.com',
pgam: () => 'ghb.pgamssp.com',
ocm: () => 'ghb.cenarius.orangeclickmedia.com',
vidcrunchllc: () => 'ghb.platform.vidcrunch.com',
}
const getUri = function (bidderCode) {
let bidderWithoutSuffix = bidderCode.split('_')[0];
Expand All @@ -43,6 +44,7 @@ export const spec = {
{ code: 'navelix', gvlid: 380 },
'pgam',
'ocm',
{ code: 'vidcrunchllc', gvlid: 1145 },
],
supportedMediaTypes: [VIDEO, BANNER],
isBidRequestValid: function (bid) {
Expand Down
3 changes: 2 additions & 1 deletion modules/alkimiBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ export const spec = {
bidFloor: bidRequest.params.bidFloor,
width: sizes[0].width,
height: sizes[0].height,
impMediaType: getFormatType(bidRequest)
impMediaType: getFormatType(bidRequest),
adUnitCode: bidRequest.adUnitCode
})
bidIds.push(bidRequest.bidId)
})
Expand Down
6 changes: 3 additions & 3 deletions modules/betweenBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ export const spec = {
if (i.params.itu !== undefined) {
params.itu = i.params.itu;
}
if (i.params.cur !== undefined) {
params.cur = i.params.cur;
}

params.cur = i.params.cur || 'USD';

if (i.params.subid !== undefined) {
params.subid = i.params.subid;
}
Expand Down
Loading

0 comments on commit 1c69c76

Please sign in to comment.