prebid.js 7.24.0 → 7.25.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/dist/33acrossBidAdapter.js +1 -1
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adtrgtmeBidAdapter.js +1 -1
- package/dist/adxcgBidAdapter.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/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/carodaBidAdapter.js +1 -1
- package/dist/chtnwBidAdapter.js +1 -1
- package/dist/concertBidAdapter.js +1 -1
- package/dist/connectadBidAdapter.js +1 -1
- package/dist/consumableBidAdapter.js +1 -1
- package/dist/conversantBidAdapter.js +1 -1
- package/dist/craftBidAdapter.js +1 -1
- package/dist/criteoBidAdapter.js +1 -1
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/glimpseBidAdapter.js +1 -1
- package/dist/gmosspBidAdapter.js +1 -1
- package/dist/goldbachBidAdapter.js +1 -1
- package/dist/gridBidAdapter.js +1 -1
- package/dist/gridNMBidAdapter.js +1 -1
- package/dist/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.js +1 -1
- package/dist/id5IdSystem.js +1 -1
- package/dist/improvedigitalBidAdapter.js +1 -1
- package/dist/inmarBidAdapter.js +1 -1
- package/dist/insticatorBidAdapter.js +1 -1
- package/dist/ixBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/kargoBidAdapter.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/liveyieldAnalyticsAdapter.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.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/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/microadBidAdapter.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/nextMillenniumBidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +112 -112
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/parrableIdSystem.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/prebid-core.js +1 -1
- package/dist/publinkIdSystem.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/rhythmoneBidAdapter.js +1 -1
- package/dist/riseBidAdapter.js +1 -1
- package/dist/rubiconAnalyticsAdapter.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/smaatoBidAdapter.js +1 -1
- package/dist/smartadserverBidAdapter.js +1 -1
- package/dist/smartxBidAdapter.js +1 -1
- package/dist/smilewantedBidAdapter.js +1 -1
- package/dist/sonobiBidAdapter.js +1 -1
- package/dist/sovrnAnalyticsAdapter.js +1 -1
- package/dist/sovrnBidAdapter.js +1 -1
- package/dist/sspBCBidAdapter.js +1 -1
- package/dist/sublimeBidAdapter.js +1 -1
- package/dist/synacormediaBidAdapter.js +1 -1
- package/dist/targetVideoBidAdapter.js +1 -1
- package/dist/teadsBidAdapter.js +1 -1
- package/dist/trionBidAdapter.js +1 -1
- package/dist/tripleliftBidAdapter.js +1 -1
- package/dist/ttdBidAdapter.js +1 -1
- package/dist/ucfunnelAnalyticsAdapter.js +1 -1
- package/dist/underdogmediaBidAdapter.js +1 -1
- package/dist/undertoneBidAdapter.js +1 -1
- package/dist/vidazooBidAdapter.js +1 -1
- 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/yahoosspBidAdapter.js +1 -1
- package/dist/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/modules/adagioBidAdapter.js +1 -1
- package/modules/concertBidAdapter.js +17 -3
- package/modules/conversantAnalyticsAdapter.md +12 -13
- package/modules/conversantBidAdapter.md +3 -3
- package/modules/kargoBidAdapter.js +14 -8
- package/modules/magniteAnalyticsAdapter.js +1 -1
- package/modules/microadBidAdapter.js +22 -11
- package/modules/nextMillenniumBidAdapter.js +1 -1
- package/modules/oguryBidAdapter.js +5 -2
- package/modules/pubmaticBidAdapter.js +1 -1
- package/modules/seedtagBidAdapter.js +9 -4
- package/modules/vidazooBidAdapter.js +14 -1
- package/modules/yieldmoBidAdapter.js +22 -8
- package/package.json +1 -1
- package/test/spec/modules/adagioBidAdapter_spec.js +2 -2
- package/test/spec/modules/concertBidAdapter_spec.js +26 -15
- package/test/spec/modules/kargoBidAdapter_spec.js +76 -4
- package/test/spec/modules/magniteAnalyticsAdapter_spec.js +20 -0
- package/test/spec/modules/microadBidAdapter_spec.js +48 -0
- package/test/spec/modules/oguryBidAdapter_spec.js +27 -5
- package/test/spec/modules/pubmaticBidAdapter_spec.js +2 -2
- package/test/spec/modules/seedtagBidAdapter_spec.js +34 -10
- package/test/spec/modules/vidazooBidAdapter_spec.js +1 -0
- package/test/spec/modules/yieldmoBidAdapter_spec.js +3 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { logWarn, logMessage, debugTurnedOn, generateUUID } from '../src/utils.js';
|
|
1
|
+
import { logWarn, logMessage, debugTurnedOn, generateUUID, deepAccess } from '../src/utils.js';
|
|
2
2
|
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
3
3
|
import { getStorageManager } from '../src/storageManager.js';
|
|
4
4
|
import { hasPurpose1Consent } from '../src/utils/gpdr.js';
|
|
@@ -178,7 +178,7 @@ export const spec = {
|
|
|
178
178
|
|
|
179
179
|
registerBidder(spec);
|
|
180
180
|
|
|
181
|
-
const storage = getStorageManager({bidderCode: BIDDER_CODE});
|
|
181
|
+
export const storage = getStorageManager({bidderCode: BIDDER_CODE});
|
|
182
182
|
|
|
183
183
|
/**
|
|
184
184
|
* Check or generate a UID for the current user.
|
|
@@ -188,10 +188,24 @@ function getUid(bidderRequest) {
|
|
|
188
188
|
return false;
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
-
const
|
|
191
|
+
const sharedId = deepAccess(bidderRequest, 'userId._sharedid.id');
|
|
192
192
|
|
|
193
|
+
if (sharedId) {
|
|
194
|
+
return sharedId;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
const LEGACY_CONCERT_UID_KEY = 'c_uid';
|
|
198
|
+
const CONCERT_UID_KEY = 'vmconcert_uid';
|
|
199
|
+
|
|
200
|
+
const legacyUid = storage.getDataFromLocalStorage(LEGACY_CONCERT_UID_KEY);
|
|
193
201
|
let uid = storage.getDataFromLocalStorage(CONCERT_UID_KEY);
|
|
194
202
|
|
|
203
|
+
if (legacyUid) {
|
|
204
|
+
uid = legacyUid;
|
|
205
|
+
storage.setDataInLocalStorage(CONCERT_UID_KEY, uid);
|
|
206
|
+
storage.removeDataFromLocalStorage(LEGACY_CONCERT_UID_KEY);
|
|
207
|
+
}
|
|
208
|
+
|
|
195
209
|
if (!uid) {
|
|
196
210
|
uid = generateUUID();
|
|
197
211
|
storage.setDataInLocalStorage(CONCERT_UID_KEY, uid);
|
|
@@ -1,37 +1,36 @@
|
|
|
1
1
|
# Overview
|
|
2
|
-
- Module Name:
|
|
2
|
+
- Module Name: Epsilon Analytics Adapter
|
|
3
3
|
- Module Type: Analytics Adapter
|
|
4
|
-
- Maintainer: mediapsr@
|
|
4
|
+
- Maintainer: mediapsr@epsilon.com
|
|
5
5
|
|
|
6
6
|
## Description
|
|
7
7
|
|
|
8
|
-
Analytics adapter for Conversant is used to track performance of Prebid auctions. See the usage below for how to
|
|
8
|
+
Analytics adapter for Epsilon (formerly Conversant) is used to track performance of Prebid auctions. See the usage below for how to
|
|
9
9
|
configure the adapter for your webpage. To enable analytics and gain access to the data publishers will need
|
|
10
|
-
to contact their
|
|
10
|
+
to contact their Epsilon representative (publishersupport@epsilon.com).
|
|
11
11
|
|
|
12
12
|
## Setup
|
|
13
13
|
|
|
14
|
-
Before any analytics are recorded for your website you will need to have
|
|
14
|
+
Before any analytics are recorded for your website you will need to have an Epsilon representative turn
|
|
15
15
|
on Prebid analytics for your website.
|
|
16
16
|
|
|
17
|
-
The simplest configuration to add
|
|
17
|
+
The simplest configuration to add Epsilon Prebid analytics to your page is as follows:
|
|
18
18
|
|
|
19
19
|
```
|
|
20
20
|
pbjs.que.push(function() {
|
|
21
21
|
pbjs.enableAnalytics({
|
|
22
22
|
provider: 'conversant',
|
|
23
23
|
options: {
|
|
24
|
-
site_id:
|
|
24
|
+
site_id: <YOUR_SITE_ID>
|
|
25
25
|
}
|
|
26
26
|
})
|
|
27
27
|
});
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
Additionally the following options are supported:
|
|
30
|
+
Additionally, the following options are supported:
|
|
31
31
|
|
|
32
|
-
- **
|
|
33
|
-
|
|
34
|
-
at a higher or lower rate. '0' would completely disable sampling and '100' would capture every instance.
|
|
32
|
+
- **cnvr_sampling**: Sample rate for analytics data. Value should be between 0 and 1 (inclusive), 0 == never sample,
|
|
33
|
+
1 == always sample, 0.5 == send analytics 50% of the time.
|
|
35
34
|
|
|
36
35
|
### Complete Example
|
|
37
36
|
```
|
|
@@ -39,8 +38,8 @@ at a higher or lower rate. '0' would completely disable sampling and '100' would
|
|
|
39
38
|
pbjs.enableAnalytics({
|
|
40
39
|
provider: 'conversant',
|
|
41
40
|
options: {
|
|
42
|
-
site_id:
|
|
43
|
-
|
|
41
|
+
site_id: 1234,
|
|
42
|
+
cnvr_sampling: 0.9
|
|
44
43
|
}
|
|
45
44
|
})
|
|
46
45
|
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Overview
|
|
2
2
|
|
|
3
|
-
- Module Name:
|
|
3
|
+
- Module Name: Epsilon Bidder Adapter
|
|
4
4
|
- Module Type: Bidder Adapter
|
|
5
|
-
- Maintainer: mediapsr@
|
|
5
|
+
- Maintainer: mediapsr@epsilon.com
|
|
6
6
|
|
|
7
7
|
# Description
|
|
8
8
|
|
|
9
|
-
Module that connects to
|
|
9
|
+
Module that connects to Epsilon's (formerly Conversant) demand sources. Supports banners and videos.
|
|
10
10
|
|
|
11
11
|
# Test Parameters
|
|
12
12
|
```
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _each, buildUrl, triggerPixel } from '../src/utils.js';
|
|
1
|
+
import { _each, buildUrl, deepAccess, pick, triggerPixel } from '../src/utils.js';
|
|
2
2
|
import { config } from '../src/config.js';
|
|
3
3
|
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
4
4
|
import { getStorageManager } from '../src/storageManager.js';
|
|
@@ -37,10 +37,9 @@ export const spec = {
|
|
|
37
37
|
bidSizes[bid.bidId] = bid.sizes;
|
|
38
38
|
});
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
40
|
+
const firstBidRequest = validBidRequests[0];
|
|
41
|
+
|
|
42
|
+
const tdid = deepAccess(firstBidRequest, 'userId.tdid')
|
|
44
43
|
|
|
45
44
|
const transformedParams = Object.assign({}, {
|
|
46
45
|
sessionId: spec._getSessionId(),
|
|
@@ -62,10 +61,17 @@ export const spec = {
|
|
|
62
61
|
prebidRawBidRequests: validBidRequests
|
|
63
62
|
}, spec._getAllMetadata(bidderRequest, tdid));
|
|
64
63
|
|
|
64
|
+
// User Agent Client Hints / SUA
|
|
65
|
+
const uaClientHints = deepAccess(firstBidRequest, 'ortb2.device.sua');
|
|
66
|
+
if (uaClientHints) {
|
|
67
|
+
transformedParams.device.sua = pick(uaClientHints, ['browsers', 'platform', 'mobile', 'model']);
|
|
68
|
+
}
|
|
69
|
+
|
|
65
70
|
// Pull Social Canvas segments and embed URL
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
transformedParams.
|
|
71
|
+
const socialCanvas = deepAccess(firstBidRequest, 'params.socialCanvas');
|
|
72
|
+
if (socialCanvas) {
|
|
73
|
+
transformedParams.socialCanvasSegments = socialCanvas.segments;
|
|
74
|
+
transformedParams.socialEmbedURL = socialCanvas.embedURL;
|
|
69
75
|
}
|
|
70
76
|
|
|
71
77
|
const encodedParams = encodeURIComponent(JSON.stringify(transformedParams));
|
|
@@ -706,7 +706,7 @@ magniteAdapter.track = ({ eventType, args }) => {
|
|
|
706
706
|
'code as adUnitCode',
|
|
707
707
|
'transactionId',
|
|
708
708
|
'mediaTypes', mediaTypes => Object.keys(mediaTypes),
|
|
709
|
-
'sizes as dimensions', sizes => sizes.map(sizeToDimensions),
|
|
709
|
+
'sizes as dimensions', sizes => (sizes || [[1, 1]]).map(sizeToDimensions),
|
|
710
710
|
]);
|
|
711
711
|
ad.pbAdSlot = deepAccess(adUnit, 'ortb2Imp.ext.data.pbadslot');
|
|
712
712
|
ad.pattern = deepAccess(adUnit, 'ortb2Imp.ext.data.aupname');
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { deepAccess, isEmpty, isStr } from '../src/utils.js';
|
|
1
|
+
import { deepAccess, isArray, isEmpty, isStr } from '../src/utils.js';
|
|
2
|
+
import { find } from '../src/polyfill.js';
|
|
2
3
|
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
3
4
|
import { BANNER } from '../src/mediaTypes.js';
|
|
4
5
|
import { convertOrtbRequestToProprietaryNative } from '../src/native.js';
|
|
@@ -24,15 +25,16 @@ const NATIVE_CODE = 2;
|
|
|
24
25
|
const VIDEO_CODE = 4;
|
|
25
26
|
|
|
26
27
|
const AUDIENCE_IDS = [
|
|
27
|
-
{type: 6, bidKey: 'userId.imuid'},
|
|
28
|
-
{type: 8, bidKey: 'userId.id5id.uid'},
|
|
29
|
-
{type: 9, bidKey: 'userId.tdid'},
|
|
30
|
-
{type: 10, bidKey: 'userId.novatiq.snowflake'},
|
|
31
|
-
{type: 11, bidKey: 'userId.parrableId.eid'},
|
|
32
|
-
{type: 12, bidKey: 'userId.dacId.id'},
|
|
33
|
-
{type: 13, bidKey: 'userId.idl_env'},
|
|
34
|
-
{type: 14, bidKey: 'userId.criteoId'},
|
|
35
|
-
{type: 15, bidKey: 'userId.pubcid'}
|
|
28
|
+
{type: 6, bidKey: 'userId.imuid', source: 'intimatemerger.com'},
|
|
29
|
+
{type: 8, bidKey: 'userId.id5id.uid', source: 'id5-sync.com'},
|
|
30
|
+
{type: 9, bidKey: 'userId.tdid', source: 'adserver.org'},
|
|
31
|
+
{type: 10, bidKey: 'userId.novatiq.snowflake', source: 'novatiq.com'},
|
|
32
|
+
{type: 11, bidKey: 'userId.parrableId.eid', source: 'parrable.com'},
|
|
33
|
+
{type: 12, bidKey: 'userId.dacId.id', source: 'dac.co.jp'},
|
|
34
|
+
{type: 13, bidKey: 'userId.idl_env', source: 'liveramp.com'},
|
|
35
|
+
{type: 14, bidKey: 'userId.criteoId', source: 'criteo.com'},
|
|
36
|
+
{type: 15, bidKey: 'userId.pubcid', source: 'pubcid.org'},
|
|
37
|
+
{type: 17, bidKey: 'userId.uid2.id', source: 'uidapi.com'}
|
|
36
38
|
];
|
|
37
39
|
|
|
38
40
|
function createCBT() {
|
|
@@ -100,10 +102,19 @@ export const spec = {
|
|
|
100
102
|
}
|
|
101
103
|
|
|
102
104
|
const aidsParams = []
|
|
105
|
+
const userIdAsEids = bid.userIdAsEids;
|
|
103
106
|
AUDIENCE_IDS.forEach((audienceId) => {
|
|
104
107
|
const bidAudienceId = deepAccess(bid, audienceId.bidKey);
|
|
105
108
|
if (!isEmpty(bidAudienceId) && isStr(bidAudienceId)) {
|
|
106
|
-
|
|
109
|
+
const aidParam = { type: audienceId.type, id: bidAudienceId };
|
|
110
|
+
// Set ext
|
|
111
|
+
if (isArray(userIdAsEids)) {
|
|
112
|
+
const targetEid = find(userIdAsEids, (eid) => eid.source === audienceId.source) || {};
|
|
113
|
+
if (!isEmpty(deepAccess(targetEid, 'uids.0.ext'))) {
|
|
114
|
+
aidParam.ext = targetEid.uids[0].ext;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
aidsParams.push(aidParam);
|
|
107
118
|
// Set Ramp ID
|
|
108
119
|
if (audienceId.type === 13) params['idl_env'] = bidAudienceId;
|
|
109
120
|
}
|
|
@@ -11,7 +11,7 @@ const DEFAULT_TIMEOUT = 1000;
|
|
|
11
11
|
const BID_HOST = 'https://mweb-hb.presage.io/api/header-bidding-request';
|
|
12
12
|
const TIMEOUT_MONITORING_HOST = 'https://ms-ads-monitoring-events.presage.io';
|
|
13
13
|
const MS_COOKIE_SYNC_DOMAIN = 'https://ms-cookie-sync.presage.io';
|
|
14
|
-
const ADAPTER_VERSION = '1.
|
|
14
|
+
const ADAPTER_VERSION = '1.4.0';
|
|
15
15
|
|
|
16
16
|
function getClientWidth() {
|
|
17
17
|
const documentElementClientWidth = window.top.document.documentElement.clientWidth
|
|
@@ -114,7 +114,10 @@ function buildRequests(validBidRequests, bidderRequest) {
|
|
|
114
114
|
banner: {
|
|
115
115
|
format: sizes
|
|
116
116
|
},
|
|
117
|
-
ext:
|
|
117
|
+
ext: {
|
|
118
|
+
...bidRequest.params,
|
|
119
|
+
timeSpentOnPage: document.timeline && document.timeline.currentTime ? document.timeline.currentTime : 0
|
|
120
|
+
}
|
|
118
121
|
});
|
|
119
122
|
}
|
|
120
123
|
});
|
|
@@ -1254,7 +1254,7 @@ export const spec = {
|
|
|
1254
1254
|
seatbidder.bid.forEach(bid => {
|
|
1255
1255
|
let newBid = {
|
|
1256
1256
|
requestId: bid.impid,
|
|
1257
|
-
cpm:
|
|
1257
|
+
cpm: parseFloat((bid.price || 0).toFixed(2)),
|
|
1258
1258
|
width: bid.w,
|
|
1259
1259
|
height: bid.h,
|
|
1260
1260
|
creativeId: bid.crid || bid.id,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { isArray, _map, triggerPixel } from '../src/utils.js';
|
|
2
2
|
import { registerBidder } from '../src/adapters/bidderFactory.js'
|
|
3
3
|
import { VIDEO, BANNER } from '../src/mediaTypes.js'
|
|
4
|
+
import { config } from '../src/config.js';
|
|
4
5
|
|
|
5
6
|
const BIDDER_CODE = 'seedtag';
|
|
6
7
|
const SEEDTAG_ALIAS = 'st';
|
|
@@ -177,7 +178,7 @@ function ttfb() {
|
|
|
177
178
|
return ttfb >= 0 && ttfb <= performance.now() ? ttfb : 0;
|
|
178
179
|
}
|
|
179
180
|
|
|
180
|
-
export function getTimeoutUrl
|
|
181
|
+
export function getTimeoutUrl(data) {
|
|
181
182
|
let queryParams = '';
|
|
182
183
|
if (
|
|
183
184
|
isArray(data) && data[0] &&
|
|
@@ -235,7 +236,6 @@ export const spec = {
|
|
|
235
236
|
if (gdprApplies !== undefined) payload['ga'] = gdprApplies;
|
|
236
237
|
payload['cd'] = bidderRequest.gdprConsent.consentString;
|
|
237
238
|
}
|
|
238
|
-
|
|
239
239
|
if (bidderRequest.uspConsent) {
|
|
240
240
|
payload['uspConsent'] = bidderRequest.uspConsent
|
|
241
241
|
}
|
|
@@ -244,6 +244,11 @@ export const spec = {
|
|
|
244
244
|
payload.schain = validBidRequests[0].schain;
|
|
245
245
|
}
|
|
246
246
|
|
|
247
|
+
let coppa = config.getConfig('coppa')
|
|
248
|
+
if (coppa) {
|
|
249
|
+
payload.coppa = coppa
|
|
250
|
+
}
|
|
251
|
+
|
|
247
252
|
const payloadString = JSON.stringify(payload)
|
|
248
253
|
return {
|
|
249
254
|
method: 'POST',
|
|
@@ -258,10 +263,10 @@ export const spec = {
|
|
|
258
263
|
* @param {ServerResponse} serverResponse A successful response from the server.
|
|
259
264
|
* @return {Bid[]} An array of bids which were nested inside the server.
|
|
260
265
|
*/
|
|
261
|
-
interpretResponse: function(serverResponse) {
|
|
266
|
+
interpretResponse: function (serverResponse) {
|
|
262
267
|
const serverBody = serverResponse.body;
|
|
263
268
|
if (serverBody && serverBody.bids && isArray(serverBody.bids)) {
|
|
264
|
-
return _map(serverBody.bids, function(bid) {
|
|
269
|
+
return _map(serverBody.bids, function (bid) {
|
|
265
270
|
return buildBidResponse(bid);
|
|
266
271
|
});
|
|
267
272
|
} else {
|
|
@@ -12,6 +12,7 @@ const TTL_SECONDS = 60 * 5;
|
|
|
12
12
|
const DEAL_ID_EXPIRY = 1000 * 60 * 15;
|
|
13
13
|
const UNIQUE_DEAL_ID_EXPIRY = 1000 * 60 * 60;
|
|
14
14
|
const SESSION_ID_KEY = 'vidSid';
|
|
15
|
+
const OPT_CACHE_KEY = 'vdzwopt';
|
|
15
16
|
export const SUPPORTED_ID_SYSTEMS = {
|
|
16
17
|
'britepoolid': 1,
|
|
17
18
|
'criteoId': 1,
|
|
@@ -66,6 +67,7 @@ function buildRequest(bid, topWindowUrl, sizes, bidderRequest) {
|
|
|
66
67
|
const cId = extractCID(params);
|
|
67
68
|
const pId = extractPID(params);
|
|
68
69
|
const subDomain = extractSubDomain(params);
|
|
70
|
+
const ptrace = getCacheOpt();
|
|
69
71
|
|
|
70
72
|
let data = {
|
|
71
73
|
url: encodeURIComponent(topWindowUrl),
|
|
@@ -83,7 +85,8 @@ function buildRequest(bid, topWindowUrl, sizes, bidderRequest) {
|
|
|
83
85
|
bidderVersion: BIDDER_VERSION,
|
|
84
86
|
prebidVersion: '$prebid.version$',
|
|
85
87
|
res: `${screen.width}x${screen.height}`,
|
|
86
|
-
schain: schain
|
|
88
|
+
schain: schain,
|
|
89
|
+
ptrace: ptrace
|
|
87
90
|
};
|
|
88
91
|
|
|
89
92
|
appendUserIdsToRequestPayload(data, userId);
|
|
@@ -258,6 +261,16 @@ export function getVidazooSessionId() {
|
|
|
258
261
|
return getStorageItem(SESSION_ID_KEY) || '';
|
|
259
262
|
}
|
|
260
263
|
|
|
264
|
+
export function getCacheOpt() {
|
|
265
|
+
let data = storage.getDataFromLocalStorage(OPT_CACHE_KEY);
|
|
266
|
+
if (!data) {
|
|
267
|
+
data = String(Date.now());
|
|
268
|
+
storage.setDataInLocalStorage(OPT_CACHE_KEY, data);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
return data;
|
|
272
|
+
}
|
|
273
|
+
|
|
261
274
|
export function getStorageItem(key) {
|
|
262
275
|
try {
|
|
263
276
|
return tryParseJSON(storage.getDataFromLocalStorage(key));
|
|
@@ -20,12 +20,15 @@ import {find, includes} from '../src/polyfill.js';
|
|
|
20
20
|
import {createEidsArray} from './userId/eids.js';
|
|
21
21
|
|
|
22
22
|
const BIDDER_CODE = 'yieldmo';
|
|
23
|
+
const GVLID = 173;
|
|
23
24
|
const CURRENCY = 'USD';
|
|
24
25
|
const TIME_TO_LIVE = 300;
|
|
25
26
|
const NET_REVENUE = true;
|
|
26
|
-
const BANNER_SERVER_ENDPOINT = 'https://ads.yieldmo.com/exchange/prebid';
|
|
27
|
-
const VIDEO_SERVER_ENDPOINT = 'https://ads.yieldmo.com/exchange/prebidvideo';
|
|
28
27
|
const PB_COOKIE_ASSIST_SYNC_ENDPOINT = `https://ads.yieldmo.com/pbcas`;
|
|
28
|
+
const BANNER_PATH = '/exchange/prebid';
|
|
29
|
+
const VIDEO_PATH = '/exchange/prebidvideo';
|
|
30
|
+
const STAGE_DOMAIN = 'https://ads-stg.yieldmo.com';
|
|
31
|
+
const PROD_DOMAIN = 'https://ads.yieldmo.com';
|
|
29
32
|
const OUTSTREAM_VIDEO_PLAYER_URL = 'https://prebid-outstream.yieldmo.com/bundle.js';
|
|
30
33
|
const OPENRTB_VIDEO_BIDPARAMS = ['mimes', 'startdelay', 'placement', 'startdelay', 'skipafter', 'protocols', 'api',
|
|
31
34
|
'playbackmethod', 'maxduration', 'minduration', 'pos', 'skip', 'skippable'];
|
|
@@ -40,7 +43,7 @@ const BANNER_REQUEST_PROPERTIES_TO_REDUCE = ['description', 'title', 'pr', 'page
|
|
|
40
43
|
export const spec = {
|
|
41
44
|
code: BIDDER_CODE,
|
|
42
45
|
supportedMediaTypes: [BANNER, VIDEO],
|
|
43
|
-
|
|
46
|
+
gvlid: GVLID,
|
|
44
47
|
/**
|
|
45
48
|
* Determines whether or not the given bid request is valid.
|
|
46
49
|
* @param {object} bid, bid to validate
|
|
@@ -59,6 +62,9 @@ export const spec = {
|
|
|
59
62
|
* @return ServerRequest Info describing the request to the server.
|
|
60
63
|
*/
|
|
61
64
|
buildRequests: function (bidRequests, bidderRequest) {
|
|
65
|
+
const stage = isStage(bidderRequest);
|
|
66
|
+
const bannerUrl = getAdserverUrl(BANNER_PATH, stage);
|
|
67
|
+
const videoUrl = getAdserverUrl(VIDEO_PATH, stage);
|
|
62
68
|
const bannerBidRequests = bidRequests.filter(request => hasBannerMediaType(request));
|
|
63
69
|
const videoBidRequests = bidRequests.filter(request => hasVideoMediaType(request));
|
|
64
70
|
let serverRequests = [];
|
|
@@ -122,8 +128,8 @@ export const spec = {
|
|
|
122
128
|
serverRequest.eids = JSON.stringify(eids);
|
|
123
129
|
};
|
|
124
130
|
// check if url exceeded max length
|
|
125
|
-
const
|
|
126
|
-
let extraCharacters =
|
|
131
|
+
const fullUrl = `${bannerUrl}?${parseQueryStringParameters(serverRequest)}`;
|
|
132
|
+
let extraCharacters = fullUrl.length - MAX_BANNER_REQUEST_URL_LENGTH;
|
|
127
133
|
if (extraCharacters > 0) {
|
|
128
134
|
for (let i = 0; i < BANNER_REQUEST_PROPERTIES_TO_REDUCE.length; i++) {
|
|
129
135
|
extraCharacters = shortcutProperty(extraCharacters, serverRequest, BANNER_REQUEST_PROPERTIES_TO_REDUCE[i]);
|
|
@@ -136,7 +142,7 @@ export const spec = {
|
|
|
136
142
|
|
|
137
143
|
serverRequests.push({
|
|
138
144
|
method: 'GET',
|
|
139
|
-
url:
|
|
145
|
+
url: bannerUrl,
|
|
140
146
|
data: serverRequest
|
|
141
147
|
});
|
|
142
148
|
}
|
|
@@ -148,7 +154,7 @@ export const spec = {
|
|
|
148
154
|
};
|
|
149
155
|
serverRequests.push({
|
|
150
156
|
method: 'POST',
|
|
151
|
-
url:
|
|
157
|
+
url: videoUrl,
|
|
152
158
|
data: serverRequest
|
|
153
159
|
});
|
|
154
160
|
}
|
|
@@ -249,7 +255,6 @@ function addPlacement(request) {
|
|
|
249
255
|
if (transactionId) {
|
|
250
256
|
placementInfo.tid = transactionId;
|
|
251
257
|
}
|
|
252
|
-
|
|
253
258
|
if (request.auctionId) {
|
|
254
259
|
placementInfo.auctionId = request.auctionId;
|
|
255
260
|
}
|
|
@@ -676,3 +681,12 @@ function canAccessTopWindow() {
|
|
|
676
681
|
return false;
|
|
677
682
|
}
|
|
678
683
|
}
|
|
684
|
+
|
|
685
|
+
function isStage(bidderRequest) {
|
|
686
|
+
return !!bidderRequest.refererInfo?.referer?.includes('pb_force_a');
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
function getAdserverUrl(path, stage) {
|
|
690
|
+
const domain = stage ? STAGE_DOMAIN : PROD_DOMAIN;
|
|
691
|
+
return `${domain}${path}`;
|
|
692
|
+
}
|
package/package.json
CHANGED
|
@@ -400,7 +400,7 @@ describe('Adagio bid adapter', () => {
|
|
|
400
400
|
skipafter: 4,
|
|
401
401
|
minduration: 10,
|
|
402
402
|
maxduration: 30,
|
|
403
|
-
placement:
|
|
403
|
+
placement: 3,
|
|
404
404
|
protocols: [8]
|
|
405
405
|
}
|
|
406
406
|
}).build();
|
|
@@ -415,7 +415,7 @@ describe('Adagio bid adapter', () => {
|
|
|
415
415
|
skipafter: 4,
|
|
416
416
|
minduration: 10,
|
|
417
417
|
maxduration: 30,
|
|
418
|
-
placement:
|
|
418
|
+
placement: 3,
|
|
419
419
|
protocols: [8],
|
|
420
420
|
w: 300,
|
|
421
421
|
h: 250
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { expect } from 'chai';
|
|
2
2
|
import sinon from 'sinon';
|
|
3
|
-
import { spec } from 'modules/concertBidAdapter.js';
|
|
4
|
-
import {
|
|
3
|
+
import { spec, storage } from 'modules/concertBidAdapter.js';
|
|
4
|
+
import { hook } from 'src/hook.js';
|
|
5
5
|
|
|
6
6
|
describe('ConcertAdapter', function () {
|
|
7
7
|
let bidRequests;
|
|
@@ -10,9 +10,8 @@ describe('ConcertAdapter', function () {
|
|
|
10
10
|
let element;
|
|
11
11
|
let sandbox;
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
sandbox.restore();
|
|
13
|
+
before(function () {
|
|
14
|
+
hook.ready();
|
|
16
15
|
});
|
|
17
16
|
|
|
18
17
|
beforeEach(function () {
|
|
@@ -39,6 +38,7 @@ describe('ConcertAdapter', function () {
|
|
|
39
38
|
storageAllowed: true
|
|
40
39
|
}
|
|
41
40
|
};
|
|
41
|
+
|
|
42
42
|
bidRequests = [
|
|
43
43
|
{
|
|
44
44
|
bidder: 'concert',
|
|
@@ -83,6 +83,11 @@ describe('ConcertAdapter', function () {
|
|
|
83
83
|
sandbox.stub(document, 'getElementById').withArgs('desktop_leaderboard_variable').returns(element)
|
|
84
84
|
});
|
|
85
85
|
|
|
86
|
+
afterEach(function () {
|
|
87
|
+
$$PREBID_GLOBAL$$.bidderSettings = {};
|
|
88
|
+
sandbox.restore();
|
|
89
|
+
});
|
|
90
|
+
|
|
86
91
|
describe('spec.isBidRequestValid', function() {
|
|
87
92
|
it('should return when it recieved all the required params', function() {
|
|
88
93
|
const bid = bidRequests[0];
|
|
@@ -118,7 +123,6 @@ describe('ConcertAdapter', function () {
|
|
|
118
123
|
});
|
|
119
124
|
|
|
120
125
|
it('should not generate uid if the user has opted out', function() {
|
|
121
|
-
const storage = getStorageManager();
|
|
122
126
|
storage.setDataInLocalStorage('c_nap', 'true');
|
|
123
127
|
const request = spec.buildRequests(bidRequests, bidRequest);
|
|
124
128
|
const payload = JSON.parse(request.data);
|
|
@@ -127,7 +131,6 @@ describe('ConcertAdapter', function () {
|
|
|
127
131
|
});
|
|
128
132
|
|
|
129
133
|
it('should generate uid if the user has not opted out', function() {
|
|
130
|
-
const storage = getStorageManager();
|
|
131
134
|
storage.removeDataFromLocalStorage('c_nap');
|
|
132
135
|
const request = spec.buildRequests(bidRequests, bidRequest);
|
|
133
136
|
const payload = JSON.parse(request.data);
|
|
@@ -135,9 +138,22 @@ describe('ConcertAdapter', function () {
|
|
|
135
138
|
expect(payload.meta.uid).to.not.equal(false);
|
|
136
139
|
});
|
|
137
140
|
|
|
138
|
-
it('should
|
|
139
|
-
|
|
140
|
-
|
|
141
|
+
it('should use sharedid if it exists', function() {
|
|
142
|
+
storage.removeDataFromLocalStorage('c_nap');
|
|
143
|
+
const request = spec.buildRequests(bidRequests, {
|
|
144
|
+
...bidRequest,
|
|
145
|
+
userId: {
|
|
146
|
+
_sharedid: {
|
|
147
|
+
id: '123abc'
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
const payload = JSON.parse(request.data);
|
|
152
|
+
expect(payload.meta.uid).to.equal('123abc');
|
|
153
|
+
})
|
|
154
|
+
|
|
155
|
+
it('should grab uid from local storage if it exists and sharedid does not', function() {
|
|
156
|
+
storage.setDataInLocalStorage('vmconcert_uid', 'foo');
|
|
141
157
|
storage.removeDataFromLocalStorage('c_nap');
|
|
142
158
|
const request = spec.buildRequests(bidRequests, bidRequest);
|
|
143
159
|
const payload = JSON.parse(request.data);
|
|
@@ -211,7 +227,6 @@ describe('ConcertAdapter', function () {
|
|
|
211
227
|
const opts = {
|
|
212
228
|
iframeEnabled: true
|
|
213
229
|
};
|
|
214
|
-
const storage = getStorageManager();
|
|
215
230
|
storage.setDataInLocalStorage('c_nap', 'true');
|
|
216
231
|
|
|
217
232
|
const sync = spec.getUserSyncs(opts, [], bidRequest.gdprConsent, bidRequest.uspConsent);
|
|
@@ -222,7 +237,6 @@ describe('ConcertAdapter', function () {
|
|
|
222
237
|
const opts = {
|
|
223
238
|
iframeEnabled: true
|
|
224
239
|
};
|
|
225
|
-
const storage = getStorageManager();
|
|
226
240
|
storage.removeDataFromLocalStorage('c_nap');
|
|
227
241
|
|
|
228
242
|
bidRequest.gdprConsent = {
|
|
@@ -237,7 +251,6 @@ describe('ConcertAdapter', function () {
|
|
|
237
251
|
const opts = {
|
|
238
252
|
iframeEnabled: true
|
|
239
253
|
};
|
|
240
|
-
const storage = getStorageManager();
|
|
241
254
|
storage.removeDataFromLocalStorage('c_nap');
|
|
242
255
|
|
|
243
256
|
bidRequest.gdprConsent = {
|
|
@@ -252,7 +265,6 @@ describe('ConcertAdapter', function () {
|
|
|
252
265
|
const opts = {
|
|
253
266
|
iframeEnabled: true
|
|
254
267
|
};
|
|
255
|
-
const storage = getStorageManager();
|
|
256
268
|
storage.removeDataFromLocalStorage('c_nap');
|
|
257
269
|
|
|
258
270
|
bidRequest.gdprConsent = {
|
|
@@ -268,7 +280,6 @@ describe('ConcertAdapter', function () {
|
|
|
268
280
|
const opts = {
|
|
269
281
|
iframeEnabled: true
|
|
270
282
|
};
|
|
271
|
-
const storage = getStorageManager();
|
|
272
283
|
storage.removeDataFromLocalStorage('c_nap');
|
|
273
284
|
|
|
274
285
|
bidRequest.gdprConsent = {
|