prebid.js 7.5.0 → 7.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/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/adnuntiusBidAdapter.js +1 -1
- package/dist/adotBidAdapter.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adrinoBidAdapter.js +1 -1
- package/dist/adtelligentBidAdapter.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/atsAnalyticsAdapter.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/byDataAnalyticsAdapter.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/imRtdProvider.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/konduitAnalyticsAdapter.js +1 -1
- package/dist/kueezBidAdapter.js +1 -1
- package/dist/lassoBidAdapter.js +1 -1
- package/dist/liveyieldAnalyticsAdapter.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.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/minutemediaBidAdapter.js +1 -1
- package/dist/newspassidBidAdapter.js +1 -0
- package/dist/nextMillenniumBidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +115 -113
- 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/priceFloors.js +1 -1
- package/dist/publinkIdSystem.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/quantcastBidAdapter.js +1 -1
- package/dist/rasBidAdapter.js +1 -0
- 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/adgenerationBidAdapter.js +24 -1
- package/modules/adnuntiusBidAdapter.js +26 -8
- package/modules/adotBidAdapter.js +10 -1
- package/modules/adrinoBidAdapter.js +10 -2
- package/modules/adrinoBidAdapter.md +6 -0
- package/modules/adtelligentBidAdapter.js +2 -1
- package/modules/atsAnalyticsAdapter.js +4 -5
- package/modules/byDataAnalyticsAdapter.js +172 -74
- package/modules/byDataAnalyticsAdapter.md +5 -6
- package/modules/consumableBidAdapter.js +12 -1
- package/modules/eplanningBidAdapter.js +82 -97
- package/modules/gridNMBidAdapter.js +45 -4
- package/modules/imRtdProvider.js +0 -8
- package/modules/ixBidAdapter.js +5 -1
- package/modules/minutemediaBidAdapter.js +1 -0
- package/modules/newspassidBidAdapter.js +649 -0
- package/modules/nextMillenniumBidAdapter.js +17 -1
- package/modules/oguryBidAdapter.js +2 -0
- package/modules/priceFloors.js +1 -1
- package/modules/pubxaiAnalyticsAdapter.js +6 -1
- package/modules/rasBidAdapter.js +149 -0
- package/modules/rasBidAdapter.md +50 -0
- package/modules/seedtagBidAdapter.js +4 -0
- package/package.json +1 -1
- package/test/spec/modules/adgenerationBidAdapter_spec.js +52 -4
- package/test/spec/modules/adnuntiusBidAdapter_spec.js +126 -14
- package/test/spec/modules/adotBidAdapter_spec.js +12 -9
- package/test/spec/modules/adrinoBidAdapter_spec.js +22 -0
- package/test/spec/modules/byDataAnalyticsAdapter_spec.js +74 -24
- package/test/spec/modules/consumableBidAdapter_spec.js +75 -0
- package/test/spec/modules/eplanningBidAdapter_spec.js +58 -18
- package/test/spec/modules/gridNMBidAdapter_spec.js +32 -0
- package/test/spec/modules/imRtdProvider_spec.js +0 -1
- package/test/spec/modules/ixBidAdapter_spec.js +41 -0
- package/test/spec/modules/minutemediaBidAdapter_spec.js +3 -0
- package/test/spec/modules/newspassidBidAdapter_spec.js +1793 -0
- package/test/spec/modules/nextMillenniumBidAdapter_spec.js +20 -0
- package/test/spec/modules/pubxaiAnalyticsAdapter_spec.js +5 -0
- package/test/spec/modules/rasBidAdapter_spec.js +190 -0
- package/test/spec/modules/seedtagBidAdapter_spec.js +25 -0
|
@@ -6,6 +6,7 @@ import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
|
6
6
|
import { ajax } from '../src/ajax.js'
|
|
7
7
|
|
|
8
8
|
const BIDDER_CODE = 'ogury';
|
|
9
|
+
const GVLID = 31;
|
|
9
10
|
const DEFAULT_TIMEOUT = 1000;
|
|
10
11
|
const BID_HOST = 'https://mweb-hb.presage.io/api/header-bidding-request';
|
|
11
12
|
const TIMEOUT_MONITORING_HOST = 'https://ms-ads-monitoring-events.presage.io';
|
|
@@ -198,6 +199,7 @@ function onTimeout(timeoutData) {
|
|
|
198
199
|
|
|
199
200
|
export const spec = {
|
|
200
201
|
code: BIDDER_CODE,
|
|
202
|
+
gvlid: GVLID,
|
|
201
203
|
supportedMediaTypes: [BANNER],
|
|
202
204
|
isBidRequestValid,
|
|
203
205
|
getUserSyncs,
|
package/modules/priceFloors.js
CHANGED
|
@@ -751,7 +751,7 @@ export function addBidResponseHook(fn, adUnitCode, bid) {
|
|
|
751
751
|
flooredBid.status = CONSTANTS.BID_STATUS.BID_REJECTED;
|
|
752
752
|
// if floor not met update bid with 0 cpm so it is not included downstream and marked as no-bid
|
|
753
753
|
flooredBid.cpm = 0;
|
|
754
|
-
logWarn(`${MODULE_NAME}: ${flooredBid.bidderCode}'s Bid Response for ${adUnitCode} was rejected due to floor not met`, bid);
|
|
754
|
+
logWarn(`${MODULE_NAME}: ${flooredBid.bidderCode}'s Bid Response for ${adUnitCode} was rejected due to floor not met (adjusted cpm: ${bid?.floorData?.cpmAfterAdjustments}, floor: ${floorInfo?.matchingFloor})`, bid);
|
|
755
755
|
return fn.call(this, adUnitCode, flooredBid);
|
|
756
756
|
}
|
|
757
757
|
return fn.call(this, adUnitCode, bid);
|
|
@@ -91,7 +91,12 @@ function mapBidResponse(bidResponse, status) {
|
|
|
91
91
|
} else {
|
|
92
92
|
Object.assign(bid, {
|
|
93
93
|
bidId: bidResponse.requestId,
|
|
94
|
-
floorProvider: events.floorDetail
|
|
94
|
+
floorProvider: events.floorDetail?.floorProvider || null,
|
|
95
|
+
floorFetchStatus: events.floorDetail?.fetchStatus || null,
|
|
96
|
+
floorLocation: events.floorDetail?.location || null,
|
|
97
|
+
floorModelVersion: events.floorDetail?.modelVersion || null,
|
|
98
|
+
floorSkipRate: events.floorDetail?.skipRate || 0,
|
|
99
|
+
isFloorSkipped: events.floorDetail?.skipped || false,
|
|
95
100
|
isWinningBid: true,
|
|
96
101
|
placementId: bidResponse.params ? deepAccess(bidResponse, 'params.0.placementId') : null,
|
|
97
102
|
renderedSize: bidResponse.size,
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
2
|
+
import { BANNER } from '../src/mediaTypes.js';
|
|
3
|
+
import { isEmpty, getAdUnitSizes, parseSizesInput, deepAccess } from '../src/utils.js';
|
|
4
|
+
|
|
5
|
+
const BIDDER_CODE = 'ras';
|
|
6
|
+
const VERSION = '1.0';
|
|
7
|
+
|
|
8
|
+
const getEndpoint = (network) => `https://csr.onet.pl/${encodeURIComponent(network)}/csr-006/csr.json?`;
|
|
9
|
+
|
|
10
|
+
function parseParams(params, bidderRequest) {
|
|
11
|
+
const newParams = {};
|
|
12
|
+
const du = deepAccess(bidderRequest, 'refererInfo.page');
|
|
13
|
+
const dr = deepAccess(bidderRequest, 'refererInfo.ref');
|
|
14
|
+
|
|
15
|
+
if (du) {
|
|
16
|
+
newParams.du = du;
|
|
17
|
+
}
|
|
18
|
+
if (dr) {
|
|
19
|
+
newParams.dr = dr;
|
|
20
|
+
}
|
|
21
|
+
const pageContext = params.pageContext;
|
|
22
|
+
if (!pageContext) {
|
|
23
|
+
return newParams;
|
|
24
|
+
}
|
|
25
|
+
if (pageContext.du) {
|
|
26
|
+
newParams.du = pageContext.du;
|
|
27
|
+
}
|
|
28
|
+
if (pageContext.dr) {
|
|
29
|
+
newParams.dr = pageContext.dr;
|
|
30
|
+
}
|
|
31
|
+
if (pageContext.dv) {
|
|
32
|
+
newParams.DV = pageContext.dv;
|
|
33
|
+
}
|
|
34
|
+
if (pageContext.keyWords && Array.isArray(pageContext.keyWords)) {
|
|
35
|
+
newParams.kwrd = pageContext.keyWords.join('+');
|
|
36
|
+
}
|
|
37
|
+
if (pageContext.capping) {
|
|
38
|
+
newParams.local_capping = pageContext.capping;
|
|
39
|
+
}
|
|
40
|
+
if (pageContext.keyValues && typeof pageContext.keyValues === 'object') {
|
|
41
|
+
for (const param in pageContext.keyValues) {
|
|
42
|
+
if (pageContext.keyValues.hasOwnProperty(param)) {
|
|
43
|
+
const kvName = 'kv' + param;
|
|
44
|
+
newParams[kvName] = pageContext.keyValues[param];
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return newParams;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const buildBid = (ad) => {
|
|
52
|
+
if (ad.type === 'empty') {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
requestId: ad.id,
|
|
57
|
+
cpm: ad.bid_rate ? ad.bid_rate.toFixed(2) : 0,
|
|
58
|
+
width: ad.width || 0,
|
|
59
|
+
height: ad.height || 0,
|
|
60
|
+
ttl: 300,
|
|
61
|
+
creativeId: ad.adid ? parseInt(ad.adid.split(',')[2], 10) : 0,
|
|
62
|
+
netRevenue: true,
|
|
63
|
+
currency: ad.currency || 'USD',
|
|
64
|
+
dealId: null,
|
|
65
|
+
meta: {
|
|
66
|
+
mediaType: BANNER
|
|
67
|
+
},
|
|
68
|
+
ad: ad.html || null
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const getContextParams = (bidRequests, bidderRequest) => {
|
|
73
|
+
const bid = bidRequests[0];
|
|
74
|
+
const { params } = bid;
|
|
75
|
+
const requestParams = {
|
|
76
|
+
site: params.site,
|
|
77
|
+
area: params.area,
|
|
78
|
+
cre_format: 'html',
|
|
79
|
+
systems: 'das',
|
|
80
|
+
kvprver: VERSION,
|
|
81
|
+
ems_url: 1,
|
|
82
|
+
bid_rate: 1,
|
|
83
|
+
...parseParams(params, bidderRequest)
|
|
84
|
+
};
|
|
85
|
+
return Object.keys(requestParams).map((key) => encodeURIComponent(key) + '=' + encodeURIComponent(requestParams[key])).join('&');
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const getSlots = (bidRequests) => {
|
|
89
|
+
let queryString = '';
|
|
90
|
+
const batchSize = bidRequests.length;
|
|
91
|
+
for (let i = 0; i < batchSize; i++) {
|
|
92
|
+
const adunit = bidRequests[i];
|
|
93
|
+
const sizes = parseSizesInput(getAdUnitSizes(adunit)).join(',');
|
|
94
|
+
queryString += `&slot${i}=${encodeURIComponent(adunit.params.slot)}&id${i}=${encodeURIComponent(adunit.bidId)}&composition${i}=CHILD`;
|
|
95
|
+
if (sizes.length) {
|
|
96
|
+
queryString += `&iusizes${i}=${encodeURIComponent(sizes)}`;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return queryString;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
const getGdprParams = (bidderRequest) => {
|
|
103
|
+
const gdprApplies = deepAccess(bidderRequest, 'gdprConsent.gdprApplies');
|
|
104
|
+
let consentString = deepAccess(bidderRequest, 'gdprConsent.consentString');
|
|
105
|
+
let queryString = '';
|
|
106
|
+
if (gdprApplies !== undefined) {
|
|
107
|
+
queryString += `&gdpr_applies=${encodeURIComponent(gdprApplies)}`;
|
|
108
|
+
}
|
|
109
|
+
if (consentString !== undefined) {
|
|
110
|
+
queryString += `&euconsent=${encodeURIComponent(consentString)}`;
|
|
111
|
+
}
|
|
112
|
+
return queryString;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export const spec = {
|
|
116
|
+
code: BIDDER_CODE,
|
|
117
|
+
supportedMediaTypes: [BANNER],
|
|
118
|
+
|
|
119
|
+
isBidRequestValid: function (bidRequest) {
|
|
120
|
+
if (!bidRequest || !bidRequest.params || typeof bidRequest.params !== 'object') {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
const { params } = bidRequest;
|
|
124
|
+
return Boolean(params.network && params.site && params.area && params.slot);
|
|
125
|
+
},
|
|
126
|
+
|
|
127
|
+
buildRequests: function (bidRequests, bidderRequest) {
|
|
128
|
+
const slotsQuery = getSlots(bidRequests);
|
|
129
|
+
const contextQuery = getContextParams(bidRequests, bidderRequest);
|
|
130
|
+
const gdprQuery = getGdprParams(bidderRequest);
|
|
131
|
+
const bidIds = bidRequests.map((bid) => ({ slot: bid.params.slot, bidId: bid.bidId }));
|
|
132
|
+
const network = bidRequests[0].params.network;
|
|
133
|
+
return [{
|
|
134
|
+
method: 'GET',
|
|
135
|
+
url: getEndpoint(network) + contextQuery + slotsQuery + gdprQuery,
|
|
136
|
+
bidIds: bidIds
|
|
137
|
+
}];
|
|
138
|
+
},
|
|
139
|
+
|
|
140
|
+
interpretResponse: function (serverResponse, bidRequest) {
|
|
141
|
+
const response = serverResponse.body;
|
|
142
|
+
if (!response || !response.ads || response.ads.length === 0) {
|
|
143
|
+
return [];
|
|
144
|
+
}
|
|
145
|
+
return response.ads.map(buildBid).filter((bid) => !isEmpty(bid));
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
registerBidder(spec);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Overview
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
Module Name: Ringier Axel Springer Bidder Adapter
|
|
5
|
+
Module Type: Bidder Adapter
|
|
6
|
+
Maintainer: support@ringpublishing.com
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
# Description
|
|
10
|
+
|
|
11
|
+
Module that connects to Ringer Axel Springer demand sources.
|
|
12
|
+
Only banner format is supported.
|
|
13
|
+
|
|
14
|
+
# Test Parameters
|
|
15
|
+
```js
|
|
16
|
+
var adUnits = [{
|
|
17
|
+
code: 'test-div-ad',
|
|
18
|
+
mediaTypes: {
|
|
19
|
+
banner: {
|
|
20
|
+
sizes: [[300, 250], [300, 600]]
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
bids: [{
|
|
24
|
+
bidder: 'ras',
|
|
25
|
+
params: {
|
|
26
|
+
network: '4178463',
|
|
27
|
+
site: 'test',
|
|
28
|
+
area: 'areatest',
|
|
29
|
+
slot: 'slot'
|
|
30
|
+
}
|
|
31
|
+
}]
|
|
32
|
+
}];
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
# Parameters
|
|
36
|
+
|
|
37
|
+
| Name | Scope | Type | Description | Example
|
|
38
|
+
| --- | --- | --- | --- | ---
|
|
39
|
+
| network | required | String | Specific identifier provided by RAS | `"4178463"`
|
|
40
|
+
| site | required | String | Specific identifier name (case-insensitive) that is associated with this ad unit and provided by RAS | `"example_com"`
|
|
41
|
+
| area | required | String | Ad unit category name; only case-insensitive alphanumeric with underscores and hyphens are allowed | `"sport"`
|
|
42
|
+
| slot | required | String | Ad unit placement name (case-insensitive) provided by RAS | `"slot"`
|
|
43
|
+
| pageContext | optional | Object | Web page context data | `{}`
|
|
44
|
+
| pageContext.dr | optional | String | Document referrer URL address | `"https://example.com/"`
|
|
45
|
+
| pageContext.du | optional | String | Document URL address | `"https://example.com/sport/football/article.html?id=932016a5-02fc-4d5c-b643-fafc2f270f06"`
|
|
46
|
+
| pageContext.dv | optional | String | Document virtual address as slash-separated path that may consist of any number of parts (case-insensitive alphanumeric with underscores and hyphens); first part should be the same as `site` value and second as `area` value; next parts may reflect website navigation | `"example_com/sport/football"`
|
|
47
|
+
| pageContext.keyWords | optional | String[] | List of keywords associated with this ad unit; only case-insensitive alphanumeric with underscores and hyphens are allowed | `["euro", "lewandowski"]`
|
|
48
|
+
| pageContext.keyValues | optional | Object | Key-values associated with this ad unit (case-insensitive); following characters are not allowed in the values: `" ' = ! + # * ~ ; ^ ( ) < > [ ] & @` | `{}`
|
|
49
|
+
| pageContext.keyValues.ci | optional | String | Content unique identifier | `"932016a5-02fc-4d5c-b643-fafc2f270f06"`
|
|
50
|
+
| pageContext.keyValues.adunit | optional | String | Ad unit name | `"example_com/sport"`
|
|
@@ -236,6 +236,10 @@ export const spec = {
|
|
|
236
236
|
payload['cd'] = bidderRequest.gdprConsent.consentString;
|
|
237
237
|
}
|
|
238
238
|
|
|
239
|
+
if (bidderRequest.uspConsent) {
|
|
240
|
+
payload['uspConsent'] = bidderRequest.uspConsent
|
|
241
|
+
}
|
|
242
|
+
|
|
239
243
|
const payloadString = JSON.stringify(payload)
|
|
240
244
|
return {
|
|
241
245
|
method: 'POST',
|
package/package.json
CHANGED
|
@@ -101,6 +101,41 @@ describe('AdgenerationAdapter', function () {
|
|
|
101
101
|
snowflake: {'id': 'novatiqId', syncResponse: 1}
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
+
},
|
|
105
|
+
{ // bannerWithAdgextCriteoId
|
|
106
|
+
bidder: 'adg',
|
|
107
|
+
params: {
|
|
108
|
+
id: '58278', // banner
|
|
109
|
+
},
|
|
110
|
+
adUnitCode: 'adunit-code',
|
|
111
|
+
sizes: [[320, 100]],
|
|
112
|
+
bidId: '2f6ac468a9c15e',
|
|
113
|
+
bidderRequestId: '14a9f773e30243',
|
|
114
|
+
auctionId: '4aae9f05-18c6-4fcd-80cf-282708cd584a',
|
|
115
|
+
transactionTd: 'f76f6dfd-d64f-4645-a29f-682bac7f431a',
|
|
116
|
+
userId: {
|
|
117
|
+
criteoId: 'criteo-id-test-1234567890'
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
{ // bannerWithAdgextId5Id
|
|
121
|
+
bidder: 'adg',
|
|
122
|
+
params: {
|
|
123
|
+
id: '58278', // banner
|
|
124
|
+
},
|
|
125
|
+
adUnitCode: 'adunit-code',
|
|
126
|
+
sizes: [[320, 100]],
|
|
127
|
+
bidId: '2f6ac468a9c15e',
|
|
128
|
+
bidderRequestId: '14a9f773e30243',
|
|
129
|
+
auctionId: '4aae9f05-18c6-4fcd-80cf-282708cd584a',
|
|
130
|
+
transactionTd: 'f76f6dfd-d64f-4645-a29f-682bac7f431a',
|
|
131
|
+
userId: {
|
|
132
|
+
id5id: {
|
|
133
|
+
ext: {
|
|
134
|
+
linkType: 2
|
|
135
|
+
},
|
|
136
|
+
uid: 'id5-id-test-1234567890'
|
|
137
|
+
}
|
|
138
|
+
}
|
|
104
139
|
}
|
|
105
140
|
];
|
|
106
141
|
const bidderRequest = {
|
|
@@ -109,10 +144,12 @@ describe('AdgenerationAdapter', function () {
|
|
|
109
144
|
}
|
|
110
145
|
};
|
|
111
146
|
const data = {
|
|
112
|
-
banner: `posall=SSPLOC&id=58278&sdktype=0&hb=true&t=json3&sizes=300x250%2C320x100¤cy=JPY&pbver=${prebid.version}&sdkname=prebidjs&adapterver=1.
|
|
113
|
-
bannerUSD: `posall=SSPLOC&id=58278&sdktype=0&hb=true&t=json3&sizes=300x250%2C320x100¤cy=USD&pbver=${prebid.version}&sdkname=prebidjs&adapterver=1.
|
|
114
|
-
native: `posall=SSPLOC&id=58278&sdktype=0&hb=true&t=json3&sizes=1x1¤cy=JPY&pbver=${prebid.version}&sdkname=prebidjs&adapterver=1.
|
|
115
|
-
bannerWithHyperId: `posall=SSPLOC&id=58278&sdktype=0&hb=true&t=json3&sizes=320x100¤cy=JPY&pbver=${prebid.version}&sdkname=prebidjs&adapterver=1.
|
|
147
|
+
banner: `posall=SSPLOC&id=58278&sdktype=0&hb=true&t=json3&sizes=300x250%2C320x100¤cy=JPY&pbver=${prebid.version}&sdkname=prebidjs&adapterver=1.4.0&imark=1&tp=https%3A%2F%2Fexample.com`,
|
|
148
|
+
bannerUSD: `posall=SSPLOC&id=58278&sdktype=0&hb=true&t=json3&sizes=300x250%2C320x100¤cy=USD&pbver=${prebid.version}&sdkname=prebidjs&adapterver=1.4.0&imark=1&tp=https%3A%2F%2Fexample.com`,
|
|
149
|
+
native: `posall=SSPLOC&id=58278&sdktype=0&hb=true&t=json3&sizes=1x1¤cy=JPY&pbver=${prebid.version}&sdkname=prebidjs&adapterver=1.4.0&tp=https%3A%2F%2Fexample.com`,
|
|
150
|
+
bannerWithHyperId: `posall=SSPLOC&id=58278&sdktype=0&hb=true&t=json3&sizes=320x100¤cy=JPY&pbver=${prebid.version}&sdkname=prebidjs&adapterver=1.4.0&imark=1&tp=https%3A%2F%2Fexample.com&hyper_id=novatiqId`,
|
|
151
|
+
bannerWithAdgextCriteoId: `posall=SSPLOC&id=58278&sdktype=0&hb=true&t=json3&sizes=320x100¤cy=JPY&pbver=${prebid.version}&sdkname=prebidjs&adapterver=1.4.0&adgext_criteo_id=criteo-id-test-1234567890&imark=1&tp=https%3A%2F%2Fexample.com`,
|
|
152
|
+
bannerWithAdgextId5Id: `posall=SSPLOC&id=58278&sdktype=0&hb=true&t=json3&sizes=320x100¤cy=JPY&pbver=${prebid.version}&sdkname=prebidjs&adapterver=1.4.0&adgext_id5_id=id5-id-test-1234567890&adgext_id5_id_link_type=2&imark=1&tp=https%3A%2F%2Fexample.com`,
|
|
116
153
|
};
|
|
117
154
|
it('sends bid request to ENDPOINT via GET', function () {
|
|
118
155
|
const request = spec.buildRequests(bidRequests, bidderRequest)[0];
|
|
@@ -149,6 +186,17 @@ describe('AdgenerationAdapter', function () {
|
|
|
149
186
|
});
|
|
150
187
|
expect(request.data).to.equal(data.bannerWithHyperId);
|
|
151
188
|
});
|
|
189
|
+
|
|
190
|
+
it('should attache params to the bannerWithAdgextCriteoId request', function () {
|
|
191
|
+
const request = spec.buildRequests(bidRequests, bidderRequest)[3];
|
|
192
|
+
expect(request.data).to.equal(data.bannerWithAdgextCriteoId);
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
it('should attache params to the bannerWithAdgextId5Id request', function () {
|
|
196
|
+
const request = spec.buildRequests(bidRequests, bidderRequest)[4];
|
|
197
|
+
expect(request.data).to.equal(data.bannerWithAdgextId5Id);
|
|
198
|
+
});
|
|
199
|
+
|
|
152
200
|
it('allows setConfig to set bidder currency for JPY', function () {
|
|
153
201
|
config.setConfig({
|
|
154
202
|
currency: {
|
|
@@ -11,7 +11,7 @@ describe('adnuntiusBidAdapter', function () {
|
|
|
11
11
|
const GVLID = 855;
|
|
12
12
|
const usi = utils.generateUUID()
|
|
13
13
|
const meta = [{ key: 'usi', value: usi }]
|
|
14
|
-
const storage = getStorageManager({gvlid: GVLID, moduleName: 'adnuntius'})
|
|
14
|
+
const storage = getStorageManager({ gvlid: GVLID, moduleName: 'adnuntius' })
|
|
15
15
|
storage.setDataInLocalStorage('adn.metaData', JSON.stringify(meta))
|
|
16
16
|
|
|
17
17
|
beforeEach(function () {
|
|
@@ -29,12 +29,13 @@ describe('adnuntiusBidAdapter', function () {
|
|
|
29
29
|
|
|
30
30
|
const tzo = new Date().getTimezoneOffset();
|
|
31
31
|
const ENDPOINT_URL = `${URL}${tzo}&format=json&userId=${usi}`;
|
|
32
|
+
const ENDPOINT_URL_VIDEO = `${URL}${tzo}&format=json&userId=${usi}&tt=vast4`;
|
|
32
33
|
const ENDPOINT_URL_NOCOOKIE = `${URL}${tzo}&format=json&userId=${usi}&noCookies=true`;
|
|
33
34
|
const ENDPOINT_URL_SEGMENTS = `${URL}${tzo}&format=json&segments=segment1,segment2,segment3&userId=${usi}`;
|
|
34
35
|
const ENDPOINT_URL_CONSENT = `${URL}${tzo}&format=json&consentString=consentString&userId=${usi}`;
|
|
35
36
|
const adapter = newBidder(spec);
|
|
36
37
|
|
|
37
|
-
const
|
|
38
|
+
const bidderRequests = [
|
|
38
39
|
{
|
|
39
40
|
bidId: '123',
|
|
40
41
|
bidder: 'adnuntius',
|
|
@@ -46,6 +47,23 @@ describe('adnuntiusBidAdapter', function () {
|
|
|
46
47
|
}
|
|
47
48
|
]
|
|
48
49
|
|
|
50
|
+
const videoBidderRequest = [
|
|
51
|
+
{
|
|
52
|
+
bidId: '123',
|
|
53
|
+
bidder: 'adnuntius',
|
|
54
|
+
params: {
|
|
55
|
+
auId: '8b6bc',
|
|
56
|
+
network: 'adnuntius',
|
|
57
|
+
},
|
|
58
|
+
mediaTypes: {
|
|
59
|
+
video: {
|
|
60
|
+
playerSize: [640, 480],
|
|
61
|
+
context: 'instream'
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
|
|
49
67
|
const singleBidRequest = {
|
|
50
68
|
bid: [
|
|
51
69
|
{
|
|
@@ -54,6 +72,10 @@ describe('adnuntiusBidAdapter', function () {
|
|
|
54
72
|
]
|
|
55
73
|
}
|
|
56
74
|
|
|
75
|
+
const videoBidRequest = {
|
|
76
|
+
bid: videoBidderRequest
|
|
77
|
+
}
|
|
78
|
+
|
|
57
79
|
const serverResponse = {
|
|
58
80
|
body: {
|
|
59
81
|
'adUnits': [
|
|
@@ -117,6 +139,69 @@ describe('adnuntiusBidAdapter', function () {
|
|
|
117
139
|
]
|
|
118
140
|
}
|
|
119
141
|
}
|
|
142
|
+
const serverVideoResponse = {
|
|
143
|
+
body: {
|
|
144
|
+
'adUnits': [
|
|
145
|
+
{
|
|
146
|
+
'auId': '000000000008b6bc',
|
|
147
|
+
'targetId': '123',
|
|
148
|
+
'html': '<h1>hi!</h1>',
|
|
149
|
+
'matchedAdCount': 1,
|
|
150
|
+
'responseId': 'adn-rsp-1460129238',
|
|
151
|
+
'ads': [
|
|
152
|
+
{
|
|
153
|
+
'destinationUrlEsc': 'https%3A%2F%2Fdelivery.adnuntius.com%2Fc%2F52AHNuxCqxB_Y9ZP9ERWkMBPCOha4zuV3aKn5cog5jsAAAAQCtjQz9kbGWD4nuZy3q6HaHGLB4-k_fySWECIOOmHKY6iokgHNFH-U57ew_-1QHlKnFr2NT8y4QK1oU5HxnDLbYPz-GmQ3C2JyxLGpKmIb-P-3bm7HYPEreNjPdhjRG51A8NGuc4huUhns7nEUejHuOjOHE5sV1zfYxCRWRx9wPDN9EUCC7KN%3Fct%3D2501%26r%3Dhttp%253A%252F%252Fgoogle.com',
|
|
154
|
+
'assets': {
|
|
155
|
+
'image': {
|
|
156
|
+
'cdnId': 'https://assets.adnuntius.com/oEmZa5uYjxENfA1R692FVn6qIveFpO8wUbpyF2xSOCc.jpg',
|
|
157
|
+
'width': '980',
|
|
158
|
+
'height': '120'
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
'clickUrl': 'https://delivery.adnuntius.com/c/52AHNuxCqxB_Y9ZP9ERWkMBPCOha4zuV3aKn5cog5jsAAAAQCtjQz9kbGWD4nuZy3q6HaHGLB4-k_fySWECIOOmHKY6iokgHNFH-U57ew_-1QHlKnFr2NT8y4QK1oU5HxnDLbYPz-GmQ3C2JyxLGpKmIb-P-3bm7HYPEreNjPdhjRG51A8NGuc4huUhns7nEUejHuOjOHE5sV1zfYxCRWRx9wPDN9EUCC7KN',
|
|
162
|
+
'urls': {
|
|
163
|
+
'destination': 'https://delivery.adnuntius.com/c/52AHNuxCqxB_Y9ZP9ERWkMBPCOha4zuV3aKn5cog5jsAAAAQCtjQz9kbGWD4nuZy3q6HaHGLB4-k_fySWECIOOmHKY6iokgHNFH-U57ew_-1QHlKnFr2NT8y4QK1oU5HxnDLbYPz-GmQ3C2JyxLGpKmIb-P-3bm7HYPEreNjPdhjRG51A8NGuc4huUhns7nEUejHuOjOHE5sV1zfYxCRWRx9wPDN9EUCC7KN?ct=2501&r=http%3A%2F%2Fgoogle.com'
|
|
164
|
+
},
|
|
165
|
+
'urlsEsc': {
|
|
166
|
+
'destination': 'https%3A%2F%2Fdelivery.adnuntius.com%2Fc%2F52AHNuxCqxB_Y9ZP9ERWkMBPCOha4zuV3aKn5cog5jsAAAAQCtjQz9kbGWD4nuZy3q6HaHGLB4-k_fySWECIOOmHKY6iokgHNFH-U57ew_-1QHlKnFr2NT8y4QK1oU5HxnDLbYPz-GmQ3C2JyxLGpKmIb-P-3bm7HYPEreNjPdhjRG51A8NGuc4huUhns7nEUejHuOjOHE5sV1zfYxCRWRx9wPDN9EUCC7KN%3Fct%3D2501%26r%3Dhttp%253A%252F%252Fgoogle.com'
|
|
167
|
+
},
|
|
168
|
+
'destinationUrls': {
|
|
169
|
+
'destination': 'http://google.com'
|
|
170
|
+
},
|
|
171
|
+
'cpm': { 'amount': 5.0, 'currency': 'NOK' },
|
|
172
|
+
'bid': { 'amount': 0.005, 'currency': 'NOK' },
|
|
173
|
+
'cost': { 'amount': 0.005, 'currency': 'NOK' },
|
|
174
|
+
'impressionTrackingUrls': [],
|
|
175
|
+
'impressionTrackingUrlsEsc': [],
|
|
176
|
+
'adId': 'adn-id-1347343135',
|
|
177
|
+
'selectedColumn': '0',
|
|
178
|
+
'selectedColumnPosition': '0',
|
|
179
|
+
'renderedPixel': 'https://delivery.adnuntius.com/b/52AHNuxCqxB_Y9ZP9ERWkMBPCOha4zuV3aKn5cog5jsAAAAQCtjQz9kbGWD4nuZy3q6HaHGLB4-k_fySWECIOOmHKY6iokgHNFH-U57ew_-1QHlKnFr2NT8y4QK1oU5HxnDLbYPz-GmQ3C2JyxLGpKmIb-P-3bm7HYPEreNjPdhjRG51A8NGuc4huUhns7nEUejHuOjOHE5sV1zfYxCRWRx9wPDN9EUCC7KN.html',
|
|
180
|
+
'renderedPixelEsc': 'https%3A%2F%2Fdelivery.adnuntius.com%2Fb%2F52AHNuxCqxB_Y9ZP9ERWkMBPCOha4zuV3aKn5cog5jsAAAAQCtjQz9kbGWD4nuZy3q6HaHGLB4-k_fySWECIOOmHKY6iokgHNFH-U57ew_-1QHlKnFr2NT8y4QK1oU5HxnDLbYPz-GmQ3C2JyxLGpKmIb-P-3bm7HYPEreNjPdhjRG51A8NGuc4huUhns7nEUejHuOjOHE5sV1zfYxCRWRx9wPDN9EUCC7KN.html',
|
|
181
|
+
'visibleUrl': 'https://delivery.adnuntius.com/s?rt=52AHNuxCqxB_Y9ZP9ERWkMBPCOha4zuV3aKn5cog5jsAAAAQCtjQz9kbGWD4nuZy3q6HaHGLB4-k_fySWECIOOmHKY6iokgHNFH-U57ew_-1QHlKnFr2NT8y4QK1oU5HxnDLbYPz-GmQ3C2JyxLGpKmIb-P-3bm7HYPEreNjPdhjRG51A8NGuc4huUhns7nEUejHuOjOHE5sV1zfYxCRWRx9wPDN9EUCC7KN',
|
|
182
|
+
'visibleUrlEsc': 'https%3A%2F%2Fdelivery.adnuntius.com%2Fs%3Frt%3D52AHNuxCqxB_Y9ZP9ERWkMBPCOha4zuV3aKn5cog5jsAAAAQCtjQz9kbGWD4nuZy3q6HaHGLB4-k_fySWECIOOmHKY6iokgHNFH-U57ew_-1QHlKnFr2NT8y4QK1oU5HxnDLbYPz-GmQ3C2JyxLGpKmIb-P-3bm7HYPEreNjPdhjRG51A8NGuc4huUhns7nEUejHuOjOHE5sV1zfYxCRWRx9wPDN9EUCC7KN',
|
|
183
|
+
'viewUrl': 'https://delivery.adnuntius.com/v?rt=52AHNuxCqxB_Y9ZP9ERWkMBPCOha4zuV3aKn5cog5jsAAAAQCtjQz9kbGWD4nuZy3q6HaHGLB4-k_fySWECIOOmHKY6iokgHNFH-U57ew_-1QHlKnFr2NT8y4QK1oU5HxnDLbYPz-GmQ3C2JyxLGpKmIb-P-3bm7HYPEreNjPdhjRG51A8NGuc4huUhns7nEUejHuOjOHE5sV1zfYxCRWRx9wPDN9EUCC7KN',
|
|
184
|
+
'viewUrlEsc': 'https%3A%2F%2Fdelivery.adnuntius.com%2Fv%3Frt%3D52AHNuxCqxB_Y9ZP9ERWkMBPCOha4zuV3aKn5cog5jsAAAAQCtjQz9kbGWD4nuZy3q6HaHGLB4-k_fySWECIOOmHKY6iokgHNFH-U57ew_-1QHlKnFr2NT8y4QK1oU5HxnDLbYPz-GmQ3C2JyxLGpKmIb-P-3bm7HYPEreNjPdhjRG51A8NGuc4huUhns7nEUejHuOjOHE5sV1zfYxCRWRx9wPDN9EUCC7KN',
|
|
185
|
+
'rt': '52AHNuxCqxB_Y9ZP9ERWkMBPCOha4zuV3aKn5cog5jsAAAAQCtjQz9kbGWD4nuZy3q6HaHGLB4-k_fySWECIOOmHKY6iokgHNFH-U57ew_-1QHlKnFr2NT8y4QK1oU5HxnDLbYPz-GmQ3C2JyxLGpKmIb-P-3bm7HYPEreNjPdhjRG51A8NGuc4huUhns7nEUejHuOjOHE5sV1zfYxCRWRx9wPDN9EUCC7KN',
|
|
186
|
+
'creativeWidth': '980',
|
|
187
|
+
'creativeHeight': '120',
|
|
188
|
+
'creativeId': 'wgkq587vgtpchsx1',
|
|
189
|
+
'lineItemId': 'scyjdyv3mzgdsnpf',
|
|
190
|
+
'layoutId': 'sw6gtws2rdj1kwby',
|
|
191
|
+
'layoutName': 'Responsive image'
|
|
192
|
+
},
|
|
193
|
+
|
|
194
|
+
]
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
'auId': '000000000008b6bc',
|
|
198
|
+
'targetId': '456',
|
|
199
|
+
'matchedAdCount': 0,
|
|
200
|
+
'responseId': 'adn-rsp-1460129238',
|
|
201
|
+
}
|
|
202
|
+
]
|
|
203
|
+
}
|
|
204
|
+
}
|
|
120
205
|
|
|
121
206
|
describe('inherited functions', function () {
|
|
122
207
|
it('exists and is a function', function () {
|
|
@@ -126,13 +211,13 @@ describe('adnuntiusBidAdapter', function () {
|
|
|
126
211
|
|
|
127
212
|
describe('isBidRequestValid', function () {
|
|
128
213
|
it('should return true when required params found', function () {
|
|
129
|
-
expect(spec.isBidRequestValid(
|
|
214
|
+
expect(spec.isBidRequestValid(bidderRequests[0])).to.equal(true);
|
|
130
215
|
});
|
|
131
216
|
});
|
|
132
217
|
|
|
133
218
|
describe('buildRequests', function () {
|
|
134
219
|
it('Test requests', function () {
|
|
135
|
-
const request = spec.buildRequests(
|
|
220
|
+
const request = spec.buildRequests(bidderRequests, {});
|
|
136
221
|
expect(request.length).to.equal(1);
|
|
137
222
|
expect(request[0]).to.have.property('bid');
|
|
138
223
|
const bid = request[0].bid[0]
|
|
@@ -143,6 +228,16 @@ describe('adnuntiusBidAdapter', function () {
|
|
|
143
228
|
expect(request[0].data).to.equal('{\"adUnits\":[{\"auId\":\"8b6bc\",\"targetId\":\"123\"}],\"metaData\":{\"usi\":\"' + usi + '\"}}');
|
|
144
229
|
});
|
|
145
230
|
|
|
231
|
+
it('Test Video requests', function () {
|
|
232
|
+
const request = spec.buildRequests(videoBidderRequest, {});
|
|
233
|
+
expect(request.length).to.equal(1);
|
|
234
|
+
expect(request[0]).to.have.property('bid');
|
|
235
|
+
const bid = request[0].bid[0]
|
|
236
|
+
expect(bid).to.have.property('bidId');
|
|
237
|
+
expect(request[0]).to.have.property('url');
|
|
238
|
+
expect(request[0].url).to.equal(ENDPOINT_URL_VIDEO);
|
|
239
|
+
});
|
|
240
|
+
|
|
146
241
|
it('should pass segments if available in config', function () {
|
|
147
242
|
const ortb2 = {
|
|
148
243
|
user: {
|
|
@@ -157,7 +252,7 @@ describe('adnuntiusBidAdapter', function () {
|
|
|
157
252
|
}
|
|
158
253
|
};
|
|
159
254
|
|
|
160
|
-
const request = config.runWithBidder('adnuntius', () => spec.buildRequests(
|
|
255
|
+
const request = config.runWithBidder('adnuntius', () => spec.buildRequests(bidderRequests, { ortb2 }));
|
|
161
256
|
expect(request.length).to.equal(1);
|
|
162
257
|
expect(request[0]).to.have.property('url')
|
|
163
258
|
expect(request[0].url).to.equal(ENDPOINT_URL_SEGMENTS);
|
|
@@ -179,7 +274,7 @@ describe('adnuntiusBidAdapter', function () {
|
|
|
179
274
|
}
|
|
180
275
|
};
|
|
181
276
|
|
|
182
|
-
const request = config.runWithBidder('adnuntius', () => spec.buildRequests(
|
|
277
|
+
const request = config.runWithBidder('adnuntius', () => spec.buildRequests(bidderRequests, { ortb2 }));
|
|
183
278
|
expect(request.length).to.equal(1);
|
|
184
279
|
expect(request[0]).to.have.property('url')
|
|
185
280
|
expect(request[0].url).to.equal(ENDPOINT_URL_SEGMENTS);
|
|
@@ -188,14 +283,14 @@ describe('adnuntiusBidAdapter', function () {
|
|
|
188
283
|
|
|
189
284
|
describe('user privacy', function () {
|
|
190
285
|
it('should send GDPR Consent data if gdprApplies', function () {
|
|
191
|
-
let request = spec.buildRequests(
|
|
286
|
+
let request = spec.buildRequests(bidderRequests, { gdprConsent: { gdprApplies: true, consentString: 'consentString' } });
|
|
192
287
|
expect(request.length).to.equal(1);
|
|
193
288
|
expect(request[0]).to.have.property('url')
|
|
194
289
|
expect(request[0].url).to.equal(ENDPOINT_URL_CONSENT);
|
|
195
290
|
});
|
|
196
291
|
|
|
197
292
|
it('should not send GDPR Consent data if gdprApplies equals undefined', function () {
|
|
198
|
-
let request = spec.buildRequests(
|
|
293
|
+
let request = spec.buildRequests(bidderRequests, { gdprConsent: { gdprApplies: undefined, consentString: 'consentString' } });
|
|
199
294
|
expect(request.length).to.equal(1);
|
|
200
295
|
expect(request[0]).to.have.property('url')
|
|
201
296
|
expect(request[0].url).to.equal(ENDPOINT_URL);
|
|
@@ -215,7 +310,7 @@ describe('adnuntiusBidAdapter', function () {
|
|
|
215
310
|
}
|
|
216
311
|
}
|
|
217
312
|
|
|
218
|
-
const request = config.runWithBidder('adnuntius', () => spec.buildRequests(
|
|
313
|
+
const request = config.runWithBidder('adnuntius', () => spec.buildRequests(bidderRequests, { ortb2 }));
|
|
219
314
|
expect(request.length).to.equal(1);
|
|
220
315
|
expect(request[0]).to.have.property('url')
|
|
221
316
|
expect(request[0].url).to.equal(ENDPOINT_URL_SEGMENTS);
|
|
@@ -237,7 +332,7 @@ describe('adnuntiusBidAdapter', function () {
|
|
|
237
332
|
}
|
|
238
333
|
};
|
|
239
334
|
|
|
240
|
-
const request = config.runWithBidder('adnuntius', () => spec.buildRequests(
|
|
335
|
+
const request = config.runWithBidder('adnuntius', () => spec.buildRequests(bidderRequests, { ortb2 }));
|
|
241
336
|
expect(request.length).to.equal(1);
|
|
242
337
|
expect(request[0]).to.have.property('url')
|
|
243
338
|
expect(request[0].url).to.equal(ENDPOINT_URL_SEGMENTS);
|
|
@@ -250,7 +345,7 @@ describe('adnuntiusBidAdapter', function () {
|
|
|
250
345
|
}
|
|
251
346
|
};
|
|
252
347
|
|
|
253
|
-
const request = config.runWithBidder('adnuntius', () => spec.buildRequests(
|
|
348
|
+
const request = config.runWithBidder('adnuntius', () => spec.buildRequests(bidderRequests, { ortb2 }));
|
|
254
349
|
expect(request.length).to.equal(1);
|
|
255
350
|
expect(request[0]).to.have.property('url')
|
|
256
351
|
expect(request[0].url).to.equal(ENDPOINT_URL);
|
|
@@ -259,14 +354,14 @@ describe('adnuntiusBidAdapter', function () {
|
|
|
259
354
|
|
|
260
355
|
describe('user privacy', function () {
|
|
261
356
|
it('should send GDPR Consent data if gdprApplies', function () {
|
|
262
|
-
let request = spec.buildRequests(
|
|
357
|
+
let request = spec.buildRequests(bidderRequests, { gdprConsent: { gdprApplies: true, consentString: 'consentString' } });
|
|
263
358
|
expect(request.length).to.equal(1);
|
|
264
359
|
expect(request[0]).to.have.property('url')
|
|
265
360
|
expect(request[0].url).to.equal(ENDPOINT_URL_CONSENT);
|
|
266
361
|
});
|
|
267
362
|
|
|
268
363
|
it('should not send GDPR Consent data if gdprApplies equals undefined', function () {
|
|
269
|
-
let request = spec.buildRequests(
|
|
364
|
+
let request = spec.buildRequests(bidderRequests, { gdprConsent: { gdprApplies: undefined, consentString: 'consentString' } });
|
|
270
365
|
expect(request.length).to.equal(1);
|
|
271
366
|
expect(request[0]).to.have.property('url')
|
|
272
367
|
expect(request[0].url).to.equal(ENDPOINT_URL);
|
|
@@ -282,7 +377,7 @@ describe('adnuntiusBidAdapter', function () {
|
|
|
282
377
|
}
|
|
283
378
|
});
|
|
284
379
|
|
|
285
|
-
const request = config.runWithBidder('adnuntius', () => spec.buildRequests(
|
|
380
|
+
const request = config.runWithBidder('adnuntius', () => spec.buildRequests(bidderRequests, {}));
|
|
286
381
|
expect(request.length).to.equal(1);
|
|
287
382
|
expect(request[0]).to.have.property('url')
|
|
288
383
|
expect(request[0].url).to.equal(ENDPOINT_URL_NOCOOKIE);
|
|
@@ -307,4 +402,21 @@ describe('adnuntiusBidAdapter', function () {
|
|
|
307
402
|
expect(interpretedResponse[0].ttl).to.equal(360);
|
|
308
403
|
});
|
|
309
404
|
});
|
|
405
|
+
describe('interpretVideoResponse', function () {
|
|
406
|
+
it('should return valid response when passed valid server response', function () {
|
|
407
|
+
const interpretedResponse = spec.interpretResponse(serverVideoResponse, videoBidRequest);
|
|
408
|
+
const ad = serverVideoResponse.body.adUnits[0].ads[0]
|
|
409
|
+
expect(interpretedResponse).to.have.lengthOf(1);
|
|
410
|
+
expect(interpretedResponse[0].cpm).to.equal(ad.cpm.amount);
|
|
411
|
+
expect(interpretedResponse[0].width).to.equal(Number(ad.creativeWidth));
|
|
412
|
+
expect(interpretedResponse[0].height).to.equal(Number(ad.creativeHeight));
|
|
413
|
+
expect(interpretedResponse[0].creativeId).to.equal(ad.creativeId);
|
|
414
|
+
expect(interpretedResponse[0].currency).to.equal(ad.bid.currency);
|
|
415
|
+
expect(interpretedResponse[0].netRevenue).to.equal(false);
|
|
416
|
+
expect(interpretedResponse[0].meta).to.have.property('advertiserDomains');
|
|
417
|
+
expect(interpretedResponse[0].meta.advertiserDomains).to.have.lengthOf(1);
|
|
418
|
+
expect(interpretedResponse[0].meta.advertiserDomains[0]).to.equal('google.com');
|
|
419
|
+
expect(interpretedResponse[0].vastXml).to.equal(serverVideoResponse.body.adUnits[0].vastXml);
|
|
420
|
+
});
|
|
421
|
+
});
|
|
310
422
|
});
|