From 1aa646dc1c8c1dd4db08630a8aadaccf61ad4c77 Mon Sep 17 00:00:00 2001 From: "AndBeyond.Media" Date: Wed, 13 Jul 2022 02:39:11 +0300 Subject: [PATCH 1/8] add andBeyondMedia adapter --- modules/andBeyondMediaBidAdapter.js | 202 +++++++++ modules/andBeyondMediaBidAdapter.md | 79 ++++ .../modules/andBeyondMediaBidAdapter_spec.js | 400 ++++++++++++++++++ 3 files changed, 681 insertions(+) create mode 100644 modules/andBeyondMediaBidAdapter.js create mode 100644 modules/andBeyondMediaBidAdapter.md create mode 100644 test/spec/modules/andBeyondMediaBidAdapter_spec.js diff --git a/modules/andBeyondMediaBidAdapter.js b/modules/andBeyondMediaBidAdapter.js new file mode 100644 index 00000000000..732ebfb9c06 --- /dev/null +++ b/modules/andBeyondMediaBidAdapter.js @@ -0,0 +1,202 @@ +import { isFn, deepAccess, logMessage, logError } from '../src/utils.js'; + +import { registerBidder } from '../src/adapters/bidderFactory.js'; +import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js'; +import { config } from '../src/config.js'; + +const BIDDER_CODE = 'andbeyondmedia'; +const AD_URL = 'https://backend.andbeyond.media/pbjs'; +const SYNC_URL = 'https://cookies.andbeyond.media'; + +function isBidResponseValid(bid) { + if (!bid.requestId || !bid.cpm || !bid.creativeId || !bid.ttl || !bid.currency) { + return false; + } + + switch (bid.mediaType) { + case BANNER: + return Boolean(bid.width && bid.height && bid.ad); + case VIDEO: + return Boolean(bid.vastUrl || bid.vastXml); + case NATIVE: + return Boolean(bid.native && bid.native.impressionTrackers && bid.native.impressionTrackers.length); + default: + return false; + } +} + +function getPlacementReqData(bid) { + const { params, bidId, mediaTypes } = bid; + const schain = bid.schain || {}; + const { placementId } = params; + const bidfloor = getBidFloor(bid); + + const placement = { + bidId, + schain, + bidfloor + }; + + placement.placementId = placementId; + placement.type = 'publisher'; + + if (mediaTypes && mediaTypes[BANNER]) { + placement.adFormat = BANNER; + placement.sizes = mediaTypes[BANNER].sizes; + } else if (mediaTypes && mediaTypes[VIDEO]) { + placement.adFormat = VIDEO; + placement.playerSize = mediaTypes[VIDEO].playerSize; + placement.minduration = mediaTypes[VIDEO].minduration; + placement.maxduration = mediaTypes[VIDEO].maxduration; + placement.mimes = mediaTypes[VIDEO].mimes; + placement.protocols = mediaTypes[VIDEO].protocols; + placement.startdelay = mediaTypes[VIDEO].startdelay; + placement.placement = mediaTypes[VIDEO].placement; + placement.skip = mediaTypes[VIDEO].skip; + placement.skipafter = mediaTypes[VIDEO].skipafter; + placement.minbitrate = mediaTypes[VIDEO].minbitrate; + placement.maxbitrate = mediaTypes[VIDEO].maxbitrate; + placement.delivery = mediaTypes[VIDEO].delivery; + placement.playbackmethod = mediaTypes[VIDEO].playbackmethod; + placement.api = mediaTypes[VIDEO].api; + placement.linearity = mediaTypes[VIDEO].linearity; + } else if (mediaTypes && mediaTypes[NATIVE]) { + placement.native = mediaTypes[NATIVE]; + placement.adFormat = NATIVE; + } + + return placement; +} + +function getBidFloor(bid) { + if (!isFn(bid.getFloor)) { + return deepAccess(bid, 'params.bidfloor', 0); + } + + try { + const bidFloor = bid.getFloor({ + currency: 'USD', + mediaType: '*', + size: '*', + }); + return bidFloor.floor; + } catch (err) { + logError(err); + return 0; + } +} + +export const spec = { + code: BIDDER_CODE, + supportedMediaTypes: [BANNER, VIDEO, NATIVE], + + isBidRequestValid: (bid = {}) => { + const { params, bidId, mediaTypes } = bid; + let valid = Boolean(bidId && params && params.placementId); + + if (mediaTypes && mediaTypes[BANNER]) { + valid = valid && Boolean(mediaTypes[BANNER] && mediaTypes[BANNER].sizes); + } else if (mediaTypes && mediaTypes[VIDEO]) { + valid = valid && Boolean(mediaTypes[VIDEO] && mediaTypes[VIDEO].playerSize); + } else if (mediaTypes && mediaTypes[NATIVE]) { + valid = valid && Boolean(mediaTypes[NATIVE]); + } + + return valid; + }, + + buildRequests: (validBidRequests = [], bidderRequest = {}) => { + let deviceWidth = 0; + let deviceHeight = 0; + + let winLocation; + try { + const winTop = window.top; + deviceWidth = winTop.screen.width; + deviceHeight = winTop.screen.height; + winLocation = winTop.location; + } catch (e) { + logMessage(e); + winLocation = window.location; + } + + const refferUrl = bidderRequest.refererInfo && bidderRequest.refererInfo.page; + let refferLocation; + try { + refferLocation = refferUrl && new URL(refferUrl); + } catch (e) { + logMessage(e); + } + // TODO: does the fallback make sense here? + let location = refferLocation || winLocation; + const language = (navigator && navigator.language) ? navigator.language.split('-')[0] : ''; + const host = location.host; + const page = location.pathname; + const secure = location.protocol === 'https:' ? 1 : 0; + const placements = []; + const request = { + deviceWidth, + deviceHeight, + language, + secure, + host, + page, + placements, + coppa: config.getConfig('coppa') === true ? 1 : 0, + ccpa: bidderRequest.uspConsent || undefined, + gdpr: bidderRequest.gdprConsent || undefined, + tmax: config.getConfig('bidderTimeout') + }; + + const len = validBidRequests.length; + for (let i = 0; i < len; i++) { + const bid = validBidRequests[i]; + placements.push(getPlacementReqData(bid)); + } + + return { + method: 'POST', + url: AD_URL, + data: request + }; + }, + + interpretResponse: (serverResponse) => { + let response = []; + for (let i = 0; i < serverResponse.body.length; i++) { + let resItem = serverResponse.body[i]; + if (isBidResponseValid(resItem)) { + const advertiserDomains = resItem.adomain && resItem.adomain.length ? resItem.adomain : []; + resItem.meta = { ...resItem.meta, advertiserDomains }; + + response.push(resItem); + } + } + return response; + }, + + getUserSyncs: (syncOptions, serverResponses, gdprConsent, uspConsent) => { + let syncType = syncOptions.iframeEnabled ? 'iframe' : 'image'; + let syncUrl = SYNC_URL + `/${syncType}?pbjs=1`; + if (gdprConsent && gdprConsent.consentString) { + if (typeof gdprConsent.gdprApplies === 'boolean') { + syncUrl += `&gdpr=${Number(gdprConsent.gdprApplies)}&gdpr_consent=${gdprConsent.consentString}`; + } else { + syncUrl += `&gdpr=0&gdpr_consent=${gdprConsent.consentString}`; + } + } + if (uspConsent && uspConsent.consentString) { + syncUrl += `&ccpa_consent=${uspConsent.consentString}`; + } + + const coppa = config.getConfig('coppa') ? 1 : 0; + syncUrl += `&coppa=${coppa}`; + + return [{ + type: syncType, + url: syncUrl + }]; + } +}; + +registerBidder(spec); diff --git a/modules/andBeyondMediaBidAdapter.md b/modules/andBeyondMediaBidAdapter.md new file mode 100644 index 00000000000..40c301aa5fb --- /dev/null +++ b/modules/andBeyondMediaBidAdapter.md @@ -0,0 +1,79 @@ +# Overview + +``` +Module Name: AndBeyond.Media Bidder Adapter +Module Type: AndBeyond.Media Bidder Adapter +Maintainer: sysengg@andbeyond.media +``` + +# Description + +Connects to AndBeyond.Media exchange for bids. +AndBeyond.Media bid adapter supports Banner, Video (instream and outstream) and Native. + +# Test Parameters +``` + var adUnits = [ + // Will return static test banner + { + code: 'adunit1', + mediaTypes: { + banner: { + sizes: [ [300, 250], [320, 50] ], + } + }, + bids: [ + { + bidder: 'andbeyondmedia', + params: { + placementId: 'testBanner', + } + } + ] + }, + { + code: 'addunit2', + mediaTypes: { + video: { + playerSize: [ [640, 480] ], + context: 'instream', + minduration: 5, + maxduration: 60, + } + }, + bids: [ + { + bidder: 'andbeyondmedia', + params: { + placementId: 'testVideo', + } + } + ] + }, + { + code: 'addunit3', + mediaTypes: { + native: { + title: { + required: true + }, + body: { + required: true + }, + icon: { + required: true, + size: [64, 64] + } + } + }, + bids: [ + { + bidder: 'andbeyondmedia', + params: { + placementId: 'testNative', + } + } + ] + } + ]; +``` \ No newline at end of file diff --git a/test/spec/modules/andBeyondMediaBidAdapter_spec.js b/test/spec/modules/andBeyondMediaBidAdapter_spec.js new file mode 100644 index 00000000000..454ea65e917 --- /dev/null +++ b/test/spec/modules/andBeyondMediaBidAdapter_spec.js @@ -0,0 +1,400 @@ +import { expect } from 'chai'; +import { spec } from '../../../modules/andBeyondMediaBidAdapter.js'; +import { BANNER, VIDEO, NATIVE } from '../../../src/mediaTypes.js'; +import { getUniqueIdentifierStr } from '../../../src/utils.js'; + +const bidder = 'andbeyondmedia' + +describe('AndBeyondMediaBidAdapter', function () { + const bids = [ + { + bidId: getUniqueIdentifierStr(), + bidder: bidder, + mediaTypes: { + [BANNER]: { + sizes: [[300, 250]] + } + }, + params: { + placementId: 'testBanner', + } + }, + { + bidId: getUniqueIdentifierStr(), + bidder: bidder, + mediaTypes: { + [VIDEO]: { + playerSize: [[300, 300]], + minduration: 5, + maxduration: 60 + } + }, + params: { + placementId: 'testVideo', + } + }, + { + bidId: getUniqueIdentifierStr(), + bidder: bidder, + mediaTypes: { + [NATIVE]: { + native: { + title: { + required: true + }, + body: { + required: true + }, + icon: { + required: true, + size: [64, 64] + } + } + } + }, + params: { + placementId: 'testNative', + } + } + ]; + + const invalidBid = { + bidId: getUniqueIdentifierStr(), + bidder: bidder, + mediaTypes: { + [BANNER]: { + sizes: [[300, 250]] + } + }, + params: { + + } + } + + const bidderRequest = { + uspConsent: '1---', + gdprConsent: 'COvFyGBOvFyGBAbAAAENAPCAAOAAAAAAAAAAAEEUACCKAAA.IFoEUQQgAIQwgIwQABAEAAAAOIAACAIAAAAQAIAgEAACEAAAAAgAQBAAAAAAAGBAAgAAAAAAAFAAECAAAgAAQARAEQAAAAAJAAIAAgAAAYQEAAAQmAgBC3ZAYzUw', + refererInfo: { + referer: 'https://test.com' + } + }; + + describe('isBidRequestValid', function () { + it('Should return true if there are bidId, params and key parameters present', function () { + expect(spec.isBidRequestValid(bids[0])).to.be.true; + expect(spec.isBidRequestValid(bids[1])).to.be.true; + expect(spec.isBidRequestValid(bids[2])).to.be.true; + }); + it('Should return false if at least one of parameters is not present', function () { + expect(spec.isBidRequestValid(invalidBid)).to.be.false; + }); + }); + + describe('buildRequests', function () { + let serverRequest = spec.buildRequests(bids, bidderRequest); + + it('Creates a ServerRequest object with method, URL and data', function () { + expect(serverRequest).to.exist; + expect(serverRequest.method).to.exist; + expect(serverRequest.url).to.exist; + expect(serverRequest.data).to.exist; + }); + + it('Returns POST method', function () { + expect(serverRequest.method).to.equal('POST'); + }); + + it('Returns valid URL', function () { + expect(serverRequest.url).to.equal('https://backend.andbeyond.media/pbjs'); + }); + + it('Returns general data valid', function () { + let data = serverRequest.data; + expect(data).to.be.an('object'); + expect(data).to.have.all.keys('deviceWidth', + 'deviceHeight', + 'language', + 'secure', + 'host', + 'page', + 'placements', + 'coppa', + 'ccpa', + 'gdpr', + 'tmax' + ); + expect(data.deviceWidth).to.be.a('number'); + expect(data.deviceHeight).to.be.a('number'); + expect(data.language).to.be.a('string'); + expect(data.secure).to.be.within(0, 1); + expect(data.host).to.be.a('string'); + expect(data.page).to.be.a('string'); + expect(data.coppa).to.be.a('number'); + expect(data.gdpr).to.be.a('string'); + expect(data.ccpa).to.be.a('string'); + expect(data.tmax).to.be.a('number'); + expect(data.placements).to.have.lengthOf(3); + }); + + it('Returns valid placements', function () { + const { placements } = serverRequest.data; + for (let i = 0, len = placements.length; i < len; i++) { + const placement = placements[i]; + expect(placement.placementId).to.be.oneOf(['testBanner', 'testVideo', 'testNative']); + expect(placement.adFormat).to.be.oneOf([BANNER, VIDEO, NATIVE]); + expect(placement.bidId).to.be.a('string'); + expect(placement.schain).to.be.an('object'); + expect(placement.bidfloor).to.exist.and.to.equal(0); + expect(placement.type).to.exist.and.to.equal('publisher'); + + if (placement.adFormat === BANNER) { + expect(placement.sizes).to.be.an('array'); + } + switch (placement.adFormat) { + case BANNER: + expect(placement.sizes).to.be.an('array'); + break; + case VIDEO: + expect(placement.playerSize).to.be.an('array'); + expect(placement.minduration).to.be.an('number'); + expect(placement.maxduration).to.be.an('number'); + break; + case NATIVE: + expect(placement.native).to.be.an('object'); + break; + } + } + }); + + it('Returns data with gdprConsent and without uspConsent', function () { + delete bidderRequest.uspConsent; + serverRequest = spec.buildRequests(bids, bidderRequest); + let data = serverRequest.data; + expect(data.gdpr).to.exist; + expect(data.gdpr).to.be.a('string'); + expect(data.gdpr).to.equal(bidderRequest.gdprConsent); + expect(data.ccpa).to.not.exist; + delete bidderRequest.gdprConsent; + }); + + it('Returns data with uspConsent and without gdprConsent', function () { + bidderRequest.uspConsent = '1---'; + delete bidderRequest.gdprConsent; + serverRequest = spec.buildRequests(bids, bidderRequest); + let data = serverRequest.data; + expect(data.ccpa).to.exist; + expect(data.ccpa).to.be.a('string'); + expect(data.ccpa).to.equal(bidderRequest.uspConsent); + expect(data.gdpr).to.not.exist; + }); + + it('Returns empty data if no valid requests are passed', function () { + serverRequest = spec.buildRequests([], bidderRequest); + let data = serverRequest.data; + expect(data.placements).to.be.an('array').that.is.empty; + }); + }); + + describe('interpretResponse', function () { + it('Should interpret banner response', function () { + const banner = { + body: [{ + mediaType: 'banner', + width: 300, + height: 250, + cpm: 0.4, + ad: 'Test', + requestId: '23fhj33i987f', + ttl: 120, + creativeId: '2', + netRevenue: true, + currency: 'USD', + dealId: '1', + meta: { + advertiserDomains: ['google.com'], + advertiserId: 1234 + } + }] + }; + let bannerResponses = spec.interpretResponse(banner); + expect(bannerResponses).to.be.an('array').that.is.not.empty; + let dataItem = bannerResponses[0]; + expect(dataItem).to.have.all.keys('requestId', 'cpm', 'width', 'height', 'ad', 'ttl', 'creativeId', + 'netRevenue', 'currency', 'dealId', 'mediaType', 'meta'); + expect(dataItem.requestId).to.equal(banner.body[0].requestId); + expect(dataItem.cpm).to.equal(banner.body[0].cpm); + expect(dataItem.width).to.equal(banner.body[0].width); + expect(dataItem.height).to.equal(banner.body[0].height); + expect(dataItem.ad).to.equal(banner.body[0].ad); + expect(dataItem.ttl).to.equal(banner.body[0].ttl); + expect(dataItem.creativeId).to.equal(banner.body[0].creativeId); + expect(dataItem.netRevenue).to.be.true; + expect(dataItem.currency).to.equal(banner.body[0].currency); + expect(dataItem.meta).to.be.an('object').that.has.any.key('advertiserDomains'); + }); + it('Should interpret video response', function () { + const video = { + body: [{ + vastUrl: 'test.com', + mediaType: 'video', + cpm: 0.5, + requestId: '23fhj33i987f', + ttl: 120, + creativeId: '2', + netRevenue: true, + currency: 'USD', + dealId: '1', + meta: { + advertiserDomains: ['google.com'], + advertiserId: 1234 + } + }] + }; + let videoResponses = spec.interpretResponse(video); + expect(videoResponses).to.be.an('array').that.is.not.empty; + + let dataItem = videoResponses[0]; + expect(dataItem).to.have.all.keys('requestId', 'cpm', 'vastUrl', 'ttl', 'creativeId', + 'netRevenue', 'currency', 'dealId', 'mediaType', 'meta'); + expect(dataItem.requestId).to.equal('23fhj33i987f'); + expect(dataItem.cpm).to.equal(0.5); + expect(dataItem.vastUrl).to.equal('test.com'); + expect(dataItem.ttl).to.equal(120); + expect(dataItem.creativeId).to.equal('2'); + expect(dataItem.netRevenue).to.be.true; + expect(dataItem.currency).to.equal('USD'); + expect(dataItem.meta).to.be.an('object').that.has.any.key('advertiserDomains'); + }); + it('Should interpret native response', function () { + const native = { + body: [{ + mediaType: 'native', + native: { + clickUrl: 'test.com', + title: 'Test', + image: 'test.com', + impressionTrackers: ['test.com'], + }, + ttl: 120, + cpm: 0.4, + requestId: '23fhj33i987f', + creativeId: '2', + netRevenue: true, + currency: 'USD', + meta: { + advertiserDomains: ['google.com'], + advertiserId: 1234 + } + }] + }; + let nativeResponses = spec.interpretResponse(native); + expect(nativeResponses).to.be.an('array').that.is.not.empty; + + let dataItem = nativeResponses[0]; + expect(dataItem).to.have.keys('requestId', 'cpm', 'ttl', 'creativeId', 'netRevenue', 'currency', 'mediaType', 'native', 'meta'); + expect(dataItem.native).to.have.keys('clickUrl', 'impressionTrackers', 'title', 'image') + expect(dataItem.requestId).to.equal('23fhj33i987f'); + expect(dataItem.cpm).to.equal(0.4); + expect(dataItem.native.clickUrl).to.equal('test.com'); + expect(dataItem.native.title).to.equal('Test'); + expect(dataItem.native.image).to.equal('test.com'); + expect(dataItem.native.impressionTrackers).to.be.an('array').that.is.not.empty; + expect(dataItem.native.impressionTrackers[0]).to.equal('test.com'); + expect(dataItem.ttl).to.equal(120); + expect(dataItem.creativeId).to.equal('2'); + expect(dataItem.netRevenue).to.be.true; + expect(dataItem.currency).to.equal('USD'); + expect(dataItem.meta).to.be.an('object').that.has.any.key('advertiserDomains'); + }); + it('Should return an empty array if invalid banner response is passed', function () { + const invBanner = { + body: [{ + width: 300, + cpm: 0.4, + ad: 'Test', + requestId: '23fhj33i987f', + ttl: 120, + creativeId: '2', + netRevenue: true, + currency: 'USD', + dealId: '1' + }] + }; + + let serverResponses = spec.interpretResponse(invBanner); + expect(serverResponses).to.be.an('array').that.is.empty; + }); + it('Should return an empty array if invalid video response is passed', function () { + const invVideo = { + body: [{ + mediaType: 'video', + cpm: 0.5, + requestId: '23fhj33i987f', + ttl: 120, + creativeId: '2', + netRevenue: true, + currency: 'USD', + dealId: '1' + }] + }; + let serverResponses = spec.interpretResponse(invVideo); + expect(serverResponses).to.be.an('array').that.is.empty; + }); + it('Should return an empty array if invalid native response is passed', function () { + const invNative = { + body: [{ + mediaType: 'native', + clickUrl: 'test.com', + title: 'Test', + impressionTrackers: ['test.com'], + ttl: 120, + requestId: '23fhj33i987f', + creativeId: '2', + netRevenue: true, + currency: 'USD', + }] + }; + let serverResponses = spec.interpretResponse(invNative); + expect(serverResponses).to.be.an('array').that.is.empty; + }); + it('Should return an empty array if invalid response is passed', function () { + const invalid = { + body: [{ + ttl: 120, + creativeId: '2', + netRevenue: true, + currency: 'USD', + dealId: '1' + }] + }; + let serverResponses = spec.interpretResponse(invalid); + expect(serverResponses).to.be.an('array').that.is.empty; + }); + }); + + describe('getUserSyncs', function() { + it('Should return array of objects with proper sync config , include GDPR', function() { + const syncData = spec.getUserSyncs({}, {}, { + consentString: 'ALL', + gdprApplies: true, + }, {}); + expect(syncData).to.be.an('array').which.is.not.empty; + expect(syncData[0]).to.be.an('object') + expect(syncData[0].type).to.be.a('string') + expect(syncData[0].type).to.equal('image') + expect(syncData[0].url).to.be.a('string') + expect(syncData[0].url).to.equal('https://cookies.andbeyond.media/image?pbjs=1&gdpr=1&gdpr_consent=ALL&coppa=0') + }); + it('Should return array of objects with proper sync config , include CCPA', function() { + const syncData = spec.getUserSyncs({}, {}, {}, { + consentString: '1---' + }); + expect(syncData).to.be.an('array').which.is.not.empty; + expect(syncData[0]).to.be.an('object') + expect(syncData[0].type).to.be.a('string') + expect(syncData[0].type).to.equal('image') + expect(syncData[0].url).to.be.a('string') + expect(syncData[0].url).to.equal('https://cookies.andbeyond.media/image?pbjs=1&ccpa_consent=1---&coppa=0') + }); + }); +}); From 61275e7a892ed5f486f7e314a2808656e69aafc0 Mon Sep 17 00:00:00 2001 From: "AndBeyond.Media" Date: Fri, 29 Jul 2022 11:11:29 +0300 Subject: [PATCH 2/8] update bidderCode --- modules/andBeyondMediaBidAdapter.js | 4 ++-- modules/andBeyondMediaBidAdapter.md | 6 +++--- test/spec/modules/andBeyondMediaBidAdapter_spec.js | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/andBeyondMediaBidAdapter.js b/modules/andBeyondMediaBidAdapter.js index 732ebfb9c06..57c141dc2aa 100644 --- a/modules/andBeyondMediaBidAdapter.js +++ b/modules/andBeyondMediaBidAdapter.js @@ -4,7 +4,7 @@ import { registerBidder } from '../src/adapters/bidderFactory.js'; import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js'; import { config } from '../src/config.js'; -const BIDDER_CODE = 'andbeyondmedia'; +const BIDDER_CODE = 'beyondmedia'; const AD_URL = 'https://backend.andbeyond.media/pbjs'; const SYNC_URL = 'https://cookies.andbeyond.media'; @@ -127,7 +127,7 @@ export const spec = { } catch (e) { logMessage(e); } - // TODO: does the fallback make sense here? + let location = refferLocation || winLocation; const language = (navigator && navigator.language) ? navigator.language.split('-')[0] : ''; const host = location.host; diff --git a/modules/andBeyondMediaBidAdapter.md b/modules/andBeyondMediaBidAdapter.md index 40c301aa5fb..ebb44a7779c 100644 --- a/modules/andBeyondMediaBidAdapter.md +++ b/modules/andBeyondMediaBidAdapter.md @@ -24,7 +24,7 @@ AndBeyond.Media bid adapter supports Banner, Video (instream and outstream) and }, bids: [ { - bidder: 'andbeyondmedia', + bidder: 'beyondmedia', params: { placementId: 'testBanner', } @@ -43,7 +43,7 @@ AndBeyond.Media bid adapter supports Banner, Video (instream and outstream) and }, bids: [ { - bidder: 'andbeyondmedia', + bidder: 'beyondmedia', params: { placementId: 'testVideo', } @@ -68,7 +68,7 @@ AndBeyond.Media bid adapter supports Banner, Video (instream and outstream) and }, bids: [ { - bidder: 'andbeyondmedia', + bidder: 'beyondmedia', params: { placementId: 'testNative', } diff --git a/test/spec/modules/andBeyondMediaBidAdapter_spec.js b/test/spec/modules/andBeyondMediaBidAdapter_spec.js index 454ea65e917..b739bec288e 100644 --- a/test/spec/modules/andBeyondMediaBidAdapter_spec.js +++ b/test/spec/modules/andBeyondMediaBidAdapter_spec.js @@ -3,7 +3,7 @@ import { spec } from '../../../modules/andBeyondMediaBidAdapter.js'; import { BANNER, VIDEO, NATIVE } from '../../../src/mediaTypes.js'; import { getUniqueIdentifierStr } from '../../../src/utils.js'; -const bidder = 'andbeyondmedia' +const bidder = 'beyondmedia' describe('AndBeyondMediaBidAdapter', function () { const bids = [ From 7f49497995d8cf047bd7d9243a2528c0349238a2 Mon Sep 17 00:00:00 2001 From: "AndBeyond.Media" Date: Fri, 16 Sep 2022 11:06:30 +0300 Subject: [PATCH 3/8] update biddercode --- modules/andBeyondMediaBidAdapter.js | 2 +- modules/andBeyondMediaBidAdapter.md | 6 +++--- test/spec/modules/andBeyondMediaBidAdapter_spec.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/andBeyondMediaBidAdapter.js b/modules/andBeyondMediaBidAdapter.js index 57c141dc2aa..1392957706b 100644 --- a/modules/andBeyondMediaBidAdapter.js +++ b/modules/andBeyondMediaBidAdapter.js @@ -4,7 +4,7 @@ import { registerBidder } from '../src/adapters/bidderFactory.js'; import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js'; import { config } from '../src/config.js'; -const BIDDER_CODE = 'beyondmedia'; +const BIDDER_CODE = 'andbeyond.media'; const AD_URL = 'https://backend.andbeyond.media/pbjs'; const SYNC_URL = 'https://cookies.andbeyond.media'; diff --git a/modules/andBeyondMediaBidAdapter.md b/modules/andBeyondMediaBidAdapter.md index ebb44a7779c..82786a2249d 100644 --- a/modules/andBeyondMediaBidAdapter.md +++ b/modules/andBeyondMediaBidAdapter.md @@ -24,7 +24,7 @@ AndBeyond.Media bid adapter supports Banner, Video (instream and outstream) and }, bids: [ { - bidder: 'beyondmedia', + bidder: 'andbeyond.media', params: { placementId: 'testBanner', } @@ -43,7 +43,7 @@ AndBeyond.Media bid adapter supports Banner, Video (instream and outstream) and }, bids: [ { - bidder: 'beyondmedia', + bidder: 'andbeyond.media', params: { placementId: 'testVideo', } @@ -68,7 +68,7 @@ AndBeyond.Media bid adapter supports Banner, Video (instream and outstream) and }, bids: [ { - bidder: 'beyondmedia', + bidder: 'andbeyond.media', params: { placementId: 'testNative', } diff --git a/test/spec/modules/andBeyondMediaBidAdapter_spec.js b/test/spec/modules/andBeyondMediaBidAdapter_spec.js index b739bec288e..21a2d6ecb76 100644 --- a/test/spec/modules/andBeyondMediaBidAdapter_spec.js +++ b/test/spec/modules/andBeyondMediaBidAdapter_spec.js @@ -3,7 +3,7 @@ import { spec } from '../../../modules/andBeyondMediaBidAdapter.js'; import { BANNER, VIDEO, NATIVE } from '../../../src/mediaTypes.js'; import { getUniqueIdentifierStr } from '../../../src/utils.js'; -const bidder = 'beyondmedia' +const bidder = 'andbeyond.media' describe('AndBeyondMediaBidAdapter', function () { const bids = [ From e1493793fc29108cf8d857f84ee2775579710047 Mon Sep 17 00:00:00 2001 From: Vlad Isaiko Date: Mon, 19 Sep 2022 16:32:55 +0300 Subject: [PATCH 4/8] change andbeyond.media => andbeyond --- modules/andBeyondMediaBidAdapter.js | 2 +- modules/andBeyondMediaBidAdapter.md | 8 ++++---- test/spec/modules/andBeyondMediaBidAdapter_spec.js | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/andBeyondMediaBidAdapter.js b/modules/andBeyondMediaBidAdapter.js index 1392957706b..b6b6475ef70 100644 --- a/modules/andBeyondMediaBidAdapter.js +++ b/modules/andBeyondMediaBidAdapter.js @@ -4,7 +4,7 @@ import { registerBidder } from '../src/adapters/bidderFactory.js'; import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js'; import { config } from '../src/config.js'; -const BIDDER_CODE = 'andbeyond.media'; +const BIDDER_CODE = 'andbeyond'; const AD_URL = 'https://backend.andbeyond.media/pbjs'; const SYNC_URL = 'https://cookies.andbeyond.media'; diff --git a/modules/andBeyondMediaBidAdapter.md b/modules/andBeyondMediaBidAdapter.md index 82786a2249d..d0bcd0fcfea 100644 --- a/modules/andBeyondMediaBidAdapter.md +++ b/modules/andBeyondMediaBidAdapter.md @@ -24,7 +24,7 @@ AndBeyond.Media bid adapter supports Banner, Video (instream and outstream) and }, bids: [ { - bidder: 'andbeyond.media', + bidder: 'andbeyond', params: { placementId: 'testBanner', } @@ -43,7 +43,7 @@ AndBeyond.Media bid adapter supports Banner, Video (instream and outstream) and }, bids: [ { - bidder: 'andbeyond.media', + bidder: 'andbeyond', params: { placementId: 'testVideo', } @@ -68,7 +68,7 @@ AndBeyond.Media bid adapter supports Banner, Video (instream and outstream) and }, bids: [ { - bidder: 'andbeyond.media', + bidder: 'andbeyond', params: { placementId: 'testNative', } @@ -76,4 +76,4 @@ AndBeyond.Media bid adapter supports Banner, Video (instream and outstream) and ] } ]; -``` \ No newline at end of file +``` diff --git a/test/spec/modules/andBeyondMediaBidAdapter_spec.js b/test/spec/modules/andBeyondMediaBidAdapter_spec.js index 21a2d6ecb76..9bc56f0516b 100644 --- a/test/spec/modules/andBeyondMediaBidAdapter_spec.js +++ b/test/spec/modules/andBeyondMediaBidAdapter_spec.js @@ -3,7 +3,7 @@ import { spec } from '../../../modules/andBeyondMediaBidAdapter.js'; import { BANNER, VIDEO, NATIVE } from '../../../src/mediaTypes.js'; import { getUniqueIdentifierStr } from '../../../src/utils.js'; -const bidder = 'andbeyond.media' +const bidder = 'andbeyond' describe('AndBeyondMediaBidAdapter', function () { const bids = [ From 254e9b76e3948080905d596f25587bc39bba26ba Mon Sep 17 00:00:00 2001 From: "AndBeyond.Media" Date: Tue, 27 Sep 2022 15:02:52 +0300 Subject: [PATCH 5/8] changes --- modules/andBeyondMediaBidAdapter.js | 2 +- modules/andBeyondMediaBidAdapter.md | 6 +++--- test/spec/modules/andBeyondMediaBidAdapter_spec.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/andBeyondMediaBidAdapter.js b/modules/andBeyondMediaBidAdapter.js index b6b6475ef70..05aa71fcb40 100644 --- a/modules/andBeyondMediaBidAdapter.js +++ b/modules/andBeyondMediaBidAdapter.js @@ -4,7 +4,7 @@ import { registerBidder } from '../src/adapters/bidderFactory.js'; import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js'; import { config } from '../src/config.js'; -const BIDDER_CODE = 'andbeyond'; +const BIDDER_CODE = 'andbeyondmedia'; const AD_URL = 'https://backend.andbeyond.media/pbjs'; const SYNC_URL = 'https://cookies.andbeyond.media'; diff --git a/modules/andBeyondMediaBidAdapter.md b/modules/andBeyondMediaBidAdapter.md index d0bcd0fcfea..7397680643f 100644 --- a/modules/andBeyondMediaBidAdapter.md +++ b/modules/andBeyondMediaBidAdapter.md @@ -24,7 +24,7 @@ AndBeyond.Media bid adapter supports Banner, Video (instream and outstream) and }, bids: [ { - bidder: 'andbeyond', + bidder: 'andbeyondmedia', params: { placementId: 'testBanner', } @@ -43,7 +43,7 @@ AndBeyond.Media bid adapter supports Banner, Video (instream and outstream) and }, bids: [ { - bidder: 'andbeyond', + bidder: 'andbeyondmedia', params: { placementId: 'testVideo', } @@ -68,7 +68,7 @@ AndBeyond.Media bid adapter supports Banner, Video (instream and outstream) and }, bids: [ { - bidder: 'andbeyond', + bidder: 'andbeyondmedia', params: { placementId: 'testNative', } diff --git a/test/spec/modules/andBeyondMediaBidAdapter_spec.js b/test/spec/modules/andBeyondMediaBidAdapter_spec.js index 9bc56f0516b..454ea65e917 100644 --- a/test/spec/modules/andBeyondMediaBidAdapter_spec.js +++ b/test/spec/modules/andBeyondMediaBidAdapter_spec.js @@ -3,7 +3,7 @@ import { spec } from '../../../modules/andBeyondMediaBidAdapter.js'; import { BANNER, VIDEO, NATIVE } from '../../../src/mediaTypes.js'; import { getUniqueIdentifierStr } from '../../../src/utils.js'; -const bidder = 'andbeyond' +const bidder = 'andbeyondmedia' describe('AndBeyondMediaBidAdapter', function () { const bids = [ From 2016dec821855323e5b22d76bb776def02edd1bf Mon Sep 17 00:00:00 2001 From: "AndBeyond.Media" Date: Tue, 27 Sep 2022 15:08:49 +0300 Subject: [PATCH 6/8] updates --- modules/andBeyondMediaBidAdapter.js | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/andBeyondMediaBidAdapter.js b/modules/andBeyondMediaBidAdapter.js index 05aa71fcb40..94aa1952685 100644 --- a/modules/andBeyondMediaBidAdapter.js +++ b/modules/andBeyondMediaBidAdapter.js @@ -89,6 +89,7 @@ function getBidFloor(bid) { export const spec = { code: BIDDER_CODE, supportedMediaTypes: [BANNER, VIDEO, NATIVE], + aliases: ['beyondmedia'], isBidRequestValid: (bid = {}) => { const { params, bidId, mediaTypes } = bid; From eeb2a1a7fc771e3093df2cd41e826a2cca7aa564 Mon Sep 17 00:00:00 2001 From: "AndBeyond.Media" Date: Thu, 29 Sep 2022 11:15:49 +0300 Subject: [PATCH 7/8] rename files --- .../{andBeyondMediaBidAdapter.js => andbeyondmediaBidAdapter.js} | 0 .../{andBeyondMediaBidAdapter.md => andbeyondmediaBidAdapter.md} | 0 ...ndMediaBidAdapter_spec.js => andbeyondmediaBidAdapter_spec.js} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename modules/{andBeyondMediaBidAdapter.js => andbeyondmediaBidAdapter.js} (100%) rename modules/{andBeyondMediaBidAdapter.md => andbeyondmediaBidAdapter.md} (100%) rename test/spec/modules/{andBeyondMediaBidAdapter_spec.js => andbeyondmediaBidAdapter_spec.js} (100%) diff --git a/modules/andBeyondMediaBidAdapter.js b/modules/andbeyondmediaBidAdapter.js similarity index 100% rename from modules/andBeyondMediaBidAdapter.js rename to modules/andbeyondmediaBidAdapter.js diff --git a/modules/andBeyondMediaBidAdapter.md b/modules/andbeyondmediaBidAdapter.md similarity index 100% rename from modules/andBeyondMediaBidAdapter.md rename to modules/andbeyondmediaBidAdapter.md diff --git a/test/spec/modules/andBeyondMediaBidAdapter_spec.js b/test/spec/modules/andbeyondmediaBidAdapter_spec.js similarity index 100% rename from test/spec/modules/andBeyondMediaBidAdapter_spec.js rename to test/spec/modules/andbeyondmediaBidAdapter_spec.js From 166b02ec0ca9b33b9ccbc3fd9d7fd69a1e75132f Mon Sep 17 00:00:00 2001 From: "AndBeyond.Media" Date: Tue, 4 Oct 2022 15:52:22 +0300 Subject: [PATCH 8/8] updates --- ...andbeyondmediaBidAdapter.js => beyondmediaBidAdapter.js} | 3 +-- ...andbeyondmediaBidAdapter.md => beyondmediaBidAdapter.md} | 6 +++--- ...ediaBidAdapter_spec.js => beyondmediaBidAdapter_spec.js} | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) rename modules/{andbeyondmediaBidAdapter.js => beyondmediaBidAdapter.js} (98%) rename modules/{andbeyondmediaBidAdapter.md => beyondmediaBidAdapter.md} (93%) rename test/spec/modules/{andbeyondmediaBidAdapter_spec.js => beyondmediaBidAdapter_spec.js} (99%) diff --git a/modules/andbeyondmediaBidAdapter.js b/modules/beyondmediaBidAdapter.js similarity index 98% rename from modules/andbeyondmediaBidAdapter.js rename to modules/beyondmediaBidAdapter.js index 94aa1952685..57c141dc2aa 100644 --- a/modules/andbeyondmediaBidAdapter.js +++ b/modules/beyondmediaBidAdapter.js @@ -4,7 +4,7 @@ import { registerBidder } from '../src/adapters/bidderFactory.js'; import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js'; import { config } from '../src/config.js'; -const BIDDER_CODE = 'andbeyondmedia'; +const BIDDER_CODE = 'beyondmedia'; const AD_URL = 'https://backend.andbeyond.media/pbjs'; const SYNC_URL = 'https://cookies.andbeyond.media'; @@ -89,7 +89,6 @@ function getBidFloor(bid) { export const spec = { code: BIDDER_CODE, supportedMediaTypes: [BANNER, VIDEO, NATIVE], - aliases: ['beyondmedia'], isBidRequestValid: (bid = {}) => { const { params, bidId, mediaTypes } = bid; diff --git a/modules/andbeyondmediaBidAdapter.md b/modules/beyondmediaBidAdapter.md similarity index 93% rename from modules/andbeyondmediaBidAdapter.md rename to modules/beyondmediaBidAdapter.md index 7397680643f..e828bdfd808 100644 --- a/modules/andbeyondmediaBidAdapter.md +++ b/modules/beyondmediaBidAdapter.md @@ -24,7 +24,7 @@ AndBeyond.Media bid adapter supports Banner, Video (instream and outstream) and }, bids: [ { - bidder: 'andbeyondmedia', + bidder: 'beyondmedia', params: { placementId: 'testBanner', } @@ -43,7 +43,7 @@ AndBeyond.Media bid adapter supports Banner, Video (instream and outstream) and }, bids: [ { - bidder: 'andbeyondmedia', + bidder: 'beyondmedia', params: { placementId: 'testVideo', } @@ -68,7 +68,7 @@ AndBeyond.Media bid adapter supports Banner, Video (instream and outstream) and }, bids: [ { - bidder: 'andbeyondmedia', + bidder: 'beyondmedia', params: { placementId: 'testNative', } diff --git a/test/spec/modules/andbeyondmediaBidAdapter_spec.js b/test/spec/modules/beyondmediaBidAdapter_spec.js similarity index 99% rename from test/spec/modules/andbeyondmediaBidAdapter_spec.js rename to test/spec/modules/beyondmediaBidAdapter_spec.js index 454ea65e917..a4c1125fa5f 100644 --- a/test/spec/modules/andbeyondmediaBidAdapter_spec.js +++ b/test/spec/modules/beyondmediaBidAdapter_spec.js @@ -1,9 +1,9 @@ import { expect } from 'chai'; -import { spec } from '../../../modules/andBeyondMediaBidAdapter.js'; +import { spec } from '../../../modules/beyondmediaBidAdapter.js'; import { BANNER, VIDEO, NATIVE } from '../../../src/mediaTypes.js'; import { getUniqueIdentifierStr } from '../../../src/utils.js'; -const bidder = 'andbeyondmedia' +const bidder = 'beyondmedia' describe('AndBeyondMediaBidAdapter', function () { const bids = [