diff --git a/modules/adbookpspBidAdapter.js b/modules/adbookpspBidAdapter.js index de8a3598be1..198441975d8 100644 --- a/modules/adbookpspBidAdapter.js +++ b/modules/adbookpspBidAdapter.js @@ -123,9 +123,9 @@ function buildRequest(validBidRequests, bidderRequest) { id: bidderRequest.bidderRequestId, tmax: bidderRequest.timeout, site: { - domain: window.location.hostname, - page: window.location.href, - ref: bidderRequest.refererInfo.referer, + domain: bidderRequest.refererInfo.domain, + page: bidderRequest.refererInfo.page, + ref: bidderRequest.refererInfo.ref, }, source: buildSource(validBidRequests, bidderRequest), device: buildDevice(), diff --git a/modules/addefendBidAdapter.js b/modules/addefendBidAdapter.js index dcc453ef35a..f0a6852b084 100644 --- a/modules/addefendBidAdapter.js +++ b/modules/addefendBidAdapter.js @@ -21,7 +21,8 @@ export const spec = { pageId: false, gdpr_applies: bidderRequest.gdprConsent && bidderRequest.gdprConsent.gdprApplies ? bidderRequest.gdprConsent.gdprApplies : 'true', gdpr_consent: bidderRequest.gdprConsent && bidderRequest.gdprConsent.consentString ? bidderRequest.gdprConsent.consentString : '', - referer: bidderRequest.refererInfo.referer, + // TODO: is 'page' the correct item here? + referer: bidderRequest.refererInfo.page, bids: [], }; diff --git a/modules/adfBidAdapter.js b/modules/adfBidAdapter.js index b6c82b90b33..fbcfa031f96 100644 --- a/modules/adfBidAdapter.js +++ b/modules/adfBidAdapter.js @@ -81,7 +81,7 @@ export const spec = { } if (!site.page) { - site.page = bidderRequest.refererInfo.referer; + site.page = bidderRequest.refererInfo.page; } } diff --git a/modules/adgenerationBidAdapter.js b/modules/adgenerationBidAdapter.js index e0d3a881cad..94527c5d051 100644 --- a/modules/adgenerationBidAdapter.js +++ b/modules/adgenerationBidAdapter.js @@ -49,7 +49,8 @@ export const spec = { if (!validReq.mediaTypes || !validReq.mediaTypes.native) { data = tryAppendQueryString(data, 'imark', '1'); } - data = tryAppendQueryString(data, 'tp', bidderRequest.refererInfo.referer); + // TODO: is 'page' the right value here? + data = tryAppendQueryString(data, 'tp', bidderRequest.refererInfo.page); if (isIos()) { const hyperId = getHyperId(validReq); if (hyperId != null) { diff --git a/test/spec/modules/adagioBidAdapter_spec.js b/test/spec/modules/adagioBidAdapter_spec.js index 6e25af374f0..6697b1a2224 100644 --- a/test/spec/modules/adagioBidAdapter_spec.js +++ b/test/spec/modules/adagioBidAdapter_spec.js @@ -16,7 +16,6 @@ import { loadExternalScript } from '../../../src/adloader.js'; import * as utils from '../../../src/utils.js'; import { config } from '../../../src/config.js'; import { NATIVE } from '../../../src/mediaTypes.js'; -import * as prebidGlobal from 'src/prebidGlobal.js'; import { executeRenderer } from '../../../src/Renderer.js'; const BidRequestBuilder = function BidRequestBuilder(options) { diff --git a/test/spec/modules/adbookpspBidAdapter_spec.js b/test/spec/modules/adbookpspBidAdapter_spec.js index 3a49f25edb6..f7e401fefbd 100755 --- a/test/spec/modules/adbookpspBidAdapter_spec.js +++ b/test/spec/modules/adbookpspBidAdapter_spec.js @@ -951,7 +951,9 @@ const bidderRequest = { bidderRequestId: '999ccceeee11', timeout: 200, refererInfo: { - referer: 'http://example-domain.com/foo', + page: 'http://mock-page.com', + domain: 'mock-page.com', + ref: 'http://example-domain.com/foo', }, gdprConsent: { gdprApplies: 1, @@ -999,8 +1001,8 @@ const bannerExchangeRequest = { }, }, site: { - domain: location.hostname, - page: location.href, + domain: 'mock-page.com', + page: 'http://mock-page.com', ref: 'http://example-domain.com/foo', }, source: { @@ -1089,8 +1091,8 @@ const videoExchangeRequest = { }, }, site: { - domain: location.hostname, - page: location.href, + domain: 'mock-page.com', + page: 'http://mock-page.com', ref: 'http://example-domain.com/foo', }, source: { @@ -1171,8 +1173,8 @@ const mixedExchangeRequest = { }, }, site: { - domain: location.hostname, - page: location.href, + domain: 'mock-page.com', + page: 'http://mock-page.com', ref: 'http://example-domain.com/foo', }, source: { diff --git a/test/spec/modules/addefendBidAdapter_spec.js b/test/spec/modules/addefendBidAdapter_spec.js index ac01750e98f..b3b6b2d417a 100644 --- a/test/spec/modules/addefendBidAdapter_spec.js +++ b/test/spec/modules/addefendBidAdapter_spec.js @@ -25,7 +25,7 @@ describe('addefendBidAdapter', () => { return spec.buildRequests(buildRequest, { ...bidderRequest || {}, refererInfo: { - referer: 'https://referer.example.com' + page: 'https://referer.example.com' } })[0]; }; diff --git a/test/spec/modules/adfBidAdapter_spec.js b/test/spec/modules/adfBidAdapter_spec.js index 94b8100c7fe..e8a78739df5 100644 --- a/test/spec/modules/adfBidAdapter_spec.js +++ b/test/spec/modules/adfBidAdapter_spec.js @@ -71,7 +71,7 @@ describe('Adf adapter', function () { adxDomain: '10.8.57.207' } }]; - let request = spec.buildRequests(validBidRequests, { refererInfo: { referer: 'page' } }); + let request = spec.buildRequests(validBidRequests, { refererInfo: { page: 'page' } }); assert.equal(request.method, 'POST'); assert.equal(request.url, 'https://10.8.57.207/adx/openrtb'); @@ -82,7 +82,7 @@ describe('Adf adapter', function () { describe('user privacy', function () { it('should send GDPR Consent data to adform if gdprApplies', function () { let validBidRequests = [{ bidId: 'bidId', params: { test: 1 } }]; - let bidderRequest = { gdprConsent: { gdprApplies: true, consentString: 'consentDataString' }, refererInfo: { referer: 'page' } }; + let bidderRequest = { gdprConsent: { gdprApplies: true, consentString: 'consentDataString' }, refererInfo: { page: 'page' } }; let request = JSON.parse(spec.buildRequests(validBidRequests, bidderRequest).data); assert.equal(request.user.ext.consent, bidderRequest.gdprConsent.consentString); @@ -92,7 +92,7 @@ describe('Adf adapter', function () { it('should send gdpr as number', function () { let validBidRequests = [{ bidId: 'bidId', params: { test: 1 } }]; - let bidderRequest = { gdprConsent: { gdprApplies: true, consentString: 'consentDataString' }, refererInfo: { referer: 'page' } }; + let bidderRequest = { gdprConsent: { gdprApplies: true, consentString: 'consentDataString' }, refererInfo: { page: 'page' } }; let request = JSON.parse(spec.buildRequests(validBidRequests, bidderRequest).data); assert.equal(typeof request.regs.ext.gdpr, 'number'); @@ -101,12 +101,12 @@ describe('Adf adapter', function () { it('should send CCPA Consent data to adform', function () { let validBidRequests = [{ bidId: 'bidId', params: { test: 1 } }]; - let bidderRequest = { uspConsent: '1YA-', refererInfo: { referer: 'page' } }; + let bidderRequest = { uspConsent: '1YA-', refererInfo: { page: 'page' } }; let request = JSON.parse(spec.buildRequests(validBidRequests, bidderRequest).data); assert.equal(request.regs.ext.us_privacy, '1YA-'); - bidderRequest = { uspConsent: '1YA-', gdprConsent: { gdprApplies: true, consentString: 'consentDataString' }, refererInfo: { referer: 'page' } }; + bidderRequest = { uspConsent: '1YA-', gdprConsent: { gdprApplies: true, consentString: 'consentDataString' }, refererInfo: { page: 'page' } }; request = JSON.parse(spec.buildRequests(validBidRequests, bidderRequest).data); assert.equal(request.regs.ext.us_privacy, '1YA-'); @@ -119,13 +119,13 @@ describe('Adf adapter', function () { bidId: 'bidId', params: { siteId: 'siteId' } }]; - let bidderRequest = {gdprConsent: {gdprApplies: false, consentString: 'consentDataString'}, refererInfo: { referer: 'page' }}; + let bidderRequest = {gdprConsent: {gdprApplies: false, consentString: 'consentDataString'}, refererInfo: { page: 'page' } }; let request = JSON.parse(spec.buildRequests(validBidRequests, bidderRequest).data); assert.equal(request.user.ext.consent, 'consentDataString'); assert.equal(request.regs.ext.gdpr, 0); - bidderRequest = {gdprConsent: {consentString: 'consentDataString'}, refererInfo: { referer: 'page' }}; + bidderRequest = {gdprConsent: {consentString: 'consentDataString'}, refererInfo: { page: 'page' }}; request = JSON.parse(spec.buildRequests(validBidRequests, bidderRequest).data); assert.equal(request.user, undefined); @@ -136,7 +136,7 @@ describe('Adf adapter', function () { bidId: 'bidId', params: { siteId: 'siteId' } }]; - let request = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { referer: 'page' } }).data); + let request = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { page: 'page' } }).data); assert.equal(request.user, undefined); assert.equal(request.regs, undefined); @@ -148,7 +148,7 @@ describe('Adf adapter', function () { bidId: 'bidId', params: { test: 1 } }]; - let request = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { referer: 'page' } }).data); + let request = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { page: 'page' } }).data); assert.ok(request.is_debug); assert.equal(request.test, 1); @@ -160,7 +160,7 @@ describe('Adf adapter', function () { bidId: 'bidId', params: { siteId: 'siteId' } }]; - let request = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { referer: 'page' } }).data); + let request = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { page: 'page' } }).data); let data = Object.keys(request); assert.deepEqual(keys, data); @@ -172,7 +172,7 @@ describe('Adf adapter', function () { params: { siteId: 'siteId' }, transactionId: 'transactionId' }]; - let request = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { referer: 'page' } }).data); + let request = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { page: 'page' } }).data); assert.equal(request.source.tid, validBidRequests[0].transactionId); assert.equal(request.source.fd, 1); @@ -182,7 +182,7 @@ describe('Adf adapter', function () { config.setConfig({ }); let validBidRequests = [{ bidId: 'bidId', params: { test: 1 } }]; - let bidderRequest = { gdprConsent: { gdprApplies: true, consentString: 'consentDataString' }, refererInfo: { referer: 'page' } }; + let bidderRequest = { gdprConsent: { gdprApplies: true, consentString: 'consentDataString' }, refererInfo: { page: 'page' } }; let request = JSON.parse(spec.buildRequests(validBidRequests, bidderRequest).data); assert.equal(request.regs.coppa, undefined); @@ -200,7 +200,7 @@ describe('Adf adapter', function () { coppa: true }); let validBidRequests = [{ bidId: 'bidId', params: { test: 1 } }]; - let request = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { referer: 'page' } }).data); + let request = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { page: 'page' } }).data); assert.equal(request.regs.coppa, 1); }); @@ -213,7 +213,7 @@ describe('Adf adapter', function () { bidId: 'bidId', params: { mid: '1000' } }]; - let request = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { referer: 'page' } }).data); + let request = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { page: 'page' } }).data); assert.equal(request.device.ua, navigator.userAgent); assert.equal(request.device.w, 100); @@ -230,7 +230,7 @@ describe('Adf adapter', function () { params: { mid: '1000' }, ortb2 }]; - let request = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { referer: 'page' }, ortb2 }).data); + let request = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { page: 'page' }, ortb2 }).data); assert.equal(request.app.id, 'appid'); assert.equal(request.app.name, 'appname'); @@ -258,11 +258,11 @@ describe('Adf adapter', function () { params: { mid: '1000' }, ortb2 }]; - let refererInfo = { referer: 'page' }; + let refererInfo = { page: 'page' }; let request = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo, ortb2 }).data); assert.deepEqual(request.site, { - page: refererInfo.referer, + page: refererInfo.page, publisher: { domain: 'publisher.domain.com', name: 'publisher\'s name' @@ -281,7 +281,7 @@ describe('Adf adapter', function () { }) }]; - let request = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { referer: 'page' } }).data); + let request = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { page: 'page' } }).data); assert.deepEqual(request.user.ext.eids, [ { source: 'adserver.org', uids: [ { id: 'TTD_ID_FROM_USER_ID_MODULE', atype: 1, ext: { rtiPartner: 'TDID' } } ] }, { source: 'pubcid.org', uids: [ { id: 'pubCommonId_FROM_USER_ID_MODULE', atype: 1 } ] } @@ -291,7 +291,7 @@ describe('Adf adapter', function () { it('should send currency if defined', function () { config.setConfig({ currency: { adServerCurrency: 'EUR' } }); let validBidRequests = [{ params: {} }]; - let refererInfo = { referer: 'page' }; + let refererInfo = { page: 'page' }; let request = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo }).data); assert.deepEqual(request.cur, [ 'EUR' ]); @@ -309,7 +309,7 @@ describe('Adf adapter', function () { } }]; - let request = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { referer: 'page' } }).data); + let request = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { page: 'page' } }).data); assert.deepEqual(request.source.ext.schain, { validation: 'strict', config: { @@ -324,7 +324,7 @@ describe('Adf adapter', function () { bidId: 'bidId', params: { siteId: 'siteId' } }]; - let request = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { referer: 'page' } }).data); + let request = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { page: 'page' } }).data); assert.equal(request.ext.pt, 'net'); }); @@ -333,7 +333,7 @@ describe('Adf adapter', function () { bidId: 'bidId', params: { priceType: 'net' } }]; - let request = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { referer: 'page' } }).data); + let request = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { page: 'page' } }).data); assert.equal(request.ext.pt, 'net'); }); @@ -348,7 +348,7 @@ describe('Adf adapter', function () { bidId: 'bidId2', params: { siteId: 'siteId' } }]; - let request = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { referer: 'page' } }).data); + let request = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { page: 'page' } }).data); assert.equal(request.imp.length, 2); }); @@ -366,7 +366,7 @@ describe('Adf adapter', function () { params: { mid: '1000' }, mediaTypes: {video: {}} }]; - let imps = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { referer: 'page' } }).data).imp; + let imps = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { page: 'page' } }).data).imp; for (let i = 0; i < 3; i++) { assert.equal(imps[i].id, i + 1); @@ -377,7 +377,7 @@ describe('Adf adapter', function () { let validBidRequests = [{ bidId: 'bidId', params: {mid: 1000}, mediaTypes: {video: {}} }, { bidId: 'bidId2', params: {mid: 1001}, mediaTypes: {video: {}} }, { bidId: 'bidId3', params: {mid: 1002}, mediaTypes: {video: {}} }]; - let imps = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { referer: 'page' } }).data).imp; + let imps = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { page: 'page' } }).data).imp; for (let i = 0; i < 3; i++) { assert.equal(imps[i].tagid, validBidRequests[i].params.mid); } @@ -490,7 +490,7 @@ describe('Adf adapter', function () { video: {} } }]; - let [ first, second, third ] = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { referer: 'page' } }).data).imp; + let [ first, second, third ] = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { page: 'page' } }).data).imp; assert.ok(first.banner); assert.ok(first.video); @@ -517,7 +517,7 @@ describe('Adf adapter', function () { } } }]; - let { banner } = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { referer: 'page' } }).data).imp[0]; + let { banner } = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { page: 'page' } }).data).imp[0]; assert.deepEqual(banner, { format: [ { w: 100, h: 100 }, { w: 200, h: 300 } ] }); @@ -537,7 +537,7 @@ describe('Adf adapter', function () { } } }]; - let { video } = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { referer: 'page' } }).data).imp[0]; + let { video } = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { page: 'page' } }).data).imp[0]; assert.deepEqual(video, { playerSize: [640, 480], context: 'outstream', @@ -558,7 +558,7 @@ describe('Adf adapter', function () { body: { len: 140 } } }]; - let assets = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { referer: 'page' } }).data).imp[0].native.request.assets; + let assets = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { page: 'page' } }).data).imp[0].native.request.assets; assert.equal(assets[0].id, 0); assert.equal(assets[1].id, 3); @@ -576,7 +576,7 @@ describe('Adf adapter', function () { } }]; - let assets = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { referer: 'page' } }).data).imp[0].native.request.assets; + let assets = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { page: 'page' } }).data).imp[0].native.request.assets; assert.equal(assets[0].required, 1); assert.ok(!assets[1].required); @@ -599,7 +599,7 @@ describe('Adf adapter', function () { } }]; - let assets = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { referer: 'page' } }).data).imp[0].native.request.assets; + let assets = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { page: 'page' } }).data).imp[0].native.request.assets; assert.ok(assets[0].title); assert.equal(assets[0].title.len, 140); assert.deepEqual(assets[1].img, { type: 3, w: 150, h: 50 }); @@ -622,7 +622,7 @@ describe('Adf adapter', function () { } }]; - let assets = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { referer: 'page' } }).data).imp[0].native.request.assets; + let assets = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { page: 'page' } }).data).imp[0].native.request.assets; assert.ok(assets[0].img); assert.equal(assets[0].img.w, 200); assert.equal(assets[0].img.h, 300); @@ -651,7 +651,7 @@ describe('Adf adapter', function () { } }]; - let assets = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { referer: 'page' } }).data).imp[0].native.request.assets; + let assets = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { page: 'page' } }).data).imp[0].native.request.assets; assert.ok(assets[0].img); assert.equal(assets[0].img.wmin, 100); assert.equal(assets[0].img.hmin, 300); @@ -675,7 +675,7 @@ describe('Adf adapter', function () { } }]; - assert.doesNotThrow(() => spec.buildRequests(validBidRequests, { refererInfo: { referer: 'page' } })); + assert.doesNotThrow(() => spec.buildRequests(validBidRequests, { refererInfo: { page: 'page' } })); }); }); @@ -693,7 +693,7 @@ describe('Adf adapter', function () { } }]; - let assets = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { referer: 'page' } }).data).imp[0].native.request.assets; + let assets = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { page: 'page' } }).data).imp[0].native.request.assets; assert.ok(assets[0].img); assert.equal(assets[0].img.wmin, 0); assert.equal(assets[0].img.hmin, 0); @@ -703,7 +703,7 @@ describe('Adf adapter', function () { }); function getRequestImps(validBidRequests) { - return JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { referer: 'page' } }).data).imp; + return JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { page: 'page' } }).data).imp; } }); diff --git a/test/spec/modules/adgenerationBidAdapter_spec.js b/test/spec/modules/adgenerationBidAdapter_spec.js index 030aa448c19..ac5ab220880 100644 --- a/test/spec/modules/adgenerationBidAdapter_spec.js +++ b/test/spec/modules/adgenerationBidAdapter_spec.js @@ -105,7 +105,7 @@ describe('AdgenerationAdapter', function () { ]; const bidderRequest = { refererInfo: { - referer: 'https://example.com' + page: 'https://example.com' } }; const data = {