prebid.js 9.1.0 → 9.3.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/browsers.json +3 -3
- 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/acuityadsBidAdapter.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 -0
- package/dist/addefendBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/adlooxRtdProvider.js +1 -1
- package/dist/admanBidAdapter.js +1 -1
- package/dist/adnuntiusBidAdapter.js +1 -1
- package/dist/adpod.js +1 -1
- package/dist/adprimeBidAdapter.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/appnexusUtils.js +1 -1
- package/dist/asoBidAdapter.js +1 -1
- package/dist/autoplayDetection.js +1 -1
- package/dist/axisBidAdapter.js +1 -1
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/beyondmediaBidAdapter.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bliinkBidAdapter.js +1 -1
- package/dist/boldwinBidAdapter.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/compassBidAdapter.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/contentexchangeBidAdapter.js +1 -1
- package/dist/conversantAnalyticsAdapter.js +1 -1
- package/dist/conversantBidAdapter.js +1 -1
- package/dist/copper6sspBidAdapter.js +1 -0
- 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/dependencies.json +96 -6
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/dxkultureBidAdapter.js +1 -1
- package/dist/e_volutionBidAdapter.js +1 -1
- package/dist/emtvBidAdapter.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/globalsunBidAdapter.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/iqzoneBidAdapter.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/kiviadsBidAdapter.js +1 -1
- package/dist/konduitAnalyticsAdapter.js +1 -1
- package/dist/krushmediaBidAdapter.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/loyalBidAdapter.js +1 -1
- package/dist/luceadBidAdapter.js +1 -1
- package/dist/lunamediahbBidAdapter.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/mathildeadsBidAdapter.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/mgidXBidAdapter.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/missenaBidAdapter.js +1 -1
- package/dist/mobfoxpbBidAdapter.js +1 -1
- package/dist/mobianRtdProvider.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 +211 -204
- 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/ortbConverter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/ozoneBidAdapter.js +1 -1
- package/dist/paapi.js +1 -1
- package/dist/pairIdSystem.js +1 -1
- package/dist/pgamsspBidAdapter.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/playdigoBidAdapter.js +1 -1
- package/dist/prebidServerBidAdapter.js +1 -1
- package/dist/pubCircleBidAdapter.js +1 -1
- 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/pubxaiAnalyticsAdapter.js +1 -1
- package/dist/pxyzBidAdapter.js +1 -1
- package/dist/qtBidAdapter.js +1 -1
- package/dist/quantcastBidAdapter.js +1 -1
- package/dist/raynRtdProvider.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/setupadBidAdapter.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/smartytechBidAdapter.js +1 -1
- 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/teqblazeUtils.js +1 -0
- package/dist/terceptAnalyticsAdapter.js +1 -1
- package/dist/themoneytizerBidAdapter.js +1 -1
- package/dist/topicsFpdModule.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/vidazooBidAdapter.js +1 -1
- package/dist/vidazooUtils.js +1 -0
- package/dist/videobyteBidAdapter.js +1 -1
- package/dist/visiblemeasuresBidAdapter.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/integrationExamples/gpt/raynRtdProvider_example.html +1 -0
- package/libraries/adagioUtils/adagioUtils.js +35 -0
- package/libraries/appnexusUtils/anUtils.js +1 -0
- package/libraries/autoplayDetection/autoplay.js +8 -1
- package/libraries/consentManagement/cmUtils.js +38 -0
- package/libraries/ortbConverter/converter.js +1 -1
- package/libraries/smartyadsUtils/getAdUrlByRegion.js +32 -0
- package/libraries/teqblazeUtils/bidderUtils.js +253 -0
- package/libraries/vidazooUtils/bidderUtils.js +481 -0
- package/libraries/vidazooUtils/constants.js +7 -0
- package/modules/.submodules.json +1 -0
- package/modules/acuityadsBidAdapter.js +5 -203
- package/modules/adagioBidAdapter.js +1 -17
- package/modules/adagioRtdProvider.js +41 -51
- package/modules/adagioRtdProvider.md +1 -0
- package/modules/addefendBidAdapter.js +1 -2
- package/modules/adlooxRtdProvider.js +1 -1
- package/modules/admanBidAdapter.js +31 -188
- package/modules/adnuntiusBidAdapter.js +1 -0
- package/modules/adprimeBidAdapter.js +28 -165
- package/modules/adxcgAnalyticsAdapter.js +1 -2
- package/modules/axisBidAdapter.js +33 -165
- package/modules/beyondmediaBidAdapter.js +5 -189
- package/modules/bliinkBidAdapter.js +3 -31
- package/modules/boldwinBidAdapter.js +21 -159
- package/modules/ceeIdSystem.js +1 -1
- package/modules/compassBidAdapter.js +5 -198
- package/modules/consentManagementGpp.js +2 -38
- package/modules/consentManagementTcf.js +7 -38
- package/modules/contentexchangeBidAdapter.js +5 -200
- package/modules/conversantAnalyticsAdapter.js +1 -2
- package/modules/conversantBidAdapter.js +1 -0
- package/modules/copper6sspBidAdapter.js +19 -0
- package/modules/copper6sspBidAdapter.md +79 -0
- package/modules/criteoBidAdapter.js +10 -3
- package/modules/e_volutionBidAdapter.js +4 -186
- package/modules/emtvBidAdapter.js +5 -198
- package/modules/globalsunBidAdapter.js +5 -199
- package/modules/id5AnalyticsAdapter.js +1 -2
- package/modules/id5IdSystem.js +31 -2
- package/modules/id5IdSystem.md +67 -2
- package/modules/intentIqIdSystem.js +408 -50
- package/modules/intentIqIdSystem.md +92 -0
- package/modules/iqzoneBidAdapter.js +5 -224
- package/modules/kiviadsBidAdapter.js +5 -199
- package/modules/krushmediaBidAdapter.js +25 -143
- package/modules/liveIntentIdSystem.js +2 -2
- package/modules/loyalBidAdapter.js +4 -178
- package/modules/lunamediahbBidAdapter.js +5 -118
- package/modules/mabidderBidAdapter.js +1 -2
- package/modules/mathildeadsBidAdapter.js +5 -198
- package/modules/medianetAnalyticsAdapter.js +1 -2
- package/modules/medianetBidAdapter.js +1 -1
- package/modules/mgidXBidAdapter.js +14 -207
- package/modules/mobfoxpbBidAdapter.js +4 -135
- package/modules/mobianRtdProvider.js +2 -2
- package/modules/nobidAnalyticsAdapter.js +2 -3
- package/modules/orakiBidAdapter.js +19 -0
- package/modules/orakiBidAdapter.md +79 -0
- package/modules/orbidderBidAdapter.js +4 -2
- package/modules/ozoneBidAdapter.js +117 -58
- package/modules/paapi.js +2 -1
- package/modules/pairIdSystem.js +27 -10
- package/modules/pgamsspBidAdapter.js +5 -240
- package/modules/pixfutureBidAdapter.js +1 -2
- package/modules/playdigoBidAdapter.js +4 -186
- package/modules/prebidServerBidAdapter/index.js +10 -3
- package/modules/pubCircleBidAdapter.js +5 -218
- package/modules/pubmaticAnalyticsAdapter.js +21 -8
- package/modules/pubxaiAnalyticsAdapter.js +1 -5
- package/modules/qtBidAdapter.js +5 -224
- package/modules/raynRtdProvider.js +36 -3
- package/modules/seedtagBidAdapter.js +5 -0
- package/modules/setupadBidAdapter.js +58 -140
- package/modules/smartadserverBidAdapter.js +3 -0
- package/modules/smartyadsBidAdapter.js +6 -110
- package/modules/smartytechBidAdapter.js +7 -2
- package/modules/snigelBidAdapter.js +1 -2
- package/modules/tappxBidAdapter.js +1 -2
- package/modules/terceptAnalyticsAdapter.js +1 -2
- package/modules/topicsFpdModule.js +1 -1
- package/modules/twistDigitalBidAdapter.js +1 -12
- package/modules/uid2IdSystem.js +0 -1
- package/modules/uid2IdSystem_shared.js +0 -1
- package/modules/userId/index.js +31 -21
- package/modules/vidazooBidAdapter.js +26 -468
- package/modules/visiblemeasuresBidAdapter.js +5 -199
- package/modules/yahooAdsBidAdapter.js +4 -1
- package/modules/yuktamediaAnalyticsAdapter.js +1 -2
- package/package.json +1 -1
- package/src/auction.js +5 -63
- package/src/utils/focusTimeout.js +41 -0
- package/src/utils/ttlCollection.js +2 -1
- package/src/utils.js +42 -0
- package/src/videoCache.js +72 -0
- package/test/mocks/videoCacheStub.js +1 -1
- package/test/spec/auctionmanager_spec.js +16 -1
- package/test/spec/fpd/gdpr_spec.js +24 -2
- package/test/spec/libraries/teqblazeUtils/bidderUtils_spec.js +519 -0
- package/test/spec/modules/acuityadsBidAdapter_spec.js +79 -43
- package/test/spec/modules/adagioRtdProvider_spec.js +62 -1
- package/test/spec/modules/admanBidAdapter_spec.js +370 -247
- package/test/spec/modules/adnuntiusBidAdapter_spec.js +6 -3
- package/test/spec/modules/adprimeBidAdapter_spec.js +225 -78
- package/test/spec/modules/axisBidAdapter_spec.js +78 -14
- package/test/spec/modules/beyondmediaBidAdapter_spec.js +80 -18
- package/test/spec/modules/bliinkBidAdapter_spec.js +8 -2
- package/test/spec/modules/boldwinBidAdapter_spec.js +221 -75
- package/test/spec/modules/compassBidAdapter_spec.js +130 -16
- package/test/spec/modules/contentexchangeBidAdapter_spec.js +134 -21
- package/test/spec/modules/conversantAnalyticsAdapter_spec.js +1 -1
- package/test/spec/modules/conversantBidAdapter_spec.js +7 -0
- package/test/spec/modules/copper6sspBidAdapter_spec.js +514 -0
- package/test/spec/modules/e_volutionBidAdapter_spec.js +65 -3
- package/test/spec/modules/emtvBidAdapter_spec.js +131 -16
- package/test/spec/modules/globalsunBidAdapter_spec.js +130 -16
- package/test/spec/modules/id5IdSystem_spec.js +79 -3
- package/test/spec/modules/intentIqIdSystem_spec.js +264 -36
- package/test/spec/modules/iqzoneBidAdapter_spec.js +66 -12
- package/test/spec/modules/kiviadsBidAdapter_spec.js +131 -20
- package/test/spec/modules/krushmediaBidAdapter_spec.js +272 -90
- package/test/spec/modules/loyalBidAdapter_spec.js +114 -14
- package/test/spec/modules/lunamediahbBidAdapter_spec.js +221 -87
- package/test/spec/modules/mathildeadsBidAdapter_spec.js +87 -18
- package/test/spec/modules/mgidXBidAdapter_spec.js +11 -3
- package/test/spec/modules/mobfoxpbBidAdapter_spec.js +229 -91
- package/test/spec/modules/orakiBidAdapter_spec.js +510 -0
- package/test/spec/modules/ozoneBidAdapter_spec.js +192 -22
- package/test/spec/modules/paapi_spec.js +5 -5
- package/test/spec/modules/pgamsspBidAdapter_spec.js +83 -16
- package/test/spec/modules/playdigoBidAdapter_spec.js +38 -9
- package/test/spec/modules/prebidServerBidAdapter_spec.js +14 -0
- package/test/spec/modules/pubCircleBidAdapter_spec.js +82 -17
- package/test/spec/modules/pubmaticAnalyticsAdapter_spec.js +52 -5
- package/test/spec/modules/qtBidAdapter_spec.js +15 -3
- package/test/spec/modules/raynRtdProvider_spec.js +25 -0
- package/test/spec/modules/seedtagBidAdapter_spec.js +29 -0
- package/test/spec/modules/setupadBidAdapter_spec.js +124 -97
- package/test/spec/modules/smartadserverBidAdapter_spec.js +7 -0
- package/test/spec/modules/smartyadsBidAdapter_spec.js +6 -83
- package/test/spec/modules/smartytechBidAdapter_spec.js +5 -1
- package/test/spec/modules/topicsFpdModule_spec.js +43 -59
- package/test/spec/modules/twistDigitalBidAdapter_spec.js +5 -3
- package/test/spec/modules/userId_spec.js +86 -47
- package/test/spec/modules/vidazooBidAdapter_spec.js +21 -23
- package/test/spec/modules/visiblemeasuresBidAdapter_spec.js +130 -16
- package/test/spec/modules/yahooAdsBidAdapter_spec.js +1 -1
- package/test/spec/ortbConverter/converter_spec.js +7 -3
- package/test/spec/unit/utils/focusTimeout_spec.js +60 -0
- package/test/spec/videoCache_spec.js +56 -53
package/modules/qtBidAdapter.js
CHANGED
|
@@ -1,238 +1,19 @@
|
|
|
1
|
-
import { logMessage, deepAccess } from '../src/utils.js';
|
|
2
|
-
import { convertOrtbRequestToProprietaryNative } from '../src/native.js';
|
|
3
1
|
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
4
2
|
import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
|
|
5
|
-
import {
|
|
3
|
+
import { isBidRequestValid, buildRequests, interpretResponse, getUserSyncs } from '../libraries/teqblazeUtils/bidderUtils.js';
|
|
6
4
|
|
|
7
5
|
const BIDDER_CODE = 'qt';
|
|
8
6
|
const AD_URL = 'https://endpoint1.qt.io/pbjs';
|
|
9
7
|
const SYNC_URL = 'https://cs.qt.io';
|
|
10
8
|
|
|
11
|
-
function isBidResponseValid(bid) {
|
|
12
|
-
if (!bid.requestId || !bid.cpm || !bid.creativeId || !bid.ttl || !bid.currency) {
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
switch (bid.mediaType) {
|
|
17
|
-
case BANNER:
|
|
18
|
-
return Boolean(bid.width && bid.height && bid.ad);
|
|
19
|
-
case VIDEO:
|
|
20
|
-
return Boolean(bid.vastUrl || bid.vastXml);
|
|
21
|
-
case NATIVE:
|
|
22
|
-
return Boolean(bid.native && bid.native.impressionTrackers && bid.native.impressionTrackers.length);
|
|
23
|
-
default:
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function getPlacementReqData(bid) {
|
|
29
|
-
const { params, bidId, mediaTypes, transactionId, userIdAsEids } = bid;
|
|
30
|
-
const schain = bid.schain || {};
|
|
31
|
-
const { placementId, endpointId } = params;
|
|
32
|
-
const bidfloor = getBidFloor(bid);
|
|
33
|
-
|
|
34
|
-
const placement = {
|
|
35
|
-
bidId,
|
|
36
|
-
schain,
|
|
37
|
-
bidfloor
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
if (placementId) {
|
|
41
|
-
placement.placementId = placementId;
|
|
42
|
-
placement.type = 'publisher';
|
|
43
|
-
} else if (endpointId) {
|
|
44
|
-
placement.endpointId = endpointId;
|
|
45
|
-
placement.type = 'network';
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
if (mediaTypes && mediaTypes[BANNER]) {
|
|
49
|
-
placement.adFormat = BANNER;
|
|
50
|
-
placement.sizes = mediaTypes[BANNER].sizes;
|
|
51
|
-
} else if (mediaTypes && mediaTypes[VIDEO]) {
|
|
52
|
-
placement.adFormat = VIDEO;
|
|
53
|
-
placement.playerSize = mediaTypes[VIDEO].playerSize;
|
|
54
|
-
placement.minduration = mediaTypes[VIDEO].minduration;
|
|
55
|
-
placement.maxduration = mediaTypes[VIDEO].maxduration;
|
|
56
|
-
placement.mimes = mediaTypes[VIDEO].mimes;
|
|
57
|
-
placement.protocols = mediaTypes[VIDEO].protocols;
|
|
58
|
-
placement.startdelay = mediaTypes[VIDEO].startdelay;
|
|
59
|
-
placement.plcmt = mediaTypes[VIDEO].plcmt;
|
|
60
|
-
placement.skip = mediaTypes[VIDEO].skip;
|
|
61
|
-
placement.skipafter = mediaTypes[VIDEO].skipafter;
|
|
62
|
-
placement.minbitrate = mediaTypes[VIDEO].minbitrate;
|
|
63
|
-
placement.maxbitrate = mediaTypes[VIDEO].maxbitrate;
|
|
64
|
-
placement.delivery = mediaTypes[VIDEO].delivery;
|
|
65
|
-
placement.playbackmethod = mediaTypes[VIDEO].playbackmethod;
|
|
66
|
-
placement.api = mediaTypes[VIDEO].api;
|
|
67
|
-
placement.linearity = mediaTypes[VIDEO].linearity;
|
|
68
|
-
} else if (mediaTypes && mediaTypes[NATIVE]) {
|
|
69
|
-
placement.native = mediaTypes[NATIVE];
|
|
70
|
-
placement.adFormat = NATIVE;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
if (transactionId) {
|
|
74
|
-
placement.ext = placement.ext || {};
|
|
75
|
-
placement.ext.tid = transactionId;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
if (userIdAsEids && userIdAsEids.length) {
|
|
79
|
-
placement.eids = userIdAsEids;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
return placement;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
function getBidFloor(bid) {
|
|
86
|
-
try {
|
|
87
|
-
const bidFloor = bid.getFloor({
|
|
88
|
-
currency: 'USD',
|
|
89
|
-
mediaType: '*',
|
|
90
|
-
size: '*',
|
|
91
|
-
});
|
|
92
|
-
return bidFloor.floor;
|
|
93
|
-
} catch (err) {
|
|
94
|
-
return 0;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
9
|
export const spec = {
|
|
99
10
|
code: BIDDER_CODE,
|
|
100
11
|
supportedMediaTypes: [BANNER, VIDEO, NATIVE],
|
|
101
12
|
|
|
102
|
-
isBidRequestValid: (
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
if (mediaTypes && mediaTypes[BANNER]) {
|
|
107
|
-
valid = valid && Boolean(mediaTypes[BANNER] && mediaTypes[BANNER].sizes);
|
|
108
|
-
} else if (mediaTypes && mediaTypes[VIDEO]) {
|
|
109
|
-
valid = valid && Boolean(mediaTypes[VIDEO] && mediaTypes[VIDEO].playerSize);
|
|
110
|
-
} else if (mediaTypes && mediaTypes[NATIVE]) {
|
|
111
|
-
valid = valid && Boolean(mediaTypes[NATIVE]);
|
|
112
|
-
} else {
|
|
113
|
-
valid = false;
|
|
114
|
-
}
|
|
115
|
-
return valid;
|
|
116
|
-
},
|
|
117
|
-
|
|
118
|
-
buildRequests: (validBidRequests = [], bidderRequest = {}) => {
|
|
119
|
-
// convert Native ORTB definition to old-style prebid native definition
|
|
120
|
-
validBidRequests = convertOrtbRequestToProprietaryNative(validBidRequests);
|
|
121
|
-
|
|
122
|
-
let deviceWidth = 0;
|
|
123
|
-
let deviceHeight = 0;
|
|
124
|
-
|
|
125
|
-
let winLocation;
|
|
126
|
-
try {
|
|
127
|
-
const winTop = window.top;
|
|
128
|
-
deviceWidth = winTop.screen.width;
|
|
129
|
-
deviceHeight = winTop.screen.height;
|
|
130
|
-
winLocation = winTop.location;
|
|
131
|
-
} catch (e) {
|
|
132
|
-
logMessage(e);
|
|
133
|
-
winLocation = window.location;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
const refferUrl = bidderRequest.refererInfo && bidderRequest.refererInfo.page;
|
|
137
|
-
let refferLocation;
|
|
138
|
-
try {
|
|
139
|
-
refferLocation = refferUrl && new URL(refferUrl);
|
|
140
|
-
} catch (e) {
|
|
141
|
-
logMessage(e);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
let location = refferLocation || winLocation;
|
|
145
|
-
const language = (navigator && navigator.language) ? navigator.language.split('-')[0] : '';
|
|
146
|
-
const host = location.host;
|
|
147
|
-
const page = location.pathname;
|
|
148
|
-
const secure = location.protocol === 'https:' ? 1 : 0;
|
|
149
|
-
const placements = [];
|
|
150
|
-
const request = {
|
|
151
|
-
deviceWidth,
|
|
152
|
-
deviceHeight,
|
|
153
|
-
language,
|
|
154
|
-
secure,
|
|
155
|
-
host,
|
|
156
|
-
page,
|
|
157
|
-
placements,
|
|
158
|
-
coppa: deepAccess(bidderRequest, 'ortb2.regs.coppa') ? 1 : 0,
|
|
159
|
-
tmax: bidderRequest.timeout
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
if (bidderRequest.uspConsent) {
|
|
163
|
-
request.ccpa = bidderRequest.uspConsent;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
if (bidderRequest.gdprConsent) {
|
|
167
|
-
request.gdpr = {
|
|
168
|
-
consentString: bidderRequest.gdprConsent.consentString
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
if (bidderRequest.gppConsent) {
|
|
173
|
-
request.gpp = bidderRequest.gppConsent.gppString;
|
|
174
|
-
request.gpp_sid = bidderRequest.gppConsent.applicableSections;
|
|
175
|
-
} else if (bidderRequest.ortb2?.regs?.gpp) {
|
|
176
|
-
request.gpp = bidderRequest.ortb2.regs.gpp;
|
|
177
|
-
request.gpp_sid = bidderRequest.ortb2.regs.gpp_sid;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
const len = validBidRequests.length;
|
|
181
|
-
for (let i = 0; i < len; i++) {
|
|
182
|
-
const bid = validBidRequests[i];
|
|
183
|
-
placements.push(getPlacementReqData(bid));
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
return {
|
|
187
|
-
method: 'POST',
|
|
188
|
-
url: AD_URL,
|
|
189
|
-
data: request
|
|
190
|
-
};
|
|
191
|
-
},
|
|
192
|
-
|
|
193
|
-
interpretResponse: (serverResponse) => {
|
|
194
|
-
let response = [];
|
|
195
|
-
for (let i = 0; i < serverResponse.body.length; i++) {
|
|
196
|
-
let resItem = serverResponse.body[i];
|
|
197
|
-
if (isBidResponseValid(resItem)) {
|
|
198
|
-
const advertiserDomains = resItem.adomain && resItem.adomain.length ? resItem.adomain : [];
|
|
199
|
-
resItem.meta = { ...resItem.meta, advertiserDomains };
|
|
200
|
-
|
|
201
|
-
response.push(resItem);
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
return response;
|
|
205
|
-
},
|
|
206
|
-
|
|
207
|
-
getUserSyncs: (syncOptions, serverResponses, gdprConsent, uspConsent, gppConsent) => {
|
|
208
|
-
let syncType = syncOptions.iframeEnabled ? 'iframe' : 'image';
|
|
209
|
-
let syncUrl = SYNC_URL + `/${syncType}?pbjs=1`;
|
|
210
|
-
|
|
211
|
-
if (gdprConsent && gdprConsent.consentString) {
|
|
212
|
-
if (typeof gdprConsent.gdprApplies === 'boolean') {
|
|
213
|
-
syncUrl += `&gdpr=${Number(gdprConsent.gdprApplies)}&gdpr_consent=${gdprConsent.consentString}`;
|
|
214
|
-
} else {
|
|
215
|
-
syncUrl += `&gdpr=0&gdpr_consent=${gdprConsent.consentString}`;
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
if (uspConsent && uspConsent.consentString) {
|
|
220
|
-
syncUrl += `&ccpa_consent=${uspConsent.consentString}`;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
if (gppConsent?.gppString && gppConsent?.applicableSections?.length) {
|
|
224
|
-
syncUrl += '&gpp=' + gppConsent.gppString;
|
|
225
|
-
syncUrl += '&gpp_sid=' + gppConsent.applicableSections.join(',');
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
const coppa = config.getConfig('coppa') ? 1 : 0;
|
|
229
|
-
syncUrl += `&coppa=${coppa}`;
|
|
230
|
-
|
|
231
|
-
return [{
|
|
232
|
-
type: syncType,
|
|
233
|
-
url: syncUrl
|
|
234
|
-
}];
|
|
235
|
-
}
|
|
13
|
+
isBidRequestValid: isBidRequestValid(),
|
|
14
|
+
buildRequests: buildRequests(AD_URL),
|
|
15
|
+
interpretResponse,
|
|
16
|
+
getUserSyncs: getUserSyncs(SYNC_URL)
|
|
236
17
|
};
|
|
237
18
|
|
|
238
19
|
registerBidder(spec);
|
|
@@ -14,6 +14,7 @@ import { deepAccess, deepSetValue, logError, logMessage, mergeDeep } from '../sr
|
|
|
14
14
|
const MODULE_NAME = 'realTimeData';
|
|
15
15
|
const SUBMODULE_NAME = 'rayn';
|
|
16
16
|
const RAYN_TCF_ID = 1220;
|
|
17
|
+
const RAYN_PERSONA_TAXONOMY_ID = 103015;
|
|
17
18
|
const LOG_PREFIX = 'RaynJS: ';
|
|
18
19
|
export const SEGMENTS_RESOLVER = 'rayn.io';
|
|
19
20
|
export const RAYN_LOCAL_STORAGE_KEY = 'rayn-segtax';
|
|
@@ -77,6 +78,32 @@ export function generateOrtbDataObject(segtax, segment, maxTier) {
|
|
|
77
78
|
};
|
|
78
79
|
}
|
|
79
80
|
|
|
81
|
+
/**
|
|
82
|
+
* Create and return ORTB2 object with segtax and personaIds
|
|
83
|
+
* @param {number} segtax
|
|
84
|
+
* @param {Array} personaIds
|
|
85
|
+
* @return {Array}
|
|
86
|
+
*/
|
|
87
|
+
export function generatePersonaOrtbDataObject(segtax, personaIds) {
|
|
88
|
+
const segmentIds = [];
|
|
89
|
+
|
|
90
|
+
try {
|
|
91
|
+
segmentIds.push(...personaIds.map((id) => {
|
|
92
|
+
return { id };
|
|
93
|
+
}))
|
|
94
|
+
} catch (error) {
|
|
95
|
+
logError(LOG_PREFIX, error);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return {
|
|
99
|
+
name: SEGMENTS_RESOLVER,
|
|
100
|
+
ext: {
|
|
101
|
+
segtax,
|
|
102
|
+
},
|
|
103
|
+
segment: segmentIds,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
|
|
80
107
|
/**
|
|
81
108
|
* Generates checksum
|
|
82
109
|
* @param {string} url
|
|
@@ -127,8 +154,14 @@ export function setSegmentsAsBidderOrtb2(bidConfig, bidders, integrationConfig,
|
|
|
127
154
|
deepSetValue(raynOrtb2, 'site.content.data', raynContentData);
|
|
128
155
|
}
|
|
129
156
|
|
|
157
|
+
const raynUserData = [];
|
|
130
158
|
if (integrationConfig.iabAudienceCategories.v1_1.enabled && segments[4]) {
|
|
131
|
-
|
|
159
|
+
raynUserData.push(generateOrtbDataObject(4, segments[4], integrationConfig.iabAudienceCategories.v1_1.tier));
|
|
160
|
+
}
|
|
161
|
+
if (segments[RAYN_PERSONA_TAXONOMY_ID]) {
|
|
162
|
+
raynUserData.push(generatePersonaOrtbDataObject(RAYN_PERSONA_TAXONOMY_ID, segments[RAYN_PERSONA_TAXONOMY_ID]));
|
|
163
|
+
}
|
|
164
|
+
if (raynUserData.length > 0) {
|
|
132
165
|
deepSetValue(raynOrtb2, 'user.data', raynUserData);
|
|
133
166
|
}
|
|
134
167
|
|
|
@@ -163,8 +196,8 @@ function alterBidRequests(reqBidsConfigObj, callback, config, userConsent) {
|
|
|
163
196
|
segments[checksum] || (segments[4] &&
|
|
164
197
|
integrationConfig.iabAudienceCategories.v1_1.enabled &&
|
|
165
198
|
!integrationConfig.iabContentCategories.v2_2.enabled &&
|
|
166
|
-
!integrationConfig.iabContentCategories.v3_0.enabled
|
|
167
|
-
|
|
199
|
+
!integrationConfig.iabContentCategories.v3_0.enabled) ||
|
|
200
|
+
segments[RAYN_PERSONA_TAXONOMY_ID]
|
|
168
201
|
)) {
|
|
169
202
|
logMessage(LOG_PREFIX, `Segtax data from localStorage: ${JSON.stringify(segments)}`);
|
|
170
203
|
setSegmentsAsBidderOrtb2(reqBidsConfigObj, bidders, integrationConfig, segments, checksum);
|
|
@@ -119,6 +119,7 @@ function buildBidRequest(validBidRequest) {
|
|
|
119
119
|
const bidRequest = {
|
|
120
120
|
id: validBidRequest.bidId,
|
|
121
121
|
transactionId: validBidRequest.ortb2Imp?.ext?.tid,
|
|
122
|
+
gpid: validBidRequest.ortb2Imp?.ext?.gpid,
|
|
122
123
|
sizes: validBidRequest.sizes,
|
|
123
124
|
supplyTypes: mediaTypes,
|
|
124
125
|
adUnitId: params.adUnitId,
|
|
@@ -332,6 +333,10 @@ export const spec = {
|
|
|
332
333
|
payload.badv = bidderRequest.ortb2?.badv
|
|
333
334
|
}
|
|
334
335
|
|
|
336
|
+
if (bidderRequest.ortb2?.device?.sua) {
|
|
337
|
+
payload.sua = bidderRequest.ortb2.device.sua
|
|
338
|
+
}
|
|
339
|
+
|
|
335
340
|
const payloadString = JSON.stringify(payload);
|
|
336
341
|
|
|
337
342
|
return {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
_each,
|
|
3
|
-
createTrackPixelHtml,
|
|
4
|
-
deepAccess,
|
|
5
3
|
isStr,
|
|
6
4
|
getBidIdParameter,
|
|
7
5
|
triggerPixel,
|
|
8
6
|
logWarn,
|
|
7
|
+
deepSetValue,
|
|
9
8
|
} from '../src/utils.js';
|
|
10
9
|
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
11
10
|
import { BANNER } from '../src/mediaTypes.js';
|
|
11
|
+
import { ortbConverter } from '../libraries/ortbConverter/converter.js';
|
|
12
12
|
|
|
13
13
|
const BIDDER_CODE = 'setupad';
|
|
14
14
|
const ENDPOINT = 'https://prebid.setupad.io/openrtb2/auction';
|
|
@@ -16,11 +16,39 @@ const SYNC_ENDPOINT = 'https://cookie.stpd.cloud/sync?';
|
|
|
16
16
|
const REPORT_ENDPOINT = 'https://adapter-analytics.setupad.io/api/adapter-analytics?';
|
|
17
17
|
const GVLID = 1241;
|
|
18
18
|
const TIME_TO_LIVE = 360;
|
|
19
|
-
const biddersCreativeIds = {};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
export const biddersCreativeIds = {}; // export only for tests
|
|
20
|
+
const NET_REVENUE = true;
|
|
21
|
+
const TEST_REQUEST = 0; // used only for testing
|
|
22
|
+
|
|
23
|
+
const converter = ortbConverter({
|
|
24
|
+
context: {
|
|
25
|
+
netRevenue: NET_REVENUE,
|
|
26
|
+
ttl: TIME_TO_LIVE,
|
|
27
|
+
},
|
|
28
|
+
imp(buildImp, bidRequest, context) {
|
|
29
|
+
const imp = buildImp(bidRequest, context);
|
|
30
|
+
deepSetValue(
|
|
31
|
+
imp,
|
|
32
|
+
'ext.prebid.storedrequest.id',
|
|
33
|
+
getBidIdParameter('placement_id', bidRequest.params)
|
|
34
|
+
);
|
|
35
|
+
return imp;
|
|
36
|
+
},
|
|
37
|
+
request(buildRequest, imps, bidderRequest, context) {
|
|
38
|
+
const request = buildRequest(imps, bidderRequest, context);
|
|
39
|
+
deepSetValue(request, 'test', TEST_REQUEST);
|
|
40
|
+
deepSetValue(
|
|
41
|
+
request,
|
|
42
|
+
'ext.prebid.storedrequest.id',
|
|
43
|
+
getBidIdParameter(
|
|
44
|
+
'account_id',
|
|
45
|
+
bidderRequest.bids.find((bid) => bid.hasOwnProperty('params')).params
|
|
46
|
+
)
|
|
47
|
+
);
|
|
48
|
+
deepSetValue(request, 'setupad', 'adapter');
|
|
49
|
+
return request;
|
|
50
|
+
},
|
|
51
|
+
});
|
|
24
52
|
|
|
25
53
|
export const spec = {
|
|
26
54
|
code: BIDDER_CODE,
|
|
@@ -37,97 +65,17 @@ export const spec = {
|
|
|
37
65
|
},
|
|
38
66
|
|
|
39
67
|
buildRequests: function (validBidRequests, bidderRequest) {
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const site = {
|
|
52
|
-
page: bidderRequest?.refererInfo?.page,
|
|
53
|
-
ref: bidderRequest?.refererInfo?.ref,
|
|
54
|
-
domain: bidderRequest?.refererInfo?.domain,
|
|
55
|
-
};
|
|
56
|
-
const device = {
|
|
57
|
-
w: bidderRequest?.ortb2?.device?.w,
|
|
58
|
-
h: bidderRequest?.ortb2?.device?.h,
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
const payload = {
|
|
62
|
-
id: bid?.bidderRequestId,
|
|
63
|
-
ext: {
|
|
64
|
-
prebid: {
|
|
65
|
-
storedrequest: {
|
|
66
|
-
id: accountId || 'default',
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
user: { ext: { eids } },
|
|
71
|
-
device,
|
|
72
|
-
site,
|
|
73
|
-
imp: [],
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
const imp = {
|
|
77
|
-
id: bid.adUnitCode,
|
|
78
|
-
ext: {
|
|
79
|
-
prebid: {
|
|
80
|
-
storedrequest: { id },
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
if (deepAccess(bid, 'mediaTypes.banner')) {
|
|
86
|
-
imp.banner = {
|
|
87
|
-
format: (sizes || []).map((s) => {
|
|
88
|
-
return { w: s[0], h: s[1] };
|
|
89
|
-
}),
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
payload.imp.push(imp);
|
|
94
|
-
|
|
95
|
-
const gdprConsent = bidderRequest && bidderRequest.gdprConsent;
|
|
96
|
-
const uspConsent = bidderRequest && bidderRequest.uspConsent;
|
|
97
|
-
|
|
98
|
-
if (gdprConsent || uspConsent) {
|
|
99
|
-
payload.regs = { ext: {} };
|
|
100
|
-
|
|
101
|
-
if (uspConsent) payload.regs.ext.us_privacy = uspConsent;
|
|
102
|
-
|
|
103
|
-
if (gdprConsent) {
|
|
104
|
-
if (typeof gdprConsent.gdprApplies !== 'undefined') {
|
|
105
|
-
payload.regs.ext.gdpr = gdprConsent.gdprApplies ? 1 : 0;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
if (typeof gdprConsent.consentString !== 'undefined') {
|
|
109
|
-
payload.user.ext.consent = gdprConsent.consentString;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
const params = bid.params;
|
|
114
|
-
|
|
115
|
-
requests.push({
|
|
116
|
-
method: 'POST',
|
|
117
|
-
url: ENDPOINT,
|
|
118
|
-
data: JSON.stringify(payload),
|
|
119
|
-
options: {
|
|
120
|
-
contentType: 'text/plain',
|
|
121
|
-
withCredentials: true,
|
|
122
|
-
},
|
|
123
|
-
|
|
124
|
-
bidId,
|
|
125
|
-
params,
|
|
126
|
-
auctionId,
|
|
127
|
-
});
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
return requests;
|
|
68
|
+
const data = converter.toORTB({ validBidRequests, bidderRequest });
|
|
69
|
+
|
|
70
|
+
return {
|
|
71
|
+
method: 'POST',
|
|
72
|
+
url: ENDPOINT,
|
|
73
|
+
data,
|
|
74
|
+
options: {
|
|
75
|
+
contentType: 'text/plain',
|
|
76
|
+
withCredentials: true,
|
|
77
|
+
},
|
|
78
|
+
};
|
|
131
79
|
},
|
|
132
80
|
|
|
133
81
|
interpretResponse: function (serverResponse, bidRequest) {
|
|
@@ -141,40 +89,22 @@ export const spec = {
|
|
|
141
89
|
return [];
|
|
142
90
|
}
|
|
143
91
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
_each(serverBody.seatbid, (res) => {
|
|
92
|
+
// set a seat for creativeId for triggerPixel url
|
|
93
|
+
_each(serverResponse.body.seatbid, (res) => {
|
|
148
94
|
_each(res.bid, (bid) => {
|
|
149
|
-
|
|
150
|
-
const params = bidRequest.params;
|
|
151
|
-
const { ad, adUrl } = getAd(bid);
|
|
152
|
-
|
|
153
|
-
const bidResponse = {
|
|
154
|
-
requestId,
|
|
155
|
-
params,
|
|
156
|
-
cpm: bid.price,
|
|
157
|
-
width: bid.w,
|
|
158
|
-
height: bid.h,
|
|
159
|
-
creativeId: bid.id,
|
|
160
|
-
currency: serverBody.cur,
|
|
161
|
-
netRevenue: true,
|
|
162
|
-
ttl: TIME_TO_LIVE,
|
|
163
|
-
meta: {
|
|
164
|
-
advertiserDomains: bid.adomain || [],
|
|
165
|
-
},
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
// set a seat for creativeId for triggerPixel url
|
|
169
|
-
biddersCreativeIds[bidResponse.creativeId] = res.seat;
|
|
170
|
-
|
|
171
|
-
bidResponse.ad = ad;
|
|
172
|
-
bidResponse.adUrl = adUrl;
|
|
173
|
-
bidResponses.push(bidResponse);
|
|
95
|
+
biddersCreativeIds[bid.crid] = res.seat;
|
|
174
96
|
});
|
|
175
97
|
});
|
|
176
98
|
|
|
177
|
-
return
|
|
99
|
+
// used for a test case "should update biddersCreativeIds correctly" to return early and not throw ORTB error
|
|
100
|
+
if (serverResponse.testCase === 1) return;
|
|
101
|
+
|
|
102
|
+
const bids = converter.fromORTB({
|
|
103
|
+
response: serverResponse.body,
|
|
104
|
+
request: bidRequest.data,
|
|
105
|
+
}).bids;
|
|
106
|
+
|
|
107
|
+
return bids;
|
|
178
108
|
},
|
|
179
109
|
|
|
180
110
|
getUserSyncs: function (syncOptions, responses, gdprConsent, uspConsent) {
|
|
@@ -261,16 +191,4 @@ function getBidders(serverResponse) {
|
|
|
261
191
|
}
|
|
262
192
|
}
|
|
263
193
|
|
|
264
|
-
function getAd(bid) {
|
|
265
|
-
const { adm, nurl } = bid;
|
|
266
|
-
let ad = adm;
|
|
267
|
-
|
|
268
|
-
if (nurl) {
|
|
269
|
-
const trackingPixel = createTrackPixelHtml(decodeURIComponent(nurl));
|
|
270
|
-
ad += trackingPixel;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
return { ad };
|
|
274
|
-
}
|
|
275
|
-
|
|
276
194
|
registerBidder(spec);
|