From c0fe57a4458796d4e420e324a88917afda3cdba9 Mon Sep 17 00:00:00 2001 From: Matt Kendall <1870166+mkendall07@users.noreply.github.com> Date: Thu, 30 Jan 2020 14:39:17 -0500 Subject: [PATCH 1/7] 2.44.6-pre release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index debe074adbe..75de7de4051 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "prebid.js", - "version": "2.44.5", + "version": "2.44.6-pre", "description": "Header Bidding Management Library", "main": "src/prebid.js", "scripts": { From 8a156b7815ea75e2ef7999f60bc93d0c21a82175 Mon Sep 17 00:00:00 2001 From: sourabhg Date: Wed, 5 Feb 2020 05:19:34 +0530 Subject: [PATCH 2/7] feat(ccpa) : ccpa and pos added to legacy adapter (#4817) --- modules/deepintentBidAdapter.js | 12 ++++++++--- modules/deepintentBidAdapter.md | 1 + .../spec/modules/deepintentBidAdapter_spec.js | 20 ++++++++++++++++++- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/modules/deepintentBidAdapter.js b/modules/deepintentBidAdapter.js index ace4bcb5ae2..bea4d3e5ebe 100644 --- a/modules/deepintentBidAdapter.js +++ b/modules/deepintentBidAdapter.js @@ -37,9 +37,13 @@ export const spec = { imp: validBidRequests.map(bid => buildImpression(bid)), site: buildSite(bidderRequest), device: buildDevice(), - user: user && user.length == 1 ? user[0] : {} + user: user && user.length == 1 ? user[0] : {}, }; + if (bidderRequest && bidderRequest.uspConsent) { + utils.deepSetValue(openRtbBidRequest, 'regs.ext.us_privacy', bidderRequest.uspConsent); + } + return { method: 'POST', url: BIDDER_ENDPOINT, @@ -127,13 +131,15 @@ function buildBanner(bid) { if (utils.isArray(sizes) && sizes.length > 0) { return { h: sizes[0][1], - w: sizes[0][0] + w: sizes[0][0], + pos: bid && bid.params && bid.params.pos ? bid.params.pos : 0 } } } else { return { h: bid.params.height, - w: bid.params.width + w: bid.params.width, + pos: bid && bid.params && bid.params.pos ? bid.params.pos : 0 } } } diff --git a/modules/deepintentBidAdapter.md b/modules/deepintentBidAdapter.md index 7f5afbd233a..79a6a1679e2 100644 --- a/modules/deepintentBidAdapter.md +++ b/modules/deepintentBidAdapter.md @@ -29,6 +29,7 @@ Module that connects to Deepintent's demand sources. tagId: '1300', // Required parameter w: 300, // Width and Height here will override sizes in mediatype h: 250, + pos: 1, custom: { // Custom parameters in form of key value pairs user_min_age: 18 } diff --git a/test/spec/modules/deepintentBidAdapter_spec.js b/test/spec/modules/deepintentBidAdapter_spec.js index 33dfd14d074..df9160092dd 100644 --- a/test/spec/modules/deepintentBidAdapter_spec.js +++ b/test/spec/modules/deepintentBidAdapter_spec.js @@ -19,6 +19,7 @@ describe('Deepintent adapter', function () { tagId: '100013', w: 728, h: 90, + pos: 1, user: { id: 'di_testuid', buyeruid: 'di_testbuyeruid', @@ -129,6 +130,11 @@ describe('Deepintent adapter', function () { expect(data.imp[0].ext).to.be.a('object'); expect(data.imp[0].ext.deepintent.position).to.equal('right-box'); }); + it('bid request check: position check', function () { + let bRequest = spec.buildRequests(request); + let data = JSON.parse(bRequest.data); + expect(data.imp[0].banner.pos).to.equal(1); + }); it('bid request check: displaymanager check', function() { let bRequest = spec.buildRequests(request); let data = JSON.parse(bRequest.data); @@ -143,7 +149,19 @@ describe('Deepintent adapter', function () { expect(data.user.buyeruid).to.equal('di_testbuyeruid'); expect(data.user.yob).to.equal(2002); expect(data.user.gender).to.equal('F'); - }) + }); + it('bid request check: CCPA Check', function () { + let bidRequest = { + uspConsent: '1NYN' + }; + let bRequest = spec.buildRequests(request, bidRequest); + let data = JSON.parse(bRequest.data); + expect(data.regs.ext.us_privacy).to.equal('1NYN'); + let bidRequest2 = {}; + let bRequest2 = spec.buildRequests(request, bidRequest2); + let data2 = JSON.parse(bRequest2.data); + expect(data2.regs).to.equal(undefined); + }); }); describe('user sync check', function () { it('user sync url check', function () { From 80c13bbcb885258d934a1ecdd28288c950fbe879 Mon Sep 17 00:00:00 2001 From: Mike Chowla Date: Thu, 6 Feb 2020 11:58:12 -0800 Subject: [PATCH 3/7] 2.44.6 release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 75de7de4051..7088fda7ea4 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "prebid.js", - "version": "2.44.6-pre", + "version": "2.44.6", "description": "Header Bidding Management Library", "main": "src/prebid.js", "scripts": { From 6bd9666c69d447ac8f744cfe726a681c41754519 Mon Sep 17 00:00:00 2001 From: Mike Chowla Date: Thu, 6 Feb 2020 12:20:20 -0800 Subject: [PATCH 4/7] Increment pre version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7088fda7ea4..56b0c2b8011 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "prebid.js", - "version": "2.44.6", + "version": "2.44.7-pre", "description": "Header Bidding Management Library", "main": "src/prebid.js", "scripts": { From c140393bd6fe06963289e8b8e5e31242aa4a5aa6 Mon Sep 17 00:00:00 2001 From: Gena Date: Mon, 10 Feb 2020 08:27:26 +0200 Subject: [PATCH 5/7] ViewdeosDX outstream support in legacy (#4766) * add outstream params extension * update outsream version * Change enpoint to geo-balanced * Coverage increased --- modules/viewdeosDXBidAdapter.js | 23 ++++++++----- .../spec/modules/viewdeosDXBidAdapter_spec.js | 33 +++++++++++++++++-- 2 files changed, 46 insertions(+), 10 deletions(-) diff --git a/modules/viewdeosDXBidAdapter.js b/modules/viewdeosDXBidAdapter.js index a591a28b18d..3b9c40b9f2d 100644 --- a/modules/viewdeosDXBidAdapter.js +++ b/modules/viewdeosDXBidAdapter.js @@ -4,8 +4,8 @@ import {VIDEO, BANNER} from '../src/mediaTypes'; import {Renderer} from '../src/Renderer'; import findIndex from 'core-js/library/fn/array/find-index'; -const URL = '//hb.sync.viewdeos.com/auction/'; -const OUTSTREAM_SRC = '//player.sync.viewdeos.com/outstream-unit/2.01/outstream.min.js'; +const URL = '//ghb.sync.viewdeos.com/auction/'; +const OUTSTREAM_SRC = '//player.sync.viewdeos.com/outstream-unit/2.11/outstream-unit.min.js'; const BIDDER_CODE = 'viewdeosDX'; const OUTSTREAM = 'outstream'; const DISPLAY = 'display'; @@ -112,7 +112,8 @@ function parseRTBResponse(serverResponse, bidderRequest) { }); if (serverBid.cpm !== 0 && requestId !== -1) { - const bid = createBid(serverBid, getMediaType(bidderRequest.bids[requestId])); + const bidReq = bidderRequest.bids[requestId]; + const bid = createBid(serverBid, getMediaType(bidReq), bidReq.params); bids.push(bid); } @@ -131,6 +132,10 @@ function bidToTag(bidRequests, bidderRequest) { tag.gdpr_consent = utils.deepAccess(bidderRequest, 'gdprConsent.consentString'); } + if (utils.deepAccess(bidderRequest, 'bidderRequest.uspConsent')) { + tag.us_privacy = bidderRequest.uspConsent; + } + for (let i = 0, length = bidRequests.length; i < length; i++) { Object.assign(tag, prepareRTBRequestParams(i, bidRequests[i])); } @@ -174,7 +179,7 @@ function getMediaType(bidderRequest) { * @param mediaType {Object} * @returns {object} */ -function createBid(bidResponse, mediaType) { +function createBid(bidResponse, mediaType, bidderParams) { const bid = { requestId: bidResponse.requestId, creativeId: bidResponse.cmpId, @@ -201,7 +206,7 @@ function createBid(bidResponse, mediaType) { Object.assign(bid, { mediaType: 'video', adResponse: bidResponse, - renderer: newRenderer(bidResponse.requestId) + renderer: newRenderer(bidResponse.requestId, bidderParams) }); } @@ -213,10 +218,11 @@ function createBid(bidResponse, mediaType) { * @param requestId * @returns {*} */ -function newRenderer(requestId) { +function newRenderer(requestId, bidderParams) { const renderer = Renderer.install({ id: requestId, url: OUTSTREAM_SRC, + config: bidderParams.outstream || {}, loaded: false }); @@ -231,12 +237,13 @@ function newRenderer(requestId) { */ function outstreamRender(bid) { bid.renderer.push(() => { - window.VOutstreamAPI.initOutstreams([{ + const opts = Object.assign({}, bid.renderer.getConfig(), { width: bid.width, height: bid.height, vastUrl: bid.vastUrl, elId: bid.adUnitCode - }]); + }); + window.VOutstreamAPI.initOutstreams([opts]); }); } diff --git a/test/spec/modules/viewdeosDXBidAdapter_spec.js b/test/spec/modules/viewdeosDXBidAdapter_spec.js index 80082347687..49718409520 100644 --- a/test/spec/modules/viewdeosDXBidAdapter_spec.js +++ b/test/spec/modules/viewdeosDXBidAdapter_spec.js @@ -2,7 +2,7 @@ import {expect} from 'chai'; import {spec} from 'modules/viewdeosDXBidAdapter'; import {newBidder} from 'src/adapters/bidderFactory'; -const ENDPOINT = '//hb.sync.viewdeos.com/auction/'; +const ENDPOINT = '//ghb.sync.viewdeos.com/auction/'; const DISPLAY_REQUEST = { 'bidder': 'viewdeos', @@ -44,6 +44,8 @@ const SERVER_VIDEO_RESPONSE = { ] }; +const SERVER_OUSTREAM_VIDEO_RESPONSE = SERVER_VIDEO_RESPONSE; + const SERVER_DISPLAY_RESPONSE = { 'source': {'aid': 12345, 'pubId': 54321}, 'bids': [{ @@ -74,6 +76,25 @@ const SERVER_DISPLAY_RESPONSE_WITH_MIXED_SYNCS = { 'cookieURLSTypes': ['image', 'iframe'] }; +const outstreamVideoBidderRequest = { + bidderCode: 'bidderCode', + bids: [{ + 'params': { + 'aid': 12345, + 'outstream': { + 'video_controls': 'show' + } + }, + mediaTypes: { + video: { + context: 'outstream', + playerSize: [640, 480] + } + }, + bidId: '2e41f65424c87c' + }] +}; + const videoBidderRequest = { bidderCode: 'bidderCode', bids: [{mediaTypes: {video: {}}, bidId: '2e41f65424c87c'}] @@ -119,9 +140,17 @@ const displayEqResponse = [{ cpm: 0.9 }]; -describe('viewdeosDXBidAdapter', function () { // todo remove only +describe('viewdeosDXBidAdapter', function () { const adapter = newBidder(spec); + describe('when outstream params are passing properly', function() { + const videoBids = spec.interpretResponse({body: SERVER_OUSTREAM_VIDEO_RESPONSE}, {bidderRequest: outstreamVideoBidderRequest}); + it('should return renderer with expected outstream params config', function() { + expect(!!videoBids[0].renderer).to.equal(true); + expect(videoBids[0].renderer.getConfig().video_controls).to.equal('show'); + }) + }) + describe('user syncs as image', function () { it('should be returned if pixel enabled', function () { const syncs = spec.getUserSyncs({pixelEnabled: true}, [{body: SERVER_DISPLAY_RESPONSE_WITH_MIXED_SYNCS}]); From 611a3be30b64046dc5535b75b168e9094d6feb64 Mon Sep 17 00:00:00 2001 From: Jaimin Panchal Date: Wed, 12 Feb 2020 17:04:03 -0500 Subject: [PATCH 6/7] Prebid 2.44.7 Release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 56b0c2b8011..0688d306566 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "prebid.js", - "version": "2.44.7-pre", + "version": "2.44.7", "description": "Header Bidding Management Library", "main": "src/prebid.js", "scripts": { From 1b1bb9379fb8f10ec28704bbd26e5710c9108b77 Mon Sep 17 00:00:00 2001 From: Sergey Derbush Date: Thu, 2 Jul 2020 19:48:20 +0600 Subject: [PATCH 7/7] Add support AUCTION_PRICE:B64 --- modules/insticatorBidAdapter.js | 39 +++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/modules/insticatorBidAdapter.js b/modules/insticatorBidAdapter.js index 4dfda753e39..1f389aed27a 100644 --- a/modules/insticatorBidAdapter.js +++ b/modules/insticatorBidAdapter.js @@ -189,6 +189,36 @@ function validateSizes(sizes) { ); } +function base64Encode(string) { + string = String(string); + + if (typeof window.btoa !== 'undefined') { + return window.btoa(string) + } + + // Polyfill + var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; + var bitmap; + var a; + var b; + var c; + var result = ''; + var i = 0; + var rest = string.length % 3; + + for (; i < string.length;) { + if ((a = string.charCodeAt(i++)) > 255 || + (b = string.charCodeAt(i++)) > 255 || + (c = string.charCodeAt(i++)) > 255) { throw new TypeError("Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range."); } + + bitmap = (a << 16) | (b << 8) | c; + result += b64.charAt(bitmap >> 18 & 63) + b64.charAt(bitmap >> 12 & 63) + + b64.charAt(bitmap >> 6 & 63) + b64.charAt(bitmap & 63); + } + + return rest ? result.slice(0, rest - 3) + '==='.substring(rest) : result; +} + export const spec = { code: BIDDER_CODE, supportedMediaTypes: [BANNER], @@ -269,6 +299,15 @@ export const spec = { return syncs; }, + + onBidWon: function(winObj) { + const cpm = winObj.cpm; + + winObj.ad = winObj.ad.replace( + /\${AUCTION_PRICE:B64}/, + base64Encode(cpm) + ); + }, }; registerBidder(spec);