prebid.js 6.2.0 → 6.6.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/.circleci/config.yml +1 -1
- package/gulpfile.js +87 -82
- package/integrationExamples/gpt/weboramaRtdProvider_example.html +23 -14
- package/karma.conf.maker.js +1 -1
- package/modules/.submodules.json +2 -1
- package/modules/33acrossBidAdapter.js +189 -102
- package/modules/adagioBidAdapter.js +1 -1
- package/modules/addefendBidAdapter.js +1 -0
- package/modules/adkernelBidAdapter.js +148 -62
- package/modules/adlooxAdServerVideo.js +2 -2
- package/modules/adlooxAnalyticsAdapter.js +4 -4
- package/modules/admanBidAdapter.js +11 -4
- package/modules/admixerBidAdapter.js +1 -1
- package/modules/adnuntiusBidAdapter.js +3 -1
- package/modules/adomikAnalyticsAdapter.js +27 -9
- package/modules/adqueryIdSystem.js +103 -0
- package/modules/adqueryIdSystem.md +35 -0
- package/modules/adxcgBidAdapter.js +311 -359
- package/modules/adxcgBidAdapter.md +22 -21
- package/modules/adyoulikeBidAdapter.js +13 -9
- package/modules/aniviewBidAdapter.js +1 -1
- package/modules/appnexusBidAdapter.js +0 -1
- package/modules/beopBidAdapter.js +6 -4
- package/modules/bidViewability.js +3 -3
- package/modules/bidViewabilityIO.js +3 -3
- package/modules/bliinkBidAdapter.js +3 -2
- package/modules/colossussspBidAdapter.js +7 -0
- package/modules/compassBidAdapter.js +208 -0
- package/modules/compassBidAdapter.md +79 -0
- package/modules/consentManagement.js +7 -1
- package/modules/criteoBidAdapter.js +1 -1
- package/modules/criteoIdSystem.js +29 -7
- package/modules/currency.js +2 -2
- package/modules/cwireBidAdapter.js +3 -0
- package/modules/dailyhuntBidAdapter.js +435 -0
- package/modules/dailyhuntBidAdapter.md +4 -0
- package/modules/docereeBidAdapter.js +10 -1
- package/modules/docereeBidAdapter.md +2 -0
- package/modules/dspxBidAdapter.js +1 -1
- package/modules/engageyaBidAdapter.js +1 -1
- package/modules/feedadBidAdapter.js +2 -2
- package/modules/feedadBidAdapter.md +4 -2
- package/modules/futureads.md +48 -0
- package/modules/glimpseBidAdapter.js +82 -47
- package/modules/gptPreAuction.js +55 -7
- package/modules/gridBidAdapter.js +4 -3
- package/modules/gumgumBidAdapter.js +2 -2
- package/modules/idImportLibrary.js +45 -8
- package/modules/idImportLibrary.md +4 -0
- package/modules/improvedigitalBidAdapter.js +42 -4
- package/modules/instreamTracking.js +4 -4
- package/modules/invibesBidAdapter.js +49 -5
- package/modules/invibesBidAdapter.md +2 -1
- package/modules/ixBidAdapter.js +53 -18
- package/modules/kinessoIdSystem.js +1 -1
- package/modules/limelightDigitalBidAdapter.js +2 -1
- package/modules/livewrappedAnalyticsAdapter.js +3 -1
- package/modules/livewrappedBidAdapter.js +8 -2
- package/modules/loglyliftBidAdapter.js +79 -0
- package/modules/loglyliftBidAdapter.md +55 -0
- package/modules/lotamePanoramaIdSystem.js +80 -8
- package/modules/mediasquareBidAdapter.js +1 -9
- package/modules/nextMillenniumBidAdapter.js +39 -7
- package/modules/oguryBidAdapter.js +9 -2
- package/modules/onetagBidAdapter.js +4 -2
- package/modules/optimeraRtdProvider.js +8 -1
- package/modules/ozoneBidAdapter.js +21 -64
- package/modules/prebidServerBidAdapter/index.js +16 -12
- package/modules/proxistoreBidAdapter.js +0 -2
- package/modules/pubgeniusBidAdapter.js +1 -1
- package/modules/pubmaticAnalyticsAdapter.js +16 -0
- package/modules/pubxaiAnalyticsAdapter.js +17 -0
- package/modules/richaudienceBidAdapter.js +4 -4
- package/modules/riseBidAdapter.js +1 -1
- package/modules/rtbhouseBidAdapter.js +14 -4
- package/modules/rtdModule/index.js +49 -18
- package/modules/rubiconBidAdapter.js +31 -19
- package/modules/sharedIdSystem.js +27 -1
- package/modules/showheroes-bsBidAdapter.js +13 -2
- package/modules/tappxBidAdapter.js +8 -5
- package/modules/targetVideoBidAdapter.js +187 -0
- package/modules/targetVideoBidAdapter.md +34 -0
- package/modules/teadsBidAdapter.js +1 -2
- package/modules/telariaBidAdapter.js +2 -2
- package/modules/trustxBidAdapter.js +8 -16
- package/modules/userId/eids.js +7 -1
- package/modules/userId/userId.md +8 -0
- package/modules/vidoomyBidAdapter.js +16 -10
- package/modules/weboramaRtdProvider.js +288 -73
- package/modules/weboramaRtdProvider.md +27 -10
- package/modules/welectBidAdapter.js +106 -0
- package/modules/yahoosspBidAdapter.js +5 -1
- package/modules/yieldmoBidAdapter.js +23 -5
- package/modules/zetaSspBidAdapter.md +33 -1
- package/modules/zeta_global_sspAnalyticsAdapter.js +97 -0
- package/modules/zeta_global_sspAnalyticsAdapter.md +24 -0
- package/modules/zeta_global_sspBidAdapter.js +22 -1
- package/package.json +1 -1
- package/plugins/pbjsGlobals.js +28 -1
- package/src/auction.js +2 -2
- package/src/config.js +27 -3
- package/src/hook.js +5 -1
- package/src/prebid.js +21 -6
- package/src/targeting.js +22 -1
- package/src/utils.js +46 -8
- package/test/helpers/prebidGlobal.js +1 -0
- package/test/spec/config_spec.js +279 -0
- package/test/spec/modules/33acrossBidAdapter_spec.js +300 -78
- package/test/spec/modules/adlooxAnalyticsAdapter_spec.js +6 -6
- package/test/spec/modules/admanBidAdapter_spec.js +2 -2
- package/test/spec/modules/adnuntiusBidAdapter_spec.js +17 -0
- package/test/spec/modules/adomikAnalyticsAdapter_spec.js +9 -1
- package/test/spec/modules/adqueryIdSystem_spec.js +74 -0
- package/test/spec/modules/adxcgBidAdapter_spec.js +820 -571
- package/test/spec/modules/adyoulikeBidAdapter_spec.js +49 -0
- package/test/spec/modules/beopBidAdapter_spec.js +1 -1
- package/test/spec/modules/bidViewabilityIO_spec.js +2 -2
- package/test/spec/modules/bidViewability_spec.js +4 -4
- package/test/spec/modules/bliinkBidAdapter_spec.js +2 -0
- package/test/spec/modules/colossussspBidAdapter_spec.js +9 -0
- package/test/spec/modules/compassBidAdapter_spec.js +398 -0
- package/test/spec/modules/consentManagement_spec.js +20 -0
- package/test/spec/modules/criteoIdSystem_spec.js +6 -3
- package/test/spec/modules/cwireBidAdapter_spec.js +10 -8
- package/test/spec/modules/dailyhuntBidAdapter_spec.js +404 -0
- package/test/spec/modules/docereeBidAdapter_spec.js +9 -1
- package/test/spec/modules/eids_spec.js +15 -0
- package/test/spec/modules/feedadBidAdapter_spec.js +15 -0
- package/test/spec/modules/glimpseBidAdapter_spec.js +0 -18
- package/test/spec/modules/gptPreAuction_spec.js +177 -2
- package/test/spec/modules/idImportLibrary_spec.js +197 -10
- package/test/spec/modules/improvedigitalBidAdapter_spec.js +45 -1
- package/test/spec/modules/invibesBidAdapter_spec.js +119 -0
- package/test/spec/modules/ixBidAdapter_spec.js +112 -62
- package/test/spec/modules/limelightDigitalBidAdapter_spec.js +75 -17
- package/test/spec/modules/livewrappedAnalyticsAdapter_spec.js +22 -0
- package/test/spec/modules/livewrappedBidAdapter_spec.js +31 -0
- package/test/spec/modules/loglyliftBidAdapter_spec.js +172 -0
- package/test/spec/modules/lotamePanoramaIdSystem_spec.js +227 -0
- package/test/spec/modules/mediasquareBidAdapter_spec.js +4 -4
- package/test/spec/modules/nextMillenniumBidAdapter_spec.js +26 -1
- package/test/spec/modules/oguryBidAdapter_spec.js +10 -2
- package/test/spec/modules/optimeraRtdProvider_spec.js +14 -1
- package/test/spec/modules/ozoneBidAdapter_spec.js +43 -31
- package/test/spec/modules/prebidServerBidAdapter_spec.js +43 -0
- package/test/spec/modules/pubgeniusBidAdapter_spec.js +3 -3
- package/test/spec/modules/pubmaticAnalyticsAdapter_spec.js +13 -1
- package/test/spec/modules/pubxaiAnalyticsAdapter_spec.js +11 -0
- package/test/spec/modules/realTimeDataModule_spec.js +147 -48
- package/test/spec/modules/richaudienceBidAdapter_spec.js +42 -2
- package/test/spec/modules/riseBidAdapter_spec.js +1 -1
- package/test/spec/modules/rtbhouseBidAdapter_spec.js +20 -0
- package/test/spec/modules/rubiconBidAdapter_spec.js +65 -9
- package/test/spec/modules/sharedIdSystem_spec.js +52 -6
- package/test/spec/modules/showheroes-bsBidAdapter_spec.js +2 -0
- package/test/spec/modules/tappxBidAdapter_spec.js +0 -19
- package/test/spec/modules/targetVideoBidAdapter_spec.js +96 -0
- package/test/spec/modules/teadsBidAdapter_spec.js +14 -59
- package/test/spec/modules/userId_spec.js +68 -19
- package/test/spec/modules/weboramaRtdProvider_spec.js +408 -214
- package/test/spec/modules/welectBidAdapter_spec.js +211 -0
- package/test/spec/modules/yahoosspBidAdapter_spec.js +28 -1
- package/test/spec/modules/zeta_global_sspAnalyticsAdapter_spec.js +427 -0
- package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +33 -1
- package/test/spec/unit/core/targeting_spec.js +72 -0
- package/test/spec/unit/pbjs_api_spec.js +3 -1
- package/test/spec/utils_spec.js +38 -0
- package/test/test_deps.js +3 -0
- package/test/test_index.js +1 -3
|
@@ -34,31 +34,34 @@ Module that connects to an Adxcg.com zone to fetch bids.
|
|
|
34
34
|
code: 'native-ad-div',
|
|
35
35
|
mediaTypes: {
|
|
36
36
|
native: {
|
|
37
|
-
|
|
37
|
+
image: {
|
|
38
38
|
sendId: false,
|
|
39
|
-
required:
|
|
40
|
-
sizes: [
|
|
39
|
+
required: false,
|
|
40
|
+
sizes: [127, 83]
|
|
41
41
|
},
|
|
42
42
|
icon: {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
brand: {
|
|
43
|
+
sizes: [80, 80],
|
|
44
|
+
required: false,
|
|
46
45
|
sendId: true,
|
|
47
46
|
},
|
|
48
47
|
title: {
|
|
49
48
|
sendId: false,
|
|
50
|
-
required:
|
|
49
|
+
required: false,
|
|
51
50
|
len: 75
|
|
52
51
|
},
|
|
53
52
|
body: {
|
|
54
53
|
sendId: false,
|
|
55
|
-
required:
|
|
54
|
+
required: false,
|
|
56
55
|
len: 200
|
|
57
56
|
},
|
|
58
|
-
|
|
57
|
+
cta: {
|
|
59
58
|
sendId: false,
|
|
60
59
|
required: false,
|
|
61
|
-
len:
|
|
60
|
+
len: 75
|
|
61
|
+
},
|
|
62
|
+
sponsoredBy: {
|
|
63
|
+
sendId: false,
|
|
64
|
+
required: false
|
|
62
65
|
}
|
|
63
66
|
}
|
|
64
67
|
},
|
|
@@ -73,21 +76,19 @@ Module that connects to an Adxcg.com zone to fetch bids.
|
|
|
73
76
|
code: 'video-div',
|
|
74
77
|
mediaTypes: {
|
|
75
78
|
video: {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
playerSize: [640, 480],
|
|
80
|
+
context: 'instream',
|
|
81
|
+
mimes: ['video/mp4'],
|
|
82
|
+
protocols: [2, 3, 5, 6, 8],
|
|
83
|
+
playback_method: ['auto_play_sound_off'],
|
|
84
|
+
maxduration: 100,
|
|
85
|
+
skip: 1
|
|
86
|
+
}
|
|
82
87
|
},
|
|
83
88
|
bids: [{
|
|
84
89
|
bidder: 'adxcg',
|
|
85
90
|
params: {
|
|
86
|
-
adzoneid: '20'
|
|
87
|
-
video: {
|
|
88
|
-
maxduration: 100,
|
|
89
|
-
skippable: true
|
|
90
|
-
}
|
|
91
|
+
adzoneid: '20'
|
|
91
92
|
}
|
|
92
93
|
}]
|
|
93
94
|
}
|
|
@@ -180,11 +180,13 @@ function getCanonicalUrl() {
|
|
|
180
180
|
|
|
181
181
|
/* Get mediatype from bidRequest */
|
|
182
182
|
function getMediatype(bidRequest) {
|
|
183
|
+
if (deepAccess(bidRequest, 'mediaTypes.banner')) {
|
|
184
|
+
return BANNER;
|
|
185
|
+
}
|
|
183
186
|
if (deepAccess(bidRequest, 'mediaTypes.video')) {
|
|
184
187
|
return VIDEO;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
} else if (deepAccess(bidRequest, 'mediaTypes.native')) {
|
|
188
|
+
}
|
|
189
|
+
if (deepAccess(bidRequest, 'mediaTypes.native')) {
|
|
188
190
|
return NATIVE;
|
|
189
191
|
}
|
|
190
192
|
}
|
|
@@ -345,7 +347,7 @@ function getTrackers(eventsArray, jsTrackers) {
|
|
|
345
347
|
|
|
346
348
|
function getVideoAd(response) {
|
|
347
349
|
var adJson = {};
|
|
348
|
-
if (typeof response.Ad === 'string') {
|
|
350
|
+
if (typeof response.Ad === 'string' && response.Ad.indexOf('\/\*PREBID\*\/') > 0) {
|
|
349
351
|
adJson = JSON.parse(response.Ad.match(/\/\*PREBID\*\/(.*)\/\*PREBID\*\//)[1]);
|
|
350
352
|
return deepAccess(adJson, 'Content.MainVideo.Vast');
|
|
351
353
|
}
|
|
@@ -478,13 +480,15 @@ function createBid(response, bidRequests) {
|
|
|
478
480
|
meta: response.Meta || { advertiserDomains: [] }
|
|
479
481
|
};
|
|
480
482
|
|
|
481
|
-
|
|
483
|
+
// retreive video response if present
|
|
484
|
+
const vast64 = response.Vast || getVideoAd(response);
|
|
485
|
+
if (vast64) {
|
|
486
|
+
bid.vastXml = window.atob(vast64);
|
|
487
|
+
bid.mediaType = 'video';
|
|
488
|
+
} else if (request.Native) {
|
|
489
|
+
// format Native response if Native was requested
|
|
482
490
|
bid.native = getNativeAssets(response, request.Native);
|
|
483
491
|
bid.mediaType = 'native';
|
|
484
|
-
} else if (request && request.Video) {
|
|
485
|
-
const vast64 = response.Vast || getVideoAd(response);
|
|
486
|
-
bid.vastXml = vast64 ? window.atob(vast64) : '';
|
|
487
|
-
bid.mediaType = 'video';
|
|
488
492
|
} else {
|
|
489
493
|
bid.width = response.Width;
|
|
490
494
|
bid.height = response.Height;
|
|
@@ -309,7 +309,7 @@ function getUserSyncs(syncOptions, serverResponses) {
|
|
|
309
309
|
export const spec = {
|
|
310
310
|
code: BIDDER_CODE,
|
|
311
311
|
gvlid: GVLID,
|
|
312
|
-
aliases: ['avantisvideo', 'selectmediavideo', 'vidcrunch', 'openwebvideo'],
|
|
312
|
+
aliases: ['avantisvideo', 'selectmediavideo', 'vidcrunch', 'openwebvideo', 'didnavideo'],
|
|
313
313
|
supportedMediaTypes: [VIDEO, BANNER],
|
|
314
314
|
isBidRequestValid,
|
|
315
315
|
buildRequests,
|
|
@@ -36,7 +36,7 @@ export const spec = {
|
|
|
36
36
|
*/
|
|
37
37
|
buildRequests: function(validBidRequests, bidderRequest) {
|
|
38
38
|
const slots = validBidRequests.map(beOpRequestSlotsMaker);
|
|
39
|
-
let pageUrl = deepAccess(bidderRequest, 'refererInfo.canonicalUrl') || config.getConfig('pageUrl')
|
|
39
|
+
let pageUrl = deepAccess(window, 'location.href') || deepAccess(bidderRequest, 'refererInfo.canonicalUrl') || config.getConfig('pageUrl');
|
|
40
40
|
let fpd = config.getLegacyFpd(config.getConfig('ortb2'));
|
|
41
41
|
let gdpr = bidderRequest.gdprConsent;
|
|
42
42
|
let firstSlot = slots[0];
|
|
@@ -99,16 +99,18 @@ export const spec = {
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
function buildTrackingParams(data, info, value) {
|
|
102
|
+
const accountId = data.params.accountId;
|
|
102
103
|
return {
|
|
103
|
-
pid: data.
|
|
104
|
+
pid: accountId === undefined ? data.ad.match(/account: \“([a-f\d]{24})\“/)[1] : accountId,
|
|
104
105
|
nid: data.params.networkId,
|
|
105
106
|
nptnid: data.params.networkPartnerId,
|
|
106
|
-
bid: data.bidId,
|
|
107
|
+
bid: data.bidId || data.requestId,
|
|
107
108
|
sl_n: data.adUnitCode,
|
|
108
109
|
aid: data.auctionId,
|
|
109
110
|
se_ca: 'bid',
|
|
110
111
|
se_ac: info,
|
|
111
|
-
se_va: value
|
|
112
|
+
se_va: value,
|
|
113
|
+
url: window.location.href
|
|
112
114
|
};
|
|
113
115
|
}
|
|
114
116
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { config } from '../src/config.js';
|
|
6
6
|
import * as events from '../src/events.js';
|
|
7
|
-
import
|
|
7
|
+
import CONSTANTS from '../src/constants.json';
|
|
8
8
|
import { logWarn, isFn, triggerPixel } from '../src/utils.js';
|
|
9
9
|
import { getGlobal } from '../src/prebidGlobal.js';
|
|
10
10
|
import adapterManager, { gdprDataHandler, uspDataHandler } from '../src/adapterManager.js';
|
|
@@ -70,12 +70,12 @@ export let impressionViewableHandler = (globalModuleConfig, slot, event) => {
|
|
|
70
70
|
// trigger respective bidder's onBidViewable handler
|
|
71
71
|
adapterManager.callBidViewableBidder(respectiveBid.bidder, respectiveBid);
|
|
72
72
|
// emit the BID_VIEWABLE event with bid details, this event can be consumed by bidders and analytics pixels
|
|
73
|
-
events.emit(EVENTS.BID_VIEWABLE, respectiveBid);
|
|
73
|
+
events.emit(CONSTANTS.EVENTS.BID_VIEWABLE, respectiveBid);
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
76
|
|
|
77
77
|
export let init = () => {
|
|
78
|
-
events.on(EVENTS.AUCTION_INIT, () => {
|
|
78
|
+
events.on(CONSTANTS.EVENTS.AUCTION_INIT, () => {
|
|
79
79
|
// read the config for the module
|
|
80
80
|
const globalModuleConfig = config.getConfig(MODULE_NAME) || {};
|
|
81
81
|
// do nothing if module-config.enabled is not set to true
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { logMessage } from '../src/utils.js';
|
|
2
2
|
import { config } from '../src/config.js';
|
|
3
3
|
import * as events from '../src/events.js';
|
|
4
|
-
import
|
|
4
|
+
import CONSTANTS from '../src/constants.json';
|
|
5
5
|
|
|
6
6
|
const MODULE_NAME = 'bidViewabilityIO';
|
|
7
7
|
const CONFIG_ENABLED = 'enabled';
|
|
@@ -42,7 +42,7 @@ export let getViewableOptions = (bid) => {
|
|
|
42
42
|
export let markViewed = (bid, entry, observer) => {
|
|
43
43
|
return () => {
|
|
44
44
|
observer.unobserve(entry.target);
|
|
45
|
-
events.emit(EVENTS.BID_VIEWABLE, bid);
|
|
45
|
+
events.emit(CONSTANTS.EVENTS.BID_VIEWABLE, bid);
|
|
46
46
|
_logMessage(`id: ${entry.target.getAttribute('id')} code: ${bid.adUnitCode} was viewed`);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
@@ -77,7 +77,7 @@ export let init = () => {
|
|
|
77
77
|
if (conf[MODULE_NAME][CONFIG_ENABLED] && CLIENT_SUPPORTS_IO) {
|
|
78
78
|
// if the module is enabled and the browser supports Intersection Observer,
|
|
79
79
|
// then listen to AD_RENDER_SUCCEEDED to setup IO's for supported mediaTypes
|
|
80
|
-
events.on(EVENTS.AD_RENDER_SUCCEEDED, ({doc, bid, id}) => {
|
|
80
|
+
events.on(CONSTANTS.EVENTS.AD_RENDER_SUCCEEDED, ({doc, bid, id}) => {
|
|
81
81
|
if (isSupportedMediaType(bid)) {
|
|
82
82
|
let viewable = new IntersectionObserver(viewCallbackFactory(bid), getViewableOptions(bid));
|
|
83
83
|
let element = document.getElementById(bid.adUnitCode);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// eslint-disable-next-line prebid/validate-imports
|
|
2
2
|
// eslint-disable-next-line prebid/validate-imports
|
|
3
|
-
import {registerBidder} from 'src/adapters/bidderFactory.js'
|
|
4
|
-
|
|
3
|
+
import {registerBidder} from '../src/adapters/bidderFactory.js'
|
|
5
4
|
export const BIDDER_CODE = 'bliink'
|
|
6
5
|
export const BLIINK_ENDPOINT_ENGINE = 'https://engine.bliink.io/delivery'
|
|
7
6
|
export const BLIINK_ENDPOINT_ENGINE_VAST = 'https://engine.bliink.io/vast'
|
|
@@ -174,6 +173,8 @@ export const buildRequests = (_, bidderRequest) => {
|
|
|
174
173
|
pageUrl: bidderRequest.refererInfo.referer,
|
|
175
174
|
pageDescription: getMetaValue(META_DESCRIPTION),
|
|
176
175
|
keywords: getKeywords().join(','),
|
|
176
|
+
gdpr: false,
|
|
177
|
+
gdpr_consent: '',
|
|
177
178
|
pageTitle: document.title,
|
|
178
179
|
}
|
|
179
180
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { getWindowTop, deepAccess, logMessage } from '../src/utils.js';
|
|
2
2
|
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
3
3
|
import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
|
|
4
|
+
import { ajax } from '../src/ajax.js';
|
|
4
5
|
|
|
5
6
|
const BIDDER_CODE = 'colossusssp';
|
|
6
7
|
const G_URL = 'https://colossusssp.com/?c=o&m=multi';
|
|
@@ -175,6 +176,12 @@ export const spec = {
|
|
|
175
176
|
type: 'image',
|
|
176
177
|
url: G_URL_SYNC
|
|
177
178
|
}];
|
|
179
|
+
},
|
|
180
|
+
|
|
181
|
+
onBidWon: (bid) => {
|
|
182
|
+
if (bid.nurl) {
|
|
183
|
+
ajax(bid.nurl, null);
|
|
184
|
+
}
|
|
178
185
|
}
|
|
179
186
|
};
|
|
180
187
|
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { isFn, deepAccess, logMessage, logError } from '../src/utils.js';
|
|
2
|
+
|
|
3
|
+
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
4
|
+
import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
|
|
5
|
+
import { config } from '../src/config.js';
|
|
6
|
+
|
|
7
|
+
const BIDDER_CODE = 'compass';
|
|
8
|
+
const AD_URL = 'https://sa-lb.deliverimp.com/pbjs';
|
|
9
|
+
const SYNC_URL = 'https://sa-cs.deliverimp.com';
|
|
10
|
+
|
|
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 } = 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.placement = mediaTypes[VIDEO].placement;
|
|
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
|
+
return placement;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function getBidFloor(bid) {
|
|
77
|
+
if (!isFn(bid.getFloor)) {
|
|
78
|
+
return deepAccess(bid, 'params.bidfloor', 0);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
try {
|
|
82
|
+
const bidFloor = bid.getFloor({
|
|
83
|
+
currency: 'USD',
|
|
84
|
+
mediaType: '*',
|
|
85
|
+
size: '*',
|
|
86
|
+
});
|
|
87
|
+
return bidFloor.floor;
|
|
88
|
+
} catch (err) {
|
|
89
|
+
logError(err);
|
|
90
|
+
return 0;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export const spec = {
|
|
95
|
+
code: BIDDER_CODE,
|
|
96
|
+
supportedMediaTypes: [BANNER, VIDEO, NATIVE],
|
|
97
|
+
|
|
98
|
+
isBidRequestValid: (bid = {}) => {
|
|
99
|
+
const { params, bidId, mediaTypes } = bid;
|
|
100
|
+
let valid = Boolean(bidId && params && params.placementId);
|
|
101
|
+
|
|
102
|
+
if (mediaTypes && mediaTypes[BANNER]) {
|
|
103
|
+
valid = valid && Boolean(mediaTypes[BANNER] && mediaTypes[BANNER].sizes);
|
|
104
|
+
} else if (mediaTypes && mediaTypes[VIDEO]) {
|
|
105
|
+
valid = valid && Boolean(mediaTypes[VIDEO] && mediaTypes[VIDEO].playerSize);
|
|
106
|
+
} else if (mediaTypes && mediaTypes[NATIVE]) {
|
|
107
|
+
valid = valid && Boolean(mediaTypes[NATIVE]);
|
|
108
|
+
} else {
|
|
109
|
+
valid = false;
|
|
110
|
+
}
|
|
111
|
+
return valid;
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
buildRequests: (validBidRequests = [], bidderRequest = {}) => {
|
|
115
|
+
let deviceWidth = 0;
|
|
116
|
+
let deviceHeight = 0;
|
|
117
|
+
|
|
118
|
+
let winLocation;
|
|
119
|
+
try {
|
|
120
|
+
const winTop = window.top;
|
|
121
|
+
deviceWidth = winTop.screen.width;
|
|
122
|
+
deviceHeight = winTop.screen.height;
|
|
123
|
+
winLocation = winTop.location;
|
|
124
|
+
} catch (e) {
|
|
125
|
+
logMessage(e);
|
|
126
|
+
winLocation = window.location;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const refferUrl = bidderRequest.refererInfo && bidderRequest.refererInfo.referer;
|
|
130
|
+
let refferLocation;
|
|
131
|
+
try {
|
|
132
|
+
refferLocation = refferUrl && new URL(refferUrl);
|
|
133
|
+
} catch (e) {
|
|
134
|
+
logMessage(e);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
let location = refferLocation || winLocation;
|
|
138
|
+
const language = (navigator && navigator.language) ? navigator.language.split('-')[0] : '';
|
|
139
|
+
const host = location.host;
|
|
140
|
+
const page = location.pathname;
|
|
141
|
+
const secure = location.protocol === 'https:' ? 1 : 0;
|
|
142
|
+
const placements = [];
|
|
143
|
+
const request = {
|
|
144
|
+
deviceWidth,
|
|
145
|
+
deviceHeight,
|
|
146
|
+
language,
|
|
147
|
+
secure,
|
|
148
|
+
host,
|
|
149
|
+
page,
|
|
150
|
+
placements,
|
|
151
|
+
coppa: config.getConfig('coppa') === true ? 1 : 0,
|
|
152
|
+
ccpa: bidderRequest.uspConsent || undefined,
|
|
153
|
+
gdpr: bidderRequest.gdprConsent || undefined,
|
|
154
|
+
tmax: config.getConfig('bidderTimeout')
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
const len = validBidRequests.length;
|
|
158
|
+
for (let i = 0; i < len; i++) {
|
|
159
|
+
const bid = validBidRequests[i];
|
|
160
|
+
placements.push(getPlacementReqData(bid));
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return {
|
|
164
|
+
method: 'POST',
|
|
165
|
+
url: AD_URL,
|
|
166
|
+
data: request
|
|
167
|
+
};
|
|
168
|
+
},
|
|
169
|
+
|
|
170
|
+
interpretResponse: (serverResponse) => {
|
|
171
|
+
let response = [];
|
|
172
|
+
for (let i = 0; i < serverResponse.body.length; i++) {
|
|
173
|
+
let resItem = serverResponse.body[i];
|
|
174
|
+
if (isBidResponseValid(resItem)) {
|
|
175
|
+
const advertiserDomains = resItem.adomain && resItem.adomain.length ? resItem.adomain : [];
|
|
176
|
+
resItem.meta = { ...resItem.meta, advertiserDomains };
|
|
177
|
+
|
|
178
|
+
response.push(resItem);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return response;
|
|
182
|
+
},
|
|
183
|
+
|
|
184
|
+
getUserSyncs: (syncOptions, serverResponses, gdprConsent, uspConsent) => {
|
|
185
|
+
let syncType = syncOptions.iframeEnabled ? 'iframe' : 'image';
|
|
186
|
+
let syncUrl = SYNC_URL + `/${syncType}?pbjs=1`;
|
|
187
|
+
if (gdprConsent && gdprConsent.consentString) {
|
|
188
|
+
if (typeof gdprConsent.gdprApplies === 'boolean') {
|
|
189
|
+
syncUrl += `&gdpr=${Number(gdprConsent.gdprApplies)}&gdpr_consent=${gdprConsent.consentString}`;
|
|
190
|
+
} else {
|
|
191
|
+
syncUrl += `&gdpr=0&gdpr_consent=${gdprConsent.consentString}`;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
if (uspConsent && uspConsent.consentString) {
|
|
195
|
+
syncUrl += `&ccpa_consent=${uspConsent.consentString}`;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
const coppa = config.getConfig('coppa') ? 1 : 0;
|
|
199
|
+
syncUrl += `&coppa=${coppa}`;
|
|
200
|
+
|
|
201
|
+
return [{
|
|
202
|
+
type: syncType,
|
|
203
|
+
url: syncUrl
|
|
204
|
+
}];
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
registerBidder(spec);
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Overview
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
Module Name: Compass Bidder Adapter
|
|
5
|
+
Module Type: Compass Bidder Adapter
|
|
6
|
+
Maintainer: sa-support@brightcom.com
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
# Description
|
|
10
|
+
|
|
11
|
+
Connects to Compass exchange for bids.
|
|
12
|
+
Compass bid adapter supports Banner, Video (instream and outstream) and Native.
|
|
13
|
+
|
|
14
|
+
# Test Parameters
|
|
15
|
+
```
|
|
16
|
+
var adUnits = [
|
|
17
|
+
// Will return static test banner
|
|
18
|
+
{
|
|
19
|
+
code: 'adunit1',
|
|
20
|
+
mediaTypes: {
|
|
21
|
+
banner: {
|
|
22
|
+
sizes: [ [300, 250], [320, 50] ],
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
bids: [
|
|
26
|
+
{
|
|
27
|
+
bidder: 'compass',
|
|
28
|
+
params: {
|
|
29
|
+
placementId: 'testBanner',
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
code: 'addunit2',
|
|
36
|
+
mediaTypes: {
|
|
37
|
+
video: {
|
|
38
|
+
playerSize: [ [640, 480] ],
|
|
39
|
+
context: 'instream',
|
|
40
|
+
minduration: 5,
|
|
41
|
+
maxduration: 60,
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
bids: [
|
|
45
|
+
{
|
|
46
|
+
bidder: 'compass',
|
|
47
|
+
params: {
|
|
48
|
+
placementId: 'testVideo',
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
code: 'addunit3',
|
|
55
|
+
mediaTypes: {
|
|
56
|
+
native: {
|
|
57
|
+
title: {
|
|
58
|
+
required: true
|
|
59
|
+
},
|
|
60
|
+
body: {
|
|
61
|
+
required: true
|
|
62
|
+
},
|
|
63
|
+
icon: {
|
|
64
|
+
required: true,
|
|
65
|
+
size: [64, 64]
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
bids: [
|
|
70
|
+
{
|
|
71
|
+
bidder: 'compass',
|
|
72
|
+
params: {
|
|
73
|
+
placementId: 'testNative',
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
];
|
|
79
|
+
```
|
|
@@ -371,7 +371,13 @@ function processCmpData(consentObject, hookConfig) {
|
|
|
371
371
|
* General timeout callback when interacting with CMP takes too long.
|
|
372
372
|
*/
|
|
373
373
|
function cmpTimedOut(hookConfig) {
|
|
374
|
-
|
|
374
|
+
if (cmpVersion === 2) {
|
|
375
|
+
logWarn(`No response from CMP, continuing auction...`)
|
|
376
|
+
storeConsentData(undefined);
|
|
377
|
+
exitModule(null, hookConfig)
|
|
378
|
+
} else {
|
|
379
|
+
cmpFailed('CMP workflow exceeded timeout threshold.', hookConfig);
|
|
380
|
+
}
|
|
375
381
|
}
|
|
376
382
|
|
|
377
383
|
/**
|
|
@@ -24,7 +24,7 @@ const LOG_PREFIX = 'Criteo: ';
|
|
|
24
24
|
Unminified source code can be found in the privately shared repo: https://github.com/Prebid-org/prebid-js-external-js-criteo/blob/master/dist/prod.js
|
|
25
25
|
*/
|
|
26
26
|
const FAST_BID_VERSION_PLACEHOLDER = '%FAST_BID_VERSION%';
|
|
27
|
-
export const FAST_BID_VERSION_CURRENT =
|
|
27
|
+
export const FAST_BID_VERSION_CURRENT = 117;
|
|
28
28
|
const FAST_BID_VERSION_LATEST = 'latest';
|
|
29
29
|
const FAST_BID_VERSION_NONE = 'none';
|
|
30
30
|
const PUBLISHER_TAG_URL_TEMPLATE = 'https://static.criteo.net/js/ld/publishertag.prebid' + FAST_BID_VERSION_PLACEHOLDER + '.js';
|
|
@@ -33,15 +33,37 @@ function getFromAllStorages(key) {
|
|
|
33
33
|
return storage.getCookie(key) || storage.getDataFromLocalStorage(key);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
function saveOnAllStorages(key, value) {
|
|
36
|
+
function saveOnAllStorages(key, value, hostname) {
|
|
37
37
|
if (key && value) {
|
|
38
|
-
storage.setCookie(key, value, expirationString);
|
|
39
38
|
storage.setDataInLocalStorage(key, value);
|
|
39
|
+
setCookieOnAllDomains(key, value, expirationString, hostname, true);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
function
|
|
44
|
-
|
|
43
|
+
function setCookieOnAllDomains(key, value, expiration, hostname, stopOnSuccess) {
|
|
44
|
+
const subDomains = hostname.split('.');
|
|
45
|
+
for (let i = 0; i < subDomains.length; ++i) {
|
|
46
|
+
// Try to write the cookie on this subdomain (we want it to be stored only on the TLD+1)
|
|
47
|
+
const domain = subDomains.slice(subDomains.length - i - 1, subDomains.length).join('.');
|
|
48
|
+
|
|
49
|
+
try {
|
|
50
|
+
storage.setCookie(key, value, expiration, null, '.' + domain);
|
|
51
|
+
|
|
52
|
+
if (stopOnSuccess) {
|
|
53
|
+
// Try to read the cookie to check if we wrote it
|
|
54
|
+
const ck = storage.getCookie(key);
|
|
55
|
+
if (ck && ck === value) {
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
} catch (error) {
|
|
60
|
+
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function deleteFromAllStorages(key, hostname) {
|
|
66
|
+
setCookieOnAllDomains(key, '', pastDateString, hostname, true);
|
|
45
67
|
storage.removeDataFromLocalStorage(key);
|
|
46
68
|
}
|
|
47
69
|
|
|
@@ -89,15 +111,15 @@ function callCriteoUserSync(parsedCriteoData, gdprString, callback) {
|
|
|
89
111
|
const urlsToCall = typeof jsonResponse.acwsUrl === 'string' ? [jsonResponse.acwsUrl] : jsonResponse.acwsUrl;
|
|
90
112
|
urlsToCall.forEach(url => triggerPixel(url));
|
|
91
113
|
} else if (jsonResponse.bundle) {
|
|
92
|
-
saveOnAllStorages(bundleStorageKey, jsonResponse.bundle);
|
|
114
|
+
saveOnAllStorages(bundleStorageKey, jsonResponse.bundle, domain);
|
|
93
115
|
}
|
|
94
116
|
|
|
95
117
|
if (jsonResponse.bidId) {
|
|
96
|
-
saveOnAllStorages(bididStorageKey, jsonResponse.bidId);
|
|
118
|
+
saveOnAllStorages(bididStorageKey, jsonResponse.bidId, domain);
|
|
97
119
|
const criteoId = { criteoId: jsonResponse.bidId };
|
|
98
120
|
callback(criteoId);
|
|
99
121
|
} else {
|
|
100
|
-
deleteFromAllStorages(bididStorageKey);
|
|
122
|
+
deleteFromAllStorages(bididStorageKey, domain);
|
|
101
123
|
callback();
|
|
102
124
|
}
|
|
103
125
|
},
|
package/modules/currency.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { logInfo, logWarn, logError, logMessage } from '../src/utils.js';
|
|
2
2
|
import { getGlobal } from '../src/prebidGlobal.js';
|
|
3
3
|
import { createBid } from '../src/bidfactory.js';
|
|
4
|
-
import
|
|
4
|
+
import CONSTANTS from '../src/constants.json';
|
|
5
5
|
import { ajax } from '../src/ajax.js';
|
|
6
6
|
import { config } from '../src/config.js';
|
|
7
7
|
import { getHook } from '../src/hook.js';
|
|
@@ -219,7 +219,7 @@ function wrapFunction(fn, context, params) {
|
|
|
219
219
|
}
|
|
220
220
|
} catch (e) {
|
|
221
221
|
logWarn('Returning NO_BID, getCurrencyConversion threw error: ', e);
|
|
222
|
-
params[1] = createBid(STATUS.NO_BID, {
|
|
222
|
+
params[1] = createBid(CONSTANTS.STATUS.NO_BID, {
|
|
223
223
|
bidder: bid.bidderCode || bid.bidder,
|
|
224
224
|
bidId: bid.requestId
|
|
225
225
|
});
|