prebid.js 9.2.0 → 9.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/creative/constants.js +2 -1
- package/creative/crossDomain.js +16 -4
- package/dist/33acrossAnalyticsAdapter.js +1 -1
- package/dist/33acrossBidAdapter.js +1 -1
- package/dist/33acrossIdSystem.js +1 -1
- package/dist/BTBidAdapter.js +1 -1
- package/dist/adagioAnalyticsAdapter.js +1 -1
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adagioRtdProvider.js +1 -1
- package/dist/adagioUtils.js +1 -1
- package/dist/addefendBidAdapter.js +1 -1
- package/dist/adfBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/adlooxRtdProvider.js +1 -1
- package/dist/adnuntiusBidAdapter.js +1 -1
- package/dist/adqueryBidAdapter.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adstirBidAdapter.js +1 -1
- package/dist/adtrgtmeBidAdapter.js +1 -1
- package/dist/adxcgAnalyticsAdapter.js +1 -1
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/adyoulikeBidAdapter.js +1 -1
- package/dist/agmaAnalyticsAdapter.js +1 -1
- package/dist/ajaBidAdapter.js +1 -1
- package/dist/amxBidAdapter.js +1 -1
- package/dist/amxIdSystem.js +1 -1
- package/dist/appierAnalyticsAdapter.js +1 -1
- package/dist/appnexusBidAdapter.js +1 -1
- package/dist/asoBidAdapter.js +1 -1
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bridBidAdapter.js +1 -1
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/carodaBidAdapter.js +1 -1
- package/dist/chtnwBidAdapter.js +1 -1
- package/dist/chunk-core.js +1 -1
- package/dist/codefuelBidAdapter.js +1 -1
- package/dist/concertBidAdapter.js +1 -1
- package/dist/connectadBidAdapter.js +1 -1
- package/dist/consentManagement.js +1 -0
- package/dist/consentManagementGpp.js +1 -1
- package/dist/consentManagementTcf.js +1 -1
- package/dist/consumableBidAdapter.js +1 -1
- package/dist/conversantAnalyticsAdapter.js +1 -1
- package/dist/conversantBidAdapter.js +1 -1
- package/dist/copper6sspBidAdapter.js +1 -0
- package/dist/cpmstarBidAdapter.js +1 -1
- package/dist/craftBidAdapter.js +1 -1
- package/dist/criteoBidAdapter.js +1 -1
- package/dist/cwireBidAdapter.js +1 -1
- package/dist/dailymotionBidAdapter.js +1 -1
- package/dist/deltaprojectsBidAdapter.js +1 -1
- package/dist/dependencies.json +51 -13
- package/dist/dianomiBidAdapter.js +1 -1
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/dxkultureBidAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/euidIdSystem.js +1 -1
- package/dist/exadsBidAdapter.js +1 -1
- package/dist/feedadBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/freewheel-sspBidAdapter.js +1 -1
- package/dist/gmosspBidAdapter.js +1 -1
- package/dist/goldbachBidAdapter.js +1 -1
- package/dist/greenbidsAnalyticsAdapter.js +1 -1
- package/dist/greenbidsRtdProvider.js +1 -1
- package/dist/gridBidAdapter.js +1 -1
- package/dist/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.js +1 -1
- package/dist/hypelabBidAdapter.js +1 -1
- package/dist/id5AnalyticsAdapter.js +1 -1
- package/dist/id5IdSystem.js +1 -1
- package/dist/illuminBidAdapter.js +1 -1
- package/dist/imdsBidAdapter.js +1 -1
- package/dist/improvedigitalBidAdapter.js +1 -1
- package/dist/insticatorBidAdapter.js +1 -1
- package/dist/intentIqIdSystem.js +1 -1
- package/dist/ixBidAdapter.js +1 -1
- package/dist/jixieBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/kargoBidAdapter.js +1 -1
- package/dist/kimberliteBidAdapter.js +1 -1
- package/dist/konduitAnalyticsAdapter.js +1 -1
- package/dist/kueezBidAdapter.js +1 -1
- package/dist/kueezRtbBidAdapter.js +1 -1
- package/dist/lassoBidAdapter.js +1 -1
- package/dist/lifestreetBidAdapter.js +1 -1
- package/dist/liveIntentIdSystem.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.js +1 -1
- package/dist/luceadBidAdapter.js +1 -1
- package/dist/luponmediaBidAdapter.js +1 -1
- package/dist/mabidderBidAdapter.js +1 -1
- package/dist/magniteAnalyticsAdapter.js +1 -1
- package/dist/malltvAnalyticsAdapter.js +1 -1
- package/dist/marsmediaBidAdapter.js +1 -1
- package/dist/mediafuseBidAdapter.js +1 -1
- package/dist/medianetAnalyticsAdapter.js +1 -1
- package/dist/medianetBidAdapter.js +1 -1
- package/dist/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/missenaBidAdapter.js +1 -1
- package/dist/nexx360BidAdapter.js +1 -1
- package/dist/nobidAnalyticsAdapter.js +1 -1
- package/dist/nobidBidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +184 -178
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/openwebBidAdapter.js +1 -1
- package/dist/openxBidAdapter.js +1 -1
- package/dist/optidigitalBidAdapter.js +1 -1
- package/dist/orakiBidAdapter.js +1 -0
- package/dist/orbidderBidAdapter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/ozoneBidAdapter.js +1 -1
- package/dist/pairIdSystem.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/prebidServerBidAdapter.js +1 -1
- package/dist/processResponse.js +1 -0
- package/dist/publinkIdSystem.js +1 -1
- package/dist/publirBidAdapter.js +1 -1
- package/dist/pubmaticAnalyticsAdapter.js +1 -1
- package/dist/pubmaticBidAdapter.js +1 -1
- package/dist/pubwiseAnalyticsAdapter.js +1 -1
- package/dist/pxyzBidAdapter.js +1 -1
- package/dist/quantcastBidAdapter.js +1 -1
- package/dist/readpeakBidAdapter.js +1 -1
- package/dist/relaidoBidAdapter.js +1 -1
- package/dist/retailspotBidAdapter.js +1 -1
- package/dist/rhythmoneBidAdapter.js +1 -1
- package/dist/riseBidAdapter.js +1 -1
- package/dist/rubiconBidAdapter.js +1 -1
- package/dist/seedingAllianceBidAdapter.js +1 -1
- package/dist/seedtagBidAdapter.js +1 -1
- package/dist/sharethroughAnalyticsAdapter.js +1 -1
- package/dist/sharethroughBidAdapter.js +1 -1
- package/dist/shinezBidAdapter.js +1 -1
- package/dist/shinezRtbBidAdapter.js +1 -1
- package/dist/smaatoBidAdapter.js +1 -1
- package/dist/smartadserverBidAdapter.js +1 -1
- package/dist/smartxBidAdapter.js +1 -1
- package/dist/smartyadsBidAdapter.js +1 -1
- package/dist/smartyadsUtils.js +1 -0
- package/dist/smilewantedBidAdapter.js +1 -1
- package/dist/snigelBidAdapter.js +1 -1
- package/dist/sonobiBidAdapter.js +1 -1
- package/dist/sovrnBidAdapter.js +1 -1
- package/dist/sspBCBidAdapter.js +1 -1
- package/dist/stnBidAdapter.js +1 -1
- package/dist/stvBidAdapter.js +1 -1
- package/dist/sublimeBidAdapter.js +1 -1
- package/dist/taboolaBidAdapter.js +1 -1
- package/dist/tagorasBidAdapter.js +1 -1
- package/dist/tappxBidAdapter.js +1 -1
- package/dist/targetVideoBidAdapter.js +1 -1
- package/dist/teadsBidAdapter.js +1 -1
- package/dist/terceptAnalyticsAdapter.js +1 -1
- package/dist/themoneytizerBidAdapter.js +1 -1
- package/dist/trionBidAdapter.js +1 -1
- package/dist/tripleliftBidAdapter.js +1 -1
- package/dist/ttdBidAdapter.js +1 -1
- package/dist/twistDigitalBidAdapter.js +1 -1
- package/dist/ucfunnelAnalyticsAdapter.js +1 -1
- package/dist/uid2IdSystem.js +1 -1
- package/dist/underdogmediaBidAdapter.js +1 -1
- package/dist/undertoneBidAdapter.js +1 -1
- package/dist/unrulyBidAdapter.js +1 -1
- package/dist/userId.js +1 -1
- package/dist/viantOrtbBidAdapter.js +1 -1
- package/dist/vidazooBidAdapter.js +1 -1
- package/dist/vidazooUtils.js +1 -0
- package/dist/videobyteBidAdapter.js +1 -1
- package/dist/visxBidAdapter.js +1 -1
- package/dist/vuukleBidAdapter.js +1 -1
- package/dist/widespaceBidAdapter.js +1 -1
- package/dist/winrBidAdapter.js +1 -1
- package/dist/yahooAdsBidAdapter.js +1 -1
- package/dist/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/dist/yuktamediaAnalyticsAdapter.js +1 -1
- package/dist/zeta_global_sspBidAdapter.js +1 -1
- package/integrationExamples/gpt/x-domain/creative.html +1 -1
- package/libraries/consentManagement/cmUtils.js +38 -0
- package/libraries/processResponse/index.js +12 -0
- package/libraries/smartyadsUtils/getAdUrlByRegion.js +32 -0
- package/libraries/vidazooUtils/bidderUtils.js +480 -0
- package/libraries/vidazooUtils/constants.js +7 -0
- package/modules/adagioRtdProvider.js +9 -7
- package/modules/addefendBidAdapter.js +1 -2
- package/modules/adfBidAdapter.js +1 -10
- package/modules/adlooxRtdProvider.js +1 -1
- package/modules/adnuntiusBidAdapter.js +1 -0
- package/modules/adxcgAnalyticsAdapter.js +1 -2
- package/modules/carodaBidAdapter.js +3 -8
- package/modules/codefuelBidAdapter.js +1 -10
- package/modules/consentManagementGpp.js +2 -38
- package/modules/consentManagementTcf.js +7 -38
- package/modules/conversantAnalyticsAdapter.js +1 -2
- package/modules/copper6sspBidAdapter.js +19 -0
- package/modules/copper6sspBidAdapter.md +79 -0
- package/modules/cpmstarBidAdapter.js +52 -36
- package/modules/cpmstarBidAdapter.md +1 -4
- package/modules/criteoBidAdapter.js +10 -3
- package/modules/dailymotionBidAdapter.js +1 -1
- package/modules/deltaprojectsBidAdapter.js +2 -11
- package/modules/dianomiBidAdapter.js +1 -9
- package/modules/finativeBidAdapter.js +1 -10
- package/modules/gridBidAdapter.js +2 -12
- package/modules/id5AnalyticsAdapter.js +1 -2
- package/modules/illuminBidAdapter.js +9 -304
- package/modules/intentIqIdSystem.js +408 -50
- package/modules/intentIqIdSystem.md +92 -0
- package/modules/kueezRtbBidAdapter.js +17 -312
- package/modules/liveIntentIdSystem.js +2 -2
- package/modules/luponmediaBidAdapter.js +4 -10
- package/modules/mabidderBidAdapter.js +1 -2
- package/modules/medianetAnalyticsAdapter.js +1 -2
- package/modules/medianetBidAdapter.js +1 -1
- package/modules/mgidBidAdapter.js +1 -10
- package/modules/orakiBidAdapter.js +19 -0
- package/modules/orakiBidAdapter.md +79 -0
- package/modules/orbidderBidAdapter.js +4 -2
- package/modules/outbrainBidAdapter.js +8 -43
- package/modules/ozoneBidAdapter.js +9 -7
- package/modules/pairIdSystem.js +27 -10
- package/modules/pixfutureBidAdapter.js +1 -2
- package/modules/prebidServerBidAdapter/index.js +1 -1
- package/modules/seedtagBidAdapter.js +4 -0
- package/modules/shinezRtbBidAdapter.js +12 -304
- package/modules/smartadserverBidAdapter.js +3 -0
- package/modules/smartyadsBidAdapter.js +6 -110
- package/modules/snigelBidAdapter.js +1 -2
- package/modules/tagorasBidAdapter.js +13 -316
- package/modules/tappxBidAdapter.js +1 -2
- package/modules/terceptAnalyticsAdapter.js +1 -2
- package/modules/twistDigitalBidAdapter.js +9 -433
- package/modules/userId/index.js +31 -21
- package/modules/viantOrtbBidAdapter.js +20 -0
- package/modules/vidazooBidAdapter.js +26 -468
- package/modules/visxBidAdapter.js +27 -29
- package/modules/yahooAdsBidAdapter.js +4 -1
- package/modules/yuktamediaAnalyticsAdapter.js +1 -2
- package/modules/zeta_global_sspBidAdapter.js +2 -2
- package/package.json +1 -1
- package/src/adRendering.js +25 -2
- package/src/constants.js +2 -0
- package/src/prebid.js +2 -1
- package/src/utils.js +19 -1
- package/test/spec/creative/crossDomainCreative_spec.js +38 -2
- package/test/spec/fpd/gdpr_spec.js +24 -2
- package/test/spec/libraries/processResponse_spec.js +60 -0
- package/test/spec/modules/adagioRtdProvider_spec.js +12 -0
- package/test/spec/modules/adnuntiusBidAdapter_spec.js +6 -3
- package/test/spec/modules/conversantAnalyticsAdapter_spec.js +1 -1
- package/test/spec/modules/copper6sspBidAdapter_spec.js +514 -0
- package/test/spec/modules/cpmstarBidAdapter_spec.js +1 -1
- package/test/spec/modules/dailymotionBidAdapter_spec.js +18 -14
- package/test/spec/modules/illuminBidAdapter_spec.js +26 -13
- package/test/spec/modules/intentIqIdSystem_spec.js +264 -36
- package/test/spec/modules/kueezRtbBidAdapter_spec.js +26 -15
- package/test/spec/modules/orakiBidAdapter_spec.js +510 -0
- package/test/spec/modules/outbrainBidAdapter_spec.js +32 -1
- package/test/spec/modules/seedtagBidAdapter_spec.js +27 -0
- package/test/spec/modules/shinezRtbBidAdapter_spec.js +26 -14
- package/test/spec/modules/smartadserverBidAdapter_spec.js +7 -0
- package/test/spec/modules/smartyadsBidAdapter_spec.js +6 -83
- package/test/spec/modules/tagorasBidAdapter_spec.js +26 -15
- package/test/spec/modules/twistDigitalBidAdapter_spec.js +19 -22
- package/test/spec/modules/userId_spec.js +86 -47
- package/test/spec/modules/viantOrtbBidAdapter_spec.js +87 -6
- package/test/spec/modules/vidazooBidAdapter_spec.js +21 -23
- package/test/spec/modules/visxBidAdapter_spec.js +180 -0
- package/test/spec/modules/yahooAdsBidAdapter_spec.js +1 -1
- package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +11 -0
- package/test/spec/unit/pbjs_api_spec.js +6 -1
package/src/adRendering.js
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
createIframe,
|
|
3
|
+
createInvisibleIframe,
|
|
4
|
+
deepAccess,
|
|
5
|
+
inIframe,
|
|
6
|
+
insertElement,
|
|
7
|
+
logError,
|
|
8
|
+
logWarn,
|
|
9
|
+
replaceMacros
|
|
10
|
+
} from './utils.js';
|
|
2
11
|
import * as events from './events.js';
|
|
3
|
-
import {
|
|
12
|
+
import {AD_RENDER_FAILED_REASON, BID_STATUS, EVENTS, MESSAGES, PB_LOCATOR} from './constants.js';
|
|
4
13
|
import {config} from './config.js';
|
|
5
14
|
import {executeRenderer, isRendererRequired} from './Renderer.js';
|
|
6
15
|
import {VIDEO} from './mediaTypes.js';
|
|
@@ -235,3 +244,17 @@ export function renderAdDirect(doc, adId, options) {
|
|
|
235
244
|
fail(EXCEPTION, e.message);
|
|
236
245
|
}
|
|
237
246
|
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Insert an invisible, named iframe that can be used by creatives to locate the window Prebid is running in
|
|
250
|
+
* (by looking for one that has `.frames[PB_LOCATOR]` defined).
|
|
251
|
+
* This is necessary because in some situations creatives may be rendered inside nested iframes - Prebid is not necessarily
|
|
252
|
+
* in the immediate parent window.
|
|
253
|
+
*/
|
|
254
|
+
export function insertLocatorFrame() {
|
|
255
|
+
if (!window.frames[PB_LOCATOR]) {
|
|
256
|
+
const frame = createInvisibleIframe();
|
|
257
|
+
frame.name = PB_LOCATOR;
|
|
258
|
+
document.body.appendChild(frame);
|
|
259
|
+
}
|
|
260
|
+
}
|
package/src/constants.js
CHANGED
package/src/prebid.js
CHANGED
|
@@ -39,7 +39,7 @@ import {newMetrics, useMetrics} from './utils/perfMetrics.js';
|
|
|
39
39
|
import {defer, GreedyPromise} from './utils/promise.js';
|
|
40
40
|
import {enrichFPD} from './fpd/enrichment.js';
|
|
41
41
|
import {allConsent} from './consentHandler.js';
|
|
42
|
-
import {renderAdDirect} from './adRendering.js';
|
|
42
|
+
import {insertLocatorFrame, renderAdDirect} from './adRendering.js';
|
|
43
43
|
import {getHighestCpm} from './utils/reducers.js';
|
|
44
44
|
import {fillVideoDefaults} from './video.js';
|
|
45
45
|
|
|
@@ -976,6 +976,7 @@ function processQueue(queue) {
|
|
|
976
976
|
* @alias module:pbjs.processQueue
|
|
977
977
|
*/
|
|
978
978
|
pbjsInstance.processQueue = function () {
|
|
979
|
+
insertLocatorFrame();
|
|
979
980
|
hook.ready();
|
|
980
981
|
processQueue(pbjsInstance.que);
|
|
981
982
|
processQueue(pbjsInstance.cmd);
|
package/src/utils.js
CHANGED
|
@@ -4,8 +4,9 @@ import {includes} from './polyfill.js';
|
|
|
4
4
|
import { EVENTS, S2S } from './constants.js';
|
|
5
5
|
import {GreedyPromise} from './utils/promise.js';
|
|
6
6
|
import {getGlobal} from './prebidGlobal.js';
|
|
7
|
+
import { default as deepAccess } from 'dlv/index.js';
|
|
7
8
|
|
|
8
|
-
export {
|
|
9
|
+
export { deepAccess };
|
|
9
10
|
export { dset as deepSetValue } from 'dset';
|
|
10
11
|
|
|
11
12
|
var tStr = 'String';
|
|
@@ -1231,3 +1232,20 @@ export function hasNonSerializableProperty(obj, checkedObjects = new Set()) {
|
|
|
1231
1232
|
}
|
|
1232
1233
|
return false;
|
|
1233
1234
|
}
|
|
1235
|
+
|
|
1236
|
+
/**
|
|
1237
|
+
* Returns the value of a nested property in an array of objects.
|
|
1238
|
+
*
|
|
1239
|
+
* @param {Array} collection - Array of objects.
|
|
1240
|
+
* @param {String} key - Key of nested property.
|
|
1241
|
+
* @returns {any, undefined} - Value of nested property.
|
|
1242
|
+
*/
|
|
1243
|
+
export function setOnAny(collection, key) {
|
|
1244
|
+
for (let i = 0, result; i < collection.length; i++) {
|
|
1245
|
+
result = deepAccess(collection[i], key);
|
|
1246
|
+
if (result) {
|
|
1247
|
+
return result;
|
|
1248
|
+
}
|
|
1249
|
+
}
|
|
1250
|
+
return undefined;
|
|
1251
|
+
}
|
|
@@ -9,12 +9,18 @@ import {
|
|
|
9
9
|
|
|
10
10
|
describe('cross-domain creative', () => {
|
|
11
11
|
const ORIGIN = 'https://example.com';
|
|
12
|
-
let win, renderAd, messages, mkIframe;
|
|
12
|
+
let win, top, renderAd, messages, mkIframe;
|
|
13
13
|
|
|
14
14
|
beforeEach(() => {
|
|
15
15
|
messages = [];
|
|
16
16
|
mkIframe = sinon.stub();
|
|
17
|
+
top = {
|
|
18
|
+
frames: {}
|
|
19
|
+
};
|
|
20
|
+
top.top = top;
|
|
17
21
|
win = {
|
|
22
|
+
top,
|
|
23
|
+
frames: {},
|
|
18
24
|
document: {
|
|
19
25
|
body: {
|
|
20
26
|
appendChild: sinon.stub(),
|
|
@@ -30,12 +36,14 @@ describe('cross-domain creative', () => {
|
|
|
30
36
|
})
|
|
31
37
|
},
|
|
32
38
|
parent: {
|
|
39
|
+
parent: top,
|
|
40
|
+
frames: {'__pb_locator__': {}},
|
|
33
41
|
postMessage: sinon.stub().callsFake((payload, targetOrigin, transfer) => {
|
|
34
42
|
messages.push({payload: JSON.parse(payload), targetOrigin, transfer});
|
|
35
43
|
})
|
|
36
44
|
}
|
|
37
45
|
};
|
|
38
|
-
renderAd = renderer(win);
|
|
46
|
+
renderAd = (...args) => renderer(win)(...args);
|
|
39
47
|
})
|
|
40
48
|
|
|
41
49
|
function waitFor(predicate, timeout = 1000) {
|
|
@@ -64,6 +72,34 @@ describe('cross-domain creative', () => {
|
|
|
64
72
|
expect(messages[0].targetOrigin).to.eql('https://domain.com:123')
|
|
65
73
|
});
|
|
66
74
|
|
|
75
|
+
it('posts to first parent if no __pb_locator__ can be found', () => {
|
|
76
|
+
delete win.parent.frames['__pb_locator__'];
|
|
77
|
+
renderAd({pubUrl: 'https://www.example.com'});
|
|
78
|
+
expect(messages.length).to.eql(1);
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
describe('when there are multiple ancestors', () => {
|
|
82
|
+
let target;
|
|
83
|
+
beforeEach(() => {
|
|
84
|
+
target = win.parent;
|
|
85
|
+
win.parent = {
|
|
86
|
+
top,
|
|
87
|
+
frames: {},
|
|
88
|
+
parent: {
|
|
89
|
+
...target,
|
|
90
|
+
parent: {
|
|
91
|
+
frames: {'__pb_locator__': {}},
|
|
92
|
+
top
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
})
|
|
97
|
+
it('posts message to the first ancestor with __pb_locator__ child', () => {
|
|
98
|
+
renderAd({pubUrl: 'https://www.example.com'});
|
|
99
|
+
expect(messages.length).to.eql(1);
|
|
100
|
+
});
|
|
101
|
+
})
|
|
102
|
+
|
|
67
103
|
it('generates request message with adId and clickUrl', () => {
|
|
68
104
|
renderAd({adId: '123', clickUrl: 'https://click-url.com', pubUrl: ORIGIN});
|
|
69
105
|
expect(messages[0].payload).to.eql({
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import {gdprDataHandler} from '../../../src/adapterManager.js';
|
|
2
2
|
import {enrichFPDHook} from '../../../modules/consentManagementTcf.js';
|
|
3
|
+
import {config} from 'src/config.js';
|
|
4
|
+
import 'src/prebid.js';
|
|
3
5
|
|
|
4
6
|
describe('GDPR FPD enrichment', () => {
|
|
5
7
|
let sandbox, consent;
|
|
@@ -12,9 +14,9 @@ describe('GDPR FPD enrichment', () => {
|
|
|
12
14
|
sandbox.restore();
|
|
13
15
|
})
|
|
14
16
|
|
|
15
|
-
function callHook() {
|
|
17
|
+
function callHook(ortb2 = {}) {
|
|
16
18
|
let result;
|
|
17
|
-
enrichFPDHook((res) => { result = res }, Promise.resolve(
|
|
19
|
+
enrichFPDHook((res) => { result = res }, Promise.resolve(ortb2));
|
|
18
20
|
return result;
|
|
19
21
|
}
|
|
20
22
|
|
|
@@ -44,4 +46,24 @@ describe('GDPR FPD enrichment', () => {
|
|
|
44
46
|
})
|
|
45
47
|
})
|
|
46
48
|
});
|
|
49
|
+
|
|
50
|
+
describe('dsa', () => {
|
|
51
|
+
describe('when dsaPlaform is set', () => {
|
|
52
|
+
beforeEach(() => {
|
|
53
|
+
config.setConfig({
|
|
54
|
+
consentManagement: {
|
|
55
|
+
gdpr: {
|
|
56
|
+
dsaPlatform: true
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('sets dsarequired', () => {
|
|
63
|
+
return callHook().then(ortb2 => {
|
|
64
|
+
expect(ortb2.regs.ext.dsa.dsarequired).to.equal(3);
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
});
|
|
47
69
|
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { getBidFromResponse } from '../../../libraries/processResponse/index.js';
|
|
2
|
+
import {expect} from 'chai/index.js';
|
|
3
|
+
|
|
4
|
+
describe('processResponse', function () {
|
|
5
|
+
const respItem = {
|
|
6
|
+
'bid': [
|
|
7
|
+
{
|
|
8
|
+
'price': 0.504,
|
|
9
|
+
'ext': {
|
|
10
|
+
'visx': {
|
|
11
|
+
'events': {
|
|
12
|
+
'runtime': '//t.visx.net/track/status/RFTFjZflStSUyuXuyT2IKOZMVPUIiPkzebpPWYwKvNkE_IybYfFxk2P5feBnt9LhiR7291KTG11JjrnyHyhVKfolH_VRCmGppbnHXHfHJ9AgNqjhFB_yTg3m18wGO9k4LOddGAg3mk8qc5zYEIzNsPFnZzos1EkHh5WNs0EjrBpwCgTERUqM3PJD_Zy60nMDA-LCuq-Z4JNBGC_GHx4LwvwXipQsjdGHS-HkqHHf9sES45OlRrW4wMf69dsmey1gvwqFAhJwii2lzo9wfOohLCMRa3Vxd-zvzx-uw71maWOyKnJXWiP6c5xkyrfV4gukNYaDUgrHc0mA0yhqyiHxe8KzEl32rxQXJRCg4FoJcJ1g9jmpZQBnIh2QrKm5iC159elwzwf31_v3Uw97Zpek8j0CCLa8FjxSjvXm1Mq8x4jcwlt0ngfWU6WwyyKwX_GMbKWuAL_nrfxSvs1hZCb4eunEFyXb2lN2olWo8ezMEzZ8YRxF_mx0hDB3NXyV0Tb4b6KXQq7tvxV-1rKPRt7DySRTbLPht0hO3mjTHxutfihnuL6ROEr372gSAiDodnbdCq_lPsCsUSEpG7DmN-4In10uSp2MemjfbqI6tllOCO-j6Pm9mhdl_rT4anHmRG2DG_dLsfD7pLaAsgf2zl2bpawhxxLVjTxikoWjNKAvr_GNh4adHGj5EHbqaBaHovB573Yk-koHkyBNrebeiy-1-Knc28MWOpFi9XKjNsXx756jAXLx2H098ptaXF3mFiuT2Iv6sTVjqOI/{STATUS_CODE}'
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
'prebid': {
|
|
16
|
+
'events': {
|
|
17
|
+
'pending': '//t.visx.net/track/pending/RFTFjZflStSUyuXuyT2IKOZMVPUIiPkzebpPWYwKvNkE_IybYfFxk2P5feBnt9LhiR7291KTG11JjrnyHyhVKfolH_VRCmGppbnHXHfHJ9AgNqjhFB_yTg3m18wGO9k4LOddGAg3mk8qc5zYEIzNsPFnZzos1EkHh5WNs0EjrBpwCgTERUqM3PJD_Zy60nMDA-LCuq-Z4JNBGC_GHx4LwvwXipQsjdGHS-HkqHHf9sES45OlRrW4wMf69dsmey1gvwqFAhJwii2lzo9wfOohLCMRa3Vxd-zvzx-uw71maWOyKnJXWiP6c5xkyrfV4gukNYaDUgrHc0mA0yhqyiHxe8KzEl32rxQXJRCg4FoJcJ1g9jmpZQBnIh2QrKm5iC159elwzwf31_v3Uw97Zpek8j0CCLa8FjxSjvXm1Mq8x4jcwlt0ngfWU6WwyyKwX_GMbKWuAL_nrfxSvs1hZCb4eunEFyXb2lN2olWo8ezMEzZ8YRxF_mx0hDB3NXyV0Tb4b6KXQq7tvxV-1rKPRt7DySRTbLPht0hO3mjTHxutfihnuL6ROEr372gSAiDodnbdCq_lPsCsUSEpG7DmN-4In10uSp2MemjfbqI6tllOCO-j6Pm9mhdl_rT4anHmRG2DG_dLsfD7pLaAsgf2zl2bpawhxxLVjTxikoWjNKAvr_GNh4adHGj5EHbqaBaHovB573Yk-koHkyBNrebeiy-1-Knc28MWOpFi9XKjNsXx756jAXLx2H098ptaXF3mFiuT2Iv6sTVjqOI/',
|
|
18
|
+
'win': '//t.visx.net/track/win/RFTFjZflStSUyuXuyT2IKOZMVPUIiPkzebpPWYwKvNkE_IybYfFxk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N-4In10uSp2MemjfbqI6tllOCO-j6Pm9mhdl_rT4anHmRG2DG_dLsfD7pLaAsgf2zl2bpawhxxLVjTxikoWjNKAvr_GNh4adHGj5EHbqaBaHovB573Yk-koHkyBNrebeiy-1-Knc28MWOpFi9XKjNsXx756jAXLx2H098ptaXF3mFiuT2Iv6sTVjqOI/{STATUS_CODE}'
|
|
21
|
+
},
|
|
22
|
+
'meta': {
|
|
23
|
+
'mediaType': 'banner'
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
'impid': '2b642c27bdcf8f',
|
|
28
|
+
'auid': 929004,
|
|
29
|
+
'h': 250,
|
|
30
|
+
'cur': 'EUR',
|
|
31
|
+
'adomain': [
|
|
32
|
+
''
|
|
33
|
+
],
|
|
34
|
+
'w': 300,
|
|
35
|
+
'id': '9b6c7e04-0a09-4add-8ba9-0c8b98304de3'
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
'seat': '1429601'
|
|
39
|
+
};
|
|
40
|
+
const LOG_ERROR_MESS = {
|
|
41
|
+
'noAuid': 'Bid from response has no auid parameter - ',
|
|
42
|
+
'noAdm': 'Bid from response has no adm parameter - ',
|
|
43
|
+
'noBid': 'Array of bid objects is empty',
|
|
44
|
+
'noImpId': 'Bid from response has no impid parameter - ',
|
|
45
|
+
'noPlacementCode': 'Can\'t find in requested bids the bid with auid - ',
|
|
46
|
+
'emptyUids': 'Uids should not be empty',
|
|
47
|
+
'emptySeatbid': 'Seatbid array from response has an empty item',
|
|
48
|
+
'emptyResponse': 'Response is empty',
|
|
49
|
+
'hasEmptySeatbidArray': 'Response has empty seatbid array',
|
|
50
|
+
'hasNoArrayOfBids': 'Seatbid from response has no array of bid objects - ',
|
|
51
|
+
'notAllowedCurrency': 'Currency is not supported - ',
|
|
52
|
+
'currencyMismatch': 'Currency from the request is not match currency from the response - ',
|
|
53
|
+
'onlyVideoInstream': 'Only video instream supported',
|
|
54
|
+
'videoMissing': 'Bid request videoType property is missing - '
|
|
55
|
+
};
|
|
56
|
+
it('returns bid when respItem and LOG_ERROR_MESS is passed', function () {
|
|
57
|
+
let response = getBidFromResponse(respItem, LOG_ERROR_MESS);
|
|
58
|
+
expect(response).not.include.any.keys('emptyResponse', 'hasNoArrayOfBids', 'emptySeatbid');
|
|
59
|
+
});
|
|
60
|
+
});
|
|
@@ -436,6 +436,18 @@ describe('Adagio Rtd Provider', function () {
|
|
|
436
436
|
expect(bidRequest.adUnits[0]).to.have.property('ortb2Imp');
|
|
437
437
|
expect(bidRequest.adUnits[0].ortb2Imp.ext.data.placement).to.not.exist;
|
|
438
438
|
});
|
|
439
|
+
|
|
440
|
+
it('ensure we create the `ortb2Imp` object if it does not exist', function() {
|
|
441
|
+
const configCopy = utils.deepClone(config);
|
|
442
|
+
configCopy.params.placementSource = PLACEMENT_SOURCES.ADUNITCODE;
|
|
443
|
+
|
|
444
|
+
const bidRequest = utils.deepClone(bidReqConfig);
|
|
445
|
+
delete bidRequest.adUnits[0].ortb2Imp;
|
|
446
|
+
|
|
447
|
+
adagioRtdSubmodule.getBidRequestData(bidRequest, cb, configCopy);
|
|
448
|
+
expect(bidRequest.adUnits[0]).to.have.property('ortb2Imp');
|
|
449
|
+
expect(bidRequest.adUnits[0].ortb2Imp.ext.data.placement).to.equal('div-gpt-ad-1460505748561-0');
|
|
450
|
+
});
|
|
439
451
|
});
|
|
440
452
|
});
|
|
441
453
|
|
|
@@ -876,14 +876,15 @@ describe('adnuntiusBidAdapter', function () {
|
|
|
876
876
|
config.setBidderConfig({
|
|
877
877
|
bidders: ['adnuntius'],
|
|
878
878
|
config: {
|
|
879
|
-
useCookie: false
|
|
879
|
+
useCookie: false,
|
|
880
|
+
advertiserTransparency: true
|
|
880
881
|
}
|
|
881
882
|
});
|
|
882
883
|
|
|
883
884
|
const request = config.runWithBidder('adnuntius', () => spec.buildRequests(bidderRequests, {}));
|
|
884
885
|
expect(request.length).to.equal(1);
|
|
885
886
|
expect(request[0]).to.have.property('url')
|
|
886
|
-
expect(request[0].url).to.equal(ENDPOINT_URL_NOCOOKIE);
|
|
887
|
+
expect(request[0].url).to.equal(ENDPOINT_URL_NOCOOKIE + '&advertiserTransparency=true');
|
|
887
888
|
});
|
|
888
889
|
});
|
|
889
890
|
|
|
@@ -981,7 +982,9 @@ describe('adnuntiusBidAdapter', function () {
|
|
|
981
982
|
config.setBidderConfig({
|
|
982
983
|
bidders: ['adnuntius'],
|
|
983
984
|
config: {
|
|
984
|
-
maxDeals: 2
|
|
985
|
+
maxDeals: 2,
|
|
986
|
+
useCookie: 'ignore-this',
|
|
987
|
+
advertiserTransparency: 'ignore-this-as-well'
|
|
985
988
|
}
|
|
986
989
|
});
|
|
987
990
|
|
|
@@ -14,7 +14,7 @@ describe('Conversant analytics adapter tests', function() {
|
|
|
14
14
|
let clock; // clock stub from sinon to mock our cache cleanup interval
|
|
15
15
|
let logInfoStub;
|
|
16
16
|
|
|
17
|
-
const PREBID_VERSION = '
|
|
17
|
+
const PREBID_VERSION = '$prebid.version$';
|
|
18
18
|
const SITE_ID = 108060;
|
|
19
19
|
|
|
20
20
|
let requests;
|