prebid.js 7.40.0 → 7.41.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/33acrossIdSystem.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/aduptechBidAdapter.js +1 -1
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/adyoulikeBidAdapter.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/browsiBidAdapter.js +1 -0
- package/dist/carodaBidAdapter.js +1 -1
- package/dist/chtnwBidAdapter.js +1 -1
- package/dist/cleanmedianetBidAdapter.js +1 -1
- package/dist/concertBidAdapter.js +1 -1
- package/dist/connectadBidAdapter.js +1 -1
- package/dist/consumableBidAdapter.js +1 -1
- package/dist/conversantAnalyticsAdapter.js +1 -1
- package/dist/conversantBidAdapter.js +1 -1
- package/dist/craftBidAdapter.js +1 -1
- package/dist/criteoBidAdapter.js +1 -1
- package/dist/cwireBidAdapter.js +1 -1
- package/dist/dfpAdServerVideo.js +1 -1
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/feedadBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/freewheel-sspBidAdapter.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/minutemediaBidAdapter.js +1 -1
- package/dist/minutemediaplusBidAdapter.js +1 -1
- package/dist/missenaBidAdapter.js +1 -1
- package/dist/nexx360BidAdapter.js +1 -1
- package/dist/nobidBidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +130 -129
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/optidigitalBidAdapter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/parrableIdSystem.js +1 -1
- package/dist/permutiveRtdProvider.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/pubwiseBidAdapter.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/stvBidAdapter.js +1 -0
- 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/uid2IdSystem.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/yandexBidAdapter.js +1 -1
- package/dist/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/integrationExamples/gpt/x-domain/creative.html +1 -1
- package/modules/aduptechBidAdapter.js +43 -37
- package/modules/browsiBidAdapter.js +171 -0
- package/modules/browsiBidAdapter.md +38 -0
- package/modules/cleanmedianetBidAdapter.js +191 -126
- package/modules/cleanmedianetBidAdapter.md +64 -18
- package/modules/conversantBidAdapter.js +4 -0
- package/modules/dfpAdServerVideo.js +8 -8
- package/modules/freewheel-sspBidAdapter.js +9 -0
- package/modules/gridBidAdapter.js +12 -1
- package/modules/ixBidAdapter.js +1 -1
- package/modules/missenaBidAdapter.js +2 -1
- package/modules/neuwoRtdProvider.js +1 -1
- package/modules/nobidBidAdapter.js +13 -2
- package/modules/nobidBidAdapter.md +2 -2
- package/modules/permutiveRtdProvider.js +8 -2
- package/modules/pubwiseBidAdapter.js +265 -33
- package/modules/stvBidAdapter.js +330 -0
- package/modules/stvBidAdapter.md +62 -0
- package/modules/yandexBidAdapter.js +259 -71
- package/modules/yandexBidAdapter.md +52 -15
- package/package.json +1 -1
- package/src/videoCache.js +4 -4
- package/test/spec/modules/browsiBidAdapter_spec.js +209 -0
- package/test/spec/modules/cleanmedianetBidAdapter_spec.js +462 -407
- package/test/spec/modules/conversantBidAdapter_spec.js +8 -0
- package/test/spec/modules/dfpAdServerVideo_spec.js +36 -4
- package/test/spec/modules/freewheel-sspBidAdapter_spec.js +19 -0
- package/test/spec/modules/gridBidAdapter_spec.js +24 -0
- package/test/spec/modules/ixBidAdapter_spec.js +4 -4
- package/test/spec/modules/nobidBidAdapter_spec.js +32 -0
- package/test/spec/modules/permutiveRtdProvider_spec.js +61 -4
- package/test/spec/modules/pubwiseBidAdapter_spec.js +313 -3
- package/test/spec/modules/stvBidAdapter_spec.js +402 -0
- package/test/spec/modules/yandexBidAdapter_spec.js +315 -45
- package/test/spec/videoCache_spec.js +23 -0
- package/dist/flocIdSystem.js +0 -1
- package/modules/flocIdSystem.js +0 -0
|
@@ -2,96 +2,295 @@ import {expect} from 'chai';
|
|
|
2
2
|
import {spec, helper} from 'modules/cleanmedianetBidAdapter.js';
|
|
3
3
|
import * as utils from 'src/utils.js';
|
|
4
4
|
import {newBidder} from '../../../src/adapters/bidderFactory.js';
|
|
5
|
+
import {deepClone} from 'src/utils';
|
|
5
6
|
|
|
6
7
|
const supplyPartnerId = '123';
|
|
7
8
|
const adapter = newBidder(spec);
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
const TTL = 360;
|
|
10
|
+
|
|
11
|
+
describe('CleanmedianetAdapter', () => {
|
|
12
|
+
let schainConfig,
|
|
13
|
+
bidRequest,
|
|
14
|
+
bannerBidRequest,
|
|
15
|
+
videoBidRequest,
|
|
16
|
+
rtbResponse,
|
|
17
|
+
videoResponse,
|
|
18
|
+
gdprConsent;
|
|
19
|
+
|
|
20
|
+
beforeEach(() => {
|
|
21
|
+
schainConfig = {
|
|
22
|
+
'ver': '1.0',
|
|
23
|
+
'complete': 1,
|
|
24
|
+
'nodes': [
|
|
25
|
+
{
|
|
26
|
+
'asi': 'indirectseller.com',
|
|
27
|
+
'sid': '00001',
|
|
28
|
+
'hp': 1
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
{
|
|
32
|
+
'asi': 'indirectseller-2.com',
|
|
33
|
+
'sid': '00002',
|
|
34
|
+
'hp': 2
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
bidRequest = {
|
|
40
|
+
'adUnitCode': 'adunit-code',
|
|
41
|
+
'auctionId': '1d1a030790a475',
|
|
42
|
+
'mediaTypes': {
|
|
43
|
+
banner: {}
|
|
44
|
+
},
|
|
45
|
+
'params': {
|
|
46
|
+
'supplyPartnerId': supplyPartnerId
|
|
47
|
+
},
|
|
48
|
+
'sizes': [[300, 250], [300, 600]],
|
|
49
|
+
'transactionId': 'a123456789',
|
|
50
|
+
refererInfo: {referer: 'http://examplereferer.com'},
|
|
51
|
+
gdprConsent: {
|
|
52
|
+
consentString: 'some string',
|
|
53
|
+
gdprApplies: true
|
|
54
|
+
},
|
|
55
|
+
schain: schainConfig,
|
|
56
|
+
uspConsent: 'cleanmediaCCPA'
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
bannerBidRequest = {
|
|
60
|
+
'adUnitCode': 'adunit-code',
|
|
61
|
+
'auctionId': '1d1a030790a475',
|
|
62
|
+
'mediaTypes': {
|
|
63
|
+
banner: {}
|
|
64
|
+
},
|
|
65
|
+
'params': {
|
|
66
|
+
'supplyPartnerId': supplyPartnerId
|
|
67
|
+
},
|
|
68
|
+
'sizes': [[300, 250], [300, 600]],
|
|
69
|
+
'transactionId': 'a123456789',
|
|
70
|
+
'bidId': '111',
|
|
71
|
+
refererInfo: {referer: 'http://examplereferer.com'}
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
videoBidRequest = {
|
|
75
|
+
'adUnitCode': 'adunit-code',
|
|
76
|
+
'auctionId': '1d1a030790a475',
|
|
77
|
+
'mediaTypes': {
|
|
78
|
+
video: {}
|
|
79
|
+
},
|
|
80
|
+
'params': {
|
|
81
|
+
'supplyPartnerId': supplyPartnerId
|
|
82
|
+
},
|
|
83
|
+
'sizes': [[300, 250], [300, 600]],
|
|
84
|
+
'transactionId': 'a123456789',
|
|
85
|
+
'bidId': '111',
|
|
86
|
+
refererInfo: {referer: 'http://examplereferer.com'}
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
rtbResponse = {
|
|
90
|
+
'id': 'imp_5b05b9fde4b09084267a556f',
|
|
91
|
+
'bidid': 'imp_5b05b9fde4b09084267a556f',
|
|
92
|
+
'cur': 'USD',
|
|
93
|
+
'ext': {
|
|
94
|
+
'utrk': [
|
|
95
|
+
{'type': 'iframe', 'url': '//bidder.cleanmediaads.com/user/sync/1?gdpr=[GDPR]&consent=[CONSENT]&usp=[US_PRIVACY]'},
|
|
96
|
+
{'type': 'image', 'url': '//bidder.cleanmediaads.com/user/sync/2'}
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
'seatbid': [
|
|
100
|
+
{
|
|
101
|
+
'seat': 'seat1',
|
|
102
|
+
'group': 0,
|
|
103
|
+
'bid': [
|
|
104
|
+
{
|
|
105
|
+
'id': '0',
|
|
106
|
+
'impid': '1',
|
|
107
|
+
'price': 2.016,
|
|
108
|
+
'adid': '579ef31bfa788b9d2000d562',
|
|
109
|
+
'nurl': 'https://bidder.cleanmediaads.com/pix/monitoring/win_notice/imp_5b05b9fde4b09084267a556f/im.gif?r=imp_5b05b9fde4b09084267a556f&i=1&a=579ef31bfa788b9d2000d562&b=0',
|
|
110
|
+
'adm': '<?xml version="1.0" encoding="UTF-8"?><VAST version="2.0">↵<Ad id="99aaef40-bbc0-4829-8599-f5313ea27ee9">↵<Wrapper>↵<AdSystem version="2.0"><![CDATA[cleanmedia.net]]></AdSystem>↵<VASTAdTagURI><![CDATA[https://static.gambid.io/demo/vast.xml]]></VASTAdTagURI>↵<Error><![CDATA[https://bidder.cleanmediaads.com/pix/1707/verror/imp_5c4dcd32e4b044440442782e/im.gif?r=imp_5c4dcd32e4b044440442782e&i=99aaef40-bbc0-4829-8599-f5313ea27ee9&a=1274&b=gb_1&error=[ERRORCODE]]]></Error>↵<Impression><![CDATA[https://bidder.cleanmediaads.com/pix/1707/vimp/imp_5c4dcd32e4b044440442782e/im.gif?r=imp_5c4dcd32e4b044440442782e&i=99aaef40-bbc0-4829-8599-f5313ea27ee9&a=1274&b=gb_1]]></Impression>↵<Creatives>↵<Creative AdID="1274">↵<Linear>↵<TrackingEvents>↵<Tracking event="start"><![CDATA[https://bidder.cleanmediaads.com/pix/1707/start/imp_5c4dcd32e4b044440442782e/im.gif?r=imp_5c4dcd32e4b044440442782e&i=99aaef40-bbc0-4829-8599-f5313ea27ee9&a=1274&b=gb_1]]></Tracking>↵<Tracking event="firstQuartile"><![CDATA[https://bidder.cleanmediaads.com/pix/1707/fq/imp_5c4dcd32e4b044440442782e/im.gif?r=imp_5c4dcd32e4b044440442782e&i=99aaef40-bbc0-4829-8599-f5313ea27ee9&a=1274&b=gb_1]]></Tracking>↵<Tracking event="midpoint"><![CDATA[https://bidder.cleanmediaads.com/pix/1707/mp/imp_5c4dcd32e4b044440442782e/im.gif?r=imp_5c4dcd32e4b044440442782e&i=99aaef40-bbc0-4829-8599-f5313ea27ee9&a=1274&b=gb_1]]></Tracking>↵<Tracking event="thirdQuartile"><![CDATA[https://bidder.cleanmediaads.com/pix/1707/tq/imp_5c4dcd32e4b044440442782e/im.gif?r=imp_5c4dcd32e4b044440442782e&i=99aaef40-bbc0-4829-8599-f5313ea27ee9&a=1274&b=gb_1]]></Tracking>↵<Tracking event="complete"><![CDATA[https://bidder.cleanmediaads.com/pix/1707/comp/imp_5c4dcd32e4b044440442782e/im.gif?r=imp_5c4dcd32e4b044440442782e&i=99aaef40-bbc0-4829-8599-f5313ea27ee9&a=1274&b=gb_1]]></Tracking>↵</TrackingEvents>↵</Linear>↵</Creative>↵</Creatives>↵</Wrapper></Ad>↵</VAST>',
|
|
111
|
+
'adomain': ['aaa.com'],
|
|
112
|
+
'cid': '579ef268fa788b9d2000d55c',
|
|
113
|
+
'crid': '579ef31bfa788b9d2000d562',
|
|
114
|
+
'attr': [],
|
|
115
|
+
'h': 600,
|
|
116
|
+
'w': 120,
|
|
117
|
+
'ext': {
|
|
118
|
+
'vast_url': 'http://my.vast.com',
|
|
119
|
+
'utrk': [
|
|
120
|
+
{'type': 'iframe', 'url': '//p.partner1.io/user/sync/1'}
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
]
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
'seat': 'seat2',
|
|
128
|
+
'group': 0,
|
|
129
|
+
'bid': [
|
|
130
|
+
{
|
|
131
|
+
'id': '1',
|
|
132
|
+
'impid': '1',
|
|
133
|
+
'price': 3,
|
|
134
|
+
'adid': '542jlhdfd2112jnjf3x',
|
|
135
|
+
'nurl': 'https://bidder.cleanmediaads.com/pix/monitoring/win_notice/imp_5b05b9fde4b09084267a556f/im.gif?r=imp_5b05b9fde4b09084267a556f&i=1&a=579ef31bfa788b9d2000d562&b=0',
|
|
136
|
+
'adm': '<img width="300px" height="250px" src="https://dummyimage.com/300x250/030d00/52b31e.gif&text=CleanMedia+Demo" onclick="window.open(\'https://www.cleanmedia.net\')"> <img width="0px" height="0px" src="https://bidder.cleanmediaads.com/pix/monitoring/imp/imp_5b05b9fde4b09084267a556f/im.gif?r=imp_5b05b9fde4b09084267a556f&i=1&a=579ef31bfa788b9d2000d562&b=0"/>',
|
|
137
|
+
'adomain': ['bbb.com'],
|
|
138
|
+
'cid': 'fgdlwjh2498ydjhg1',
|
|
139
|
+
'crid': 'kjh34297ydh2133d',
|
|
140
|
+
'attr': [],
|
|
141
|
+
'h': 250,
|
|
142
|
+
'w': 300,
|
|
143
|
+
'ext': {
|
|
144
|
+
'utrk': [
|
|
145
|
+
{'type': 'image', 'url': '//p.partner2.io/user/sync/1'}
|
|
146
|
+
]
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
]
|
|
150
|
+
}
|
|
151
|
+
]
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
videoResponse = {
|
|
155
|
+
'id': '64f32497-b2f7-48ec-9205-35fc39894d44',
|
|
156
|
+
'bidid': 'imp_5c24924de4b0d106447af333',
|
|
157
|
+
'cur': 'USD',
|
|
158
|
+
'seatbid': [
|
|
159
|
+
{
|
|
160
|
+
'seat': '3668',
|
|
161
|
+
'group': 0,
|
|
162
|
+
'bid': [
|
|
163
|
+
{
|
|
164
|
+
'id': 'gb_1',
|
|
165
|
+
'impid': 'afbb5852-7cea-4a81-aa9a-a41aab505c23',
|
|
166
|
+
'price': 5.0,
|
|
167
|
+
'adid': '1274',
|
|
168
|
+
'nurl': 'https://bidder.cleanmediaads.com/pix/1275/win_notice/imp_5c24924de4b0d106447af333/im.gif?r=imp_5c24924de4b0d106447af333&i=afbb5852-7cea-4a81-aa9a-a41aab505c23&a=1274&b=gb_1',
|
|
169
|
+
'adomain': [],
|
|
170
|
+
'adm': '<?xml version=\"1.0\" encoding=\"UTF-8\"?><VAST version=\"2.0\">\n<Ad id=\"afbb5852-7cea-4a81-aa9a-a41aab505c23\">\n<Wrapper>\n<AdSystem version=\"2.0\"><![CDATA[cleanmedia.net]]></AdSystem>\n<VASTAdTagURI><![CDATA[https://static.gambid.io/demo/vast.xml]]></VASTAdTagURI>\n<Error><![CDATA[https://bidder.cleanmediaads.com/pix/1275/verror/imp_5c24924de4b0d106447af333/im.gif?r=imp_5c24924de4b0d106447af333&i=afbb5852-7cea-4a81-aa9a-a41aab505c23&a=1274&b=gb_1&error=[ERRORCODE]]]></Error>\n<Impression><![CDATA[https://bidder.cleanmediaads.com/pix/1275/vimp/imp_5c24924de4b0d106447af333/im.gif?r=imp_5c24924de4b0d106447af333&i=afbb5852-7cea-4a81-aa9a-a41aab505c23&a=1274&b=gb_1]]></Impression>\n<Creatives>\n<Creative AdID=\"1274\">\n<Linear>\n<TrackingEvents>\n<Tracking event=\"start\"><![CDATA[https://bidder.cleanmediaads.com/pix/1275/start/imp_5c24924de4b0d106447af333/im.gif?r=imp_5c24924de4b0d106447af333&i=afbb5852-7cea-4a81-aa9a-a41aab505c23&a=1274&b=gb_1]]></Tracking>\n<Tracking event=\"firstQuartile\"><![CDATA[https://bidder.cleanmediaads.com/pix/1275/fq/imp_5c24924de4b0d106447af333/im.gif?r=imp_5c24924de4b0d106447af333&i=afbb5852-7cea-4a81-aa9a-a41aab505c23&a=1274&b=gb_1]]></Tracking>\n<Tracking event=\"midpoint\"><![CDATA[https://bidder.cleanmediaads.com/pix/1275/mp/imp_5c24924de4b0d106447af333/im.gif?r=imp_5c24924de4b0d106447af333&i=afbb5852-7cea-4a81-aa9a-a41aab505c23&a=1274&b=gb_1]]></Tracking>\n<Tracking event=\"thirdQuartile\"><![CDATA[https://bidder.cleanmediaads.com/pix/1275/tq/imp_5c24924de4b0d106447af333/im.gif?r=imp_5c24924de4b0d106447af333&i=afbb5852-7cea-4a81-aa9a-a41aab505c23&a=1274&b=gb_1]]></Tracking>\n<Tracking event=\"complete\"><![CDATA[https://bidder.cleanmediaads.com/pix/1275/comp/imp_5c24924de4b0d106447af333/im.gif?r=imp_5c24924de4b0d106447af333&i=afbb5852-7cea-4a81-aa9a-a41aab505c23&a=1274&b=gb_1]]></Tracking>\n</TrackingEvents>\n</Linear>\n</Creative>\n</Creatives>\n</Wrapper>\n</Ad>\n</VAST>\n',
|
|
171
|
+
'cid': '3668',
|
|
172
|
+
'crid': '1274',
|
|
173
|
+
'cat': [],
|
|
174
|
+
'attr': [],
|
|
175
|
+
'h': 250,
|
|
176
|
+
'w': 300,
|
|
177
|
+
'ext': {
|
|
178
|
+
'vast_url': 'https://bidder.cleanmediaads.com/pix/1275/vast_o/imp_5c24924de4b0d106447af333/im.xml?r=imp_5c24924de4b0d106447af333&i=afbb5852-7cea-4a81-aa9a-a41aab505c23&a=1274&b=gb_1&w=300&h=250&vatu=aHR0cHM6Ly9zdGF0aWMuZ2FtYmlkLmlvL2RlbW8vdmFzdC54bWw&vwarv',
|
|
179
|
+
'imptrackers': [
|
|
180
|
+
'https://bidder.cleanmediaads.com/pix/1275/imp/imp_5c24924de4b0d106447af333/im.gif?r=imp_5c24924de4b0d106447af333&i=afbb5852-7cea-4a81-aa9a-a41aab505c23&a=1274&b=gb_1']
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
]
|
|
184
|
+
}
|
|
185
|
+
],
|
|
186
|
+
'ext': {
|
|
187
|
+
'utrk': [{
|
|
188
|
+
'type': 'image',
|
|
189
|
+
'url': 'https://bidder.cleanmediaads.com/pix/1275/scm?cb=1545900621675&gdpr=[GDPR]&consent=[CONSENT]&us_privacy=[US_PRIVACY]'
|
|
190
|
+
}]
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
gdprConsent = {
|
|
195
|
+
gdprApplies: true,
|
|
196
|
+
consentString: 'consent string'
|
|
197
|
+
};
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
describe('Get top Frame', () => {
|
|
201
|
+
it('check if you are in the top frame', () => {
|
|
202
|
+
expect(helper.getTopFrame()).to.equal(0);
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
describe('Is String start with search', () => {
|
|
207
|
+
it('check if a string started with', () => {
|
|
208
|
+
expect(helper.startsWith('cleanmedia.net', 'clea')).to.equal(true);
|
|
14
209
|
});
|
|
15
210
|
});
|
|
16
211
|
|
|
17
|
-
describe('inherited functions',
|
|
18
|
-
it('exists and is a function',
|
|
212
|
+
describe('inherited functions', () => {
|
|
213
|
+
it('exists and is a function', () => {
|
|
19
214
|
expect(adapter.callBids).to.exist.and.to.be.a('function');
|
|
20
215
|
});
|
|
21
216
|
});
|
|
22
217
|
|
|
23
|
-
describe('isBidRequestValid',
|
|
24
|
-
it('should validate supply-partner ID',
|
|
25
|
-
expect(spec.isBidRequestValid({
|
|
26
|
-
expect(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
).to.equal(true);
|
|
218
|
+
describe('isBidRequestValid', () => {
|
|
219
|
+
it('should validate supply-partner ID', () => {
|
|
220
|
+
expect(spec.isBidRequestValid({params: {}})).to.equal(false);
|
|
221
|
+
expect(spec.isBidRequestValid({params: {supplyPartnerId: 123}})).to.equal(false);
|
|
222
|
+
expect(spec.isBidRequestValid({params: {supplyPartnerId: '123'}})).to.equal(true);
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
it('should validate RTB endpoint', () => {
|
|
226
|
+
expect(spec.isBidRequestValid({params: {supplyPartnerId: '123'}})).to.equal(true); // RTB endpoint has a default
|
|
227
|
+
expect(spec.isBidRequestValid({params: {supplyPartnerId: '123', rtbEndpoint: 123}})).to.equal(false);
|
|
228
|
+
expect(spec.isBidRequestValid({
|
|
229
|
+
params: {
|
|
230
|
+
supplyPartnerId: '123',
|
|
231
|
+
rtbEndpoint: 'https://some.url.com'
|
|
232
|
+
}
|
|
233
|
+
})).to.equal(true);
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
it('should validate bid floor', () => {
|
|
237
|
+
expect(spec.isBidRequestValid({params: {supplyPartnerId: '123'}})).to.equal(true); // bidfloor has a default
|
|
238
|
+
expect(spec.isBidRequestValid({params: {supplyPartnerId: '123', bidfloor: '123'}})).to.equal(false);
|
|
239
|
+
expect(spec.isBidRequestValid({params: {supplyPartnerId: '123', bidfloor: 0.1}})).to.equal(true);
|
|
240
|
+
|
|
241
|
+
const getFloorResponse = {currency: 'USD', floor: 5};
|
|
242
|
+
let testBidRequest = deepClone(bidRequest);
|
|
243
|
+
let request = spec.buildRequests([testBidRequest], bidRequest)[0];
|
|
244
|
+
|
|
245
|
+
// 1. getBidFloor not exist AND bidfloor not exist - return 0
|
|
246
|
+
let payload = request.data;
|
|
247
|
+
expect(payload.imp[0].bidfloor).to.exist.and.equal(0);
|
|
248
|
+
|
|
249
|
+
// 2. getBidFloor not exist AND bidfloor exist - use bidfloor property
|
|
250
|
+
testBidRequest = deepClone(bidRequest);
|
|
251
|
+
testBidRequest.params = {
|
|
252
|
+
'bidfloor': 0.3
|
|
253
|
+
};
|
|
254
|
+
request = spec.buildRequests([testBidRequest], bidRequest)[0];
|
|
255
|
+
payload = request.data;
|
|
256
|
+
expect(payload.imp[0].bidfloor).to.exist.and.to.equal(0.3)
|
|
257
|
+
|
|
258
|
+
// 3. getBidFloor exist AND bidfloor not exist - use getFloor method
|
|
259
|
+
testBidRequest = deepClone(bidRequest);
|
|
260
|
+
testBidRequest.getFloor = () => getFloorResponse;
|
|
261
|
+
request = spec.buildRequests([testBidRequest], bidRequest)[0];
|
|
262
|
+
payload = request.data;
|
|
263
|
+
expect(payload.imp[0].bidfloor).to.exist.and.to.equal(5)
|
|
264
|
+
|
|
265
|
+
// 4. getBidFloor exist AND bidfloor exist -> use getFloor method
|
|
266
|
+
testBidRequest = deepClone(bidRequest);
|
|
267
|
+
testBidRequest.getFloor = () => getFloorResponse;
|
|
268
|
+
testBidRequest.params = {
|
|
269
|
+
'bidfloor': 0.3
|
|
270
|
+
};
|
|
271
|
+
request = spec.buildRequests([testBidRequest], bidRequest)[0];
|
|
272
|
+
payload = request.data;
|
|
273
|
+
expect(payload.imp[0].bidfloor).to.exist.and.to.equal(5)
|
|
32
274
|
});
|
|
33
275
|
|
|
34
|
-
it('should validate adpos',
|
|
35
|
-
expect(
|
|
36
|
-
|
|
37
|
-
).to.equal(true);
|
|
38
|
-
expect(
|
|
39
|
-
spec.isBidRequestValid({
|
|
40
|
-
params: { supplyPartnerId: '123', adpos: '123' }
|
|
41
|
-
})
|
|
42
|
-
).to.equal(false);
|
|
43
|
-
expect(
|
|
44
|
-
spec.isBidRequestValid({
|
|
45
|
-
params: { supplyPartnerId: '123', adpos: 0.1 }
|
|
46
|
-
})
|
|
47
|
-
).to.equal(true);
|
|
276
|
+
it('should validate adpos', () => {
|
|
277
|
+
expect(spec.isBidRequestValid({params: {supplyPartnerId: '123'}})).to.equal(true); // adpos has a default
|
|
278
|
+
expect(spec.isBidRequestValid({params: {supplyPartnerId: '123', adpos: '123'}})).to.equal(false);
|
|
279
|
+
expect(spec.isBidRequestValid({params: {supplyPartnerId: '123', adpos: 0.1}})).to.equal(true);
|
|
48
280
|
});
|
|
49
281
|
|
|
50
|
-
it('should validate instl',
|
|
51
|
-
expect(
|
|
52
|
-
|
|
53
|
-
).to.equal(
|
|
54
|
-
expect(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
})
|
|
58
|
-
).to.equal(false);
|
|
59
|
-
expect(
|
|
60
|
-
spec.isBidRequestValid({
|
|
61
|
-
params: { supplyPartnerId: '123', instl: -1 }
|
|
62
|
-
})
|
|
63
|
-
).to.equal(false);
|
|
64
|
-
expect(
|
|
65
|
-
spec.isBidRequestValid({ params: { supplyPartnerId: '123', instl: 0 } })
|
|
66
|
-
).to.equal(true);
|
|
67
|
-
expect(
|
|
68
|
-
spec.isBidRequestValid({ params: { supplyPartnerId: '123', instl: 1 } })
|
|
69
|
-
).to.equal(true);
|
|
70
|
-
expect(
|
|
71
|
-
spec.isBidRequestValid({ params: { supplyPartnerId: '123', instl: 2 } })
|
|
72
|
-
).to.equal(false);
|
|
282
|
+
it('should validate instl', () => {
|
|
283
|
+
expect(spec.isBidRequestValid({params: {supplyPartnerId: '123'}})).to.equal(true); // adpos has a default
|
|
284
|
+
expect(spec.isBidRequestValid({params: {supplyPartnerId: '123', instl: '123'}})).to.equal(false);
|
|
285
|
+
expect(spec.isBidRequestValid({params: {supplyPartnerId: '123', instl: -1}})).to.equal(false);
|
|
286
|
+
expect(spec.isBidRequestValid({params: {supplyPartnerId: '123', instl: 0}})).to.equal(true);
|
|
287
|
+
expect(spec.isBidRequestValid({params: {supplyPartnerId: '123', instl: 1}})).to.equal(true);
|
|
288
|
+
expect(spec.isBidRequestValid({params: {supplyPartnerId: '123', instl: 2}})).to.equal(false);
|
|
73
289
|
});
|
|
74
290
|
});
|
|
75
291
|
|
|
76
|
-
describe('buildRequests',
|
|
77
|
-
|
|
78
|
-
adUnitCode: 'adunit-code',
|
|
79
|
-
auctionId: '1d1a030790a475',
|
|
80
|
-
mediaTypes: {
|
|
81
|
-
banner: {}
|
|
82
|
-
},
|
|
83
|
-
params: {
|
|
84
|
-
supplyPartnerId: supplyPartnerId
|
|
85
|
-
},
|
|
86
|
-
sizes: [[300, 250], [300, 600]],
|
|
87
|
-
transactionId: 'a123456789',
|
|
88
|
-
refererInfo: { referer: 'https://examplereferer.com', domain: 'examplereferer.com' },
|
|
89
|
-
gdprConsent: {
|
|
90
|
-
consentString: 'some string',
|
|
91
|
-
gdprApplies: true
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
it('returns an array', function() {
|
|
292
|
+
describe('buildRequests', () => {
|
|
293
|
+
it('returns an array', () => {
|
|
95
294
|
let response;
|
|
96
295
|
response = spec.buildRequests([]);
|
|
97
296
|
expect(Array.isArray(response)).to.equal(true);
|
|
@@ -99,58 +298,61 @@ describe('CleanmedianetAdapter', function () {
|
|
|
99
298
|
response = spec.buildRequests([bidRequest], bidRequest);
|
|
100
299
|
expect(Array.isArray(response)).to.equal(true);
|
|
101
300
|
expect(response.length).to.equal(1);
|
|
102
|
-
const adUnit1 = Object.assign({}, utils.deepClone(bidRequest), {
|
|
103
|
-
|
|
104
|
-
adUnitCode: 'a'
|
|
105
|
-
});
|
|
106
|
-
const adUnit2 = Object.assign({}, utils.deepClone(bidRequest), {
|
|
107
|
-
auctionId: '1',
|
|
108
|
-
adUnitCode: 'b'
|
|
109
|
-
});
|
|
301
|
+
const adUnit1 = Object.assign({}, utils.deepClone(bidRequest), {auctionId: '1', adUnitCode: 'a'});
|
|
302
|
+
const adUnit2 = Object.assign({}, utils.deepClone(bidRequest), {auctionId: '1', adUnitCode: 'b'});
|
|
110
303
|
response = spec.buildRequests([adUnit1, adUnit2], bidRequest);
|
|
111
304
|
expect(Array.isArray(response)).to.equal(true);
|
|
112
305
|
expect(response.length).to.equal(2);
|
|
113
306
|
});
|
|
114
307
|
|
|
115
|
-
it('
|
|
308
|
+
it('targets correct endpoint', () => {
|
|
309
|
+
let response;
|
|
310
|
+
response = spec.buildRequests([bidRequest], bidRequest)[0];
|
|
311
|
+
expect(response.method).to.equal('POST');
|
|
312
|
+
expect(response.url).to.match(new RegExp(`^https://bidder\\.cleanmediaads\\.com/r/${supplyPartnerId}/bidr\\?rformat=open_rtb&reqformat=rtb_json&bidder=prebid$`, 'g'));
|
|
313
|
+
expect(response.data.id).to.equal(bidRequest.auctionId);
|
|
314
|
+
const bidRequestWithEndpoint = utils.deepClone(bidRequest);
|
|
315
|
+
bidRequestWithEndpoint.params.rtbEndpoint = 'https://bidder.cleanmediaads.com/a12';
|
|
316
|
+
response = spec.buildRequests([bidRequestWithEndpoint], bidRequest)[0];
|
|
317
|
+
expect(response.url).to.match(new RegExp(`^https://bidder\\.cleanmediaads\\.com/a12/r/${supplyPartnerId}/bidr\\?rformat=open_rtb&reqformat=rtb_json&bidder=prebid$`, 'g'));
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
it('builds request correctly', () => {
|
|
116
321
|
let bidRequest2 = utils.deepClone(bidRequest);
|
|
117
322
|
Object.assign(bidRequest2.refererInfo, {
|
|
118
|
-
page: '
|
|
119
|
-
domain: 'test.com',
|
|
120
|
-
ref: '
|
|
323
|
+
page: 'http://www.test.com/page.html',
|
|
324
|
+
domain: 'www.test.com',
|
|
325
|
+
ref: 'http://referrer.com'
|
|
121
326
|
})
|
|
122
|
-
|
|
123
327
|
let response = spec.buildRequests([bidRequest], bidRequest2)[0];
|
|
124
|
-
|
|
125
|
-
expect(response.data.site.
|
|
126
|
-
expect(response.data.site.
|
|
328
|
+
|
|
329
|
+
expect(response.data.site.domain).to.equal('www.test.com');
|
|
330
|
+
expect(response.data.site.page).to.equal('http://www.test.com/page.html');
|
|
331
|
+
expect(response.data.site.ref).to.equal('http://referrer.com');
|
|
127
332
|
expect(response.data.imp.length).to.equal(1);
|
|
128
333
|
expect(response.data.imp[0].id).to.equal(bidRequest.transactionId);
|
|
129
334
|
expect(response.data.imp[0].instl).to.equal(0);
|
|
130
335
|
expect(response.data.imp[0].tagid).to.equal(bidRequest.adUnitCode);
|
|
131
336
|
expect(response.data.imp[0].bidfloor).to.equal(0);
|
|
132
337
|
expect(response.data.imp[0].bidfloorcur).to.equal('USD');
|
|
338
|
+
expect(response.data.regs.ext.us_privacy).to.equal('cleanmediaCCPA');// USP/CCPAs
|
|
339
|
+
expect(response.data.source.ext.schain).to.deep.equal(bidRequest2.schain);
|
|
340
|
+
|
|
133
341
|
const bidRequestWithInstlEquals1 = utils.deepClone(bidRequest);
|
|
134
342
|
bidRequestWithInstlEquals1.params.instl = 1;
|
|
135
|
-
response = spec.buildRequests(
|
|
136
|
-
|
|
137
|
-
bidRequest2
|
|
138
|
-
)[0];
|
|
139
|
-
expect(response.data.imp[0].instl).to.equal(
|
|
140
|
-
bidRequestWithInstlEquals1.params.instl
|
|
141
|
-
);
|
|
343
|
+
response = spec.buildRequests([bidRequestWithInstlEquals1], bidRequest2)[0];
|
|
344
|
+
expect(response.data.imp[0].instl).to.equal(bidRequestWithInstlEquals1.params.instl);
|
|
142
345
|
const bidRequestWithInstlEquals0 = utils.deepClone(bidRequest);
|
|
143
346
|
bidRequestWithInstlEquals0.params.instl = 1;
|
|
144
|
-
response = spec.buildRequests(
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
);
|
|
347
|
+
response = spec.buildRequests([bidRequestWithInstlEquals0], bidRequest2)[0];
|
|
348
|
+
expect(response.data.imp[0].instl).to.equal(bidRequestWithInstlEquals0.params.instl);
|
|
349
|
+
const bidRequestWithBidfloorEquals1 = utils.deepClone(bidRequest);
|
|
350
|
+
bidRequestWithBidfloorEquals1.params.bidfloor = 1;
|
|
351
|
+
response = spec.buildRequests([bidRequestWithBidfloorEquals1], bidRequest2)[0];
|
|
352
|
+
expect(response.data.imp[0].bidfloor).to.equal(bidRequestWithBidfloorEquals1.params.bidfloor);
|
|
151
353
|
});
|
|
152
354
|
|
|
153
|
-
it('builds request banner object correctly',
|
|
355
|
+
it('builds request banner object correctly', () => {
|
|
154
356
|
let response;
|
|
155
357
|
const bidRequestWithBanner = utils.deepClone(bidRequest);
|
|
156
358
|
bidRequestWithBanner.mediaTypes = {
|
|
@@ -159,54 +361,80 @@ describe('CleanmedianetAdapter', function () {
|
|
|
159
361
|
}
|
|
160
362
|
};
|
|
161
363
|
response = spec.buildRequests([bidRequestWithBanner], bidRequest)[0];
|
|
162
|
-
expect(response.data.imp[0].banner.w).to.equal(
|
|
163
|
-
|
|
164
|
-
);
|
|
165
|
-
expect(response.data.imp[0].banner.h).to.equal(
|
|
166
|
-
bidRequestWithBanner.mediaTypes.banner.sizes[0][1]
|
|
167
|
-
);
|
|
364
|
+
expect(response.data.imp[0].banner.w).to.equal(bidRequestWithBanner.mediaTypes.banner.sizes[0][0]);
|
|
365
|
+
expect(response.data.imp[0].banner.h).to.equal(bidRequestWithBanner.mediaTypes.banner.sizes[0][1]);
|
|
168
366
|
expect(response.data.imp[0].banner.pos).to.equal(0);
|
|
367
|
+
expect(response.data.imp[0].banner.topframe).to.equal(0);
|
|
169
368
|
const bidRequestWithPosEquals1 = utils.deepClone(bidRequestWithBanner);
|
|
170
369
|
bidRequestWithPosEquals1.params.pos = 1;
|
|
171
370
|
response = spec.buildRequests([bidRequestWithPosEquals1], bidRequest)[0];
|
|
172
|
-
expect(response.data.imp[0].banner.pos).to.equal(
|
|
173
|
-
bidRequestWithPosEquals1.params.pos
|
|
174
|
-
);
|
|
371
|
+
expect(response.data.imp[0].banner.pos).to.equal(bidRequestWithPosEquals1.params.pos);
|
|
175
372
|
});
|
|
176
373
|
|
|
177
|
-
it('builds request video object correctly',
|
|
374
|
+
it('builds request video object correctly', () => {
|
|
178
375
|
let response;
|
|
179
376
|
const bidRequestWithVideo = utils.deepClone(bidRequest);
|
|
377
|
+
|
|
378
|
+
bidRequestWithVideo.params.video = {
|
|
379
|
+
placement: 1,
|
|
380
|
+
minduration: 1,
|
|
381
|
+
}
|
|
382
|
+
|
|
180
383
|
bidRequestWithVideo.mediaTypes = {
|
|
181
384
|
video: {
|
|
182
|
-
|
|
385
|
+
playerSize: [[302, 252]],
|
|
386
|
+
mimes: ['video/mpeg'],
|
|
387
|
+
playbackmethod: 1,
|
|
388
|
+
startdelay: 1,
|
|
183
389
|
}
|
|
184
390
|
};
|
|
185
391
|
response = spec.buildRequests([bidRequestWithVideo], bidRequest)[0];
|
|
186
|
-
expect(response.data.imp[0].video.w).to.equal(
|
|
187
|
-
|
|
188
|
-
);
|
|
189
|
-
expect(response.data.imp[0].video.h).to.equal(
|
|
190
|
-
bidRequestWithVideo.mediaTypes.video.sizes[0][1]
|
|
191
|
-
);
|
|
392
|
+
expect(response.data.imp[0].video.w).to.equal(bidRequestWithVideo.mediaTypes.video.playerSize[0][0]);
|
|
393
|
+
expect(response.data.imp[0].video.h).to.equal(bidRequestWithVideo.mediaTypes.video.playerSize[0][1]);
|
|
192
394
|
expect(response.data.imp[0].video.pos).to.equal(0);
|
|
395
|
+
|
|
396
|
+
expect(response.data.imp[0].video.mimes).to.equal(bidRequestWithVideo.mediaTypes.video.mimes);
|
|
397
|
+
expect(response.data.imp[0].video.skip).to.not.exist;
|
|
398
|
+
expect(response.data.imp[0].video.placement).to.equal(1);
|
|
399
|
+
expect(response.data.imp[0].video.minduration).to.equal(1);
|
|
400
|
+
expect(response.data.imp[0].video.playbackmethod).to.equal(1);
|
|
401
|
+
expect(response.data.imp[0].video.startdelay).to.equal(1);
|
|
402
|
+
|
|
403
|
+
bidRequestWithVideo.mediaTypes = {
|
|
404
|
+
video: {
|
|
405
|
+
playerSize: [302, 252],
|
|
406
|
+
mimes: ['video/mpeg'],
|
|
407
|
+
skip: 1,
|
|
408
|
+
placement: 1,
|
|
409
|
+
minduration: 1,
|
|
410
|
+
playbackmethod: 1,
|
|
411
|
+
startdelay: 1,
|
|
412
|
+
},
|
|
413
|
+
};
|
|
414
|
+
|
|
193
415
|
const bidRequestWithPosEquals1 = utils.deepClone(bidRequestWithVideo);
|
|
416
|
+
expect(response.data.imp[0].video.w).to.equal(bidRequestWithVideo.mediaTypes.video.playerSize[0]);
|
|
417
|
+
expect(response.data.imp[0].video.h).to.equal(bidRequestWithVideo.mediaTypes.video.playerSize[1]);
|
|
418
|
+
|
|
194
419
|
bidRequestWithPosEquals1.params.pos = 1;
|
|
195
420
|
response = spec.buildRequests([bidRequestWithPosEquals1], bidRequest)[0];
|
|
196
|
-
expect(response.data.imp[0].video.pos).to.equal(
|
|
197
|
-
bidRequestWithPosEquals1.params.pos
|
|
198
|
-
);
|
|
421
|
+
expect(response.data.imp[0].video.pos).to.equal(bidRequestWithPosEquals1.params.pos);
|
|
199
422
|
});
|
|
200
423
|
|
|
201
|
-
it('builds request video object correctly with context',
|
|
202
|
-
let response;
|
|
424
|
+
it('builds request video object correctly with context', () => {
|
|
203
425
|
const bidRequestWithVideo = utils.deepClone(bidRequest);
|
|
204
426
|
bidRequestWithVideo.mediaTypes = {
|
|
205
427
|
video: {
|
|
206
|
-
context: 'instream'
|
|
428
|
+
context: 'instream',
|
|
429
|
+
mimes: ['video/mpeg'],
|
|
430
|
+
skip: 1,
|
|
431
|
+
placement: 1,
|
|
432
|
+
minduration: 1,
|
|
433
|
+
playbackmethod: 1,
|
|
434
|
+
startdelay: 1,
|
|
207
435
|
}
|
|
208
436
|
};
|
|
209
|
-
response = spec.buildRequests([bidRequestWithVideo], bidRequest)[0];
|
|
437
|
+
let response = spec.buildRequests([bidRequestWithVideo], bidRequest)[0];
|
|
210
438
|
expect(response.data.imp[0].video.ext.context).to.equal('instream');
|
|
211
439
|
bidRequestWithVideo.mediaTypes.video.context = 'outstream';
|
|
212
440
|
|
|
@@ -220,358 +448,185 @@ describe('CleanmedianetAdapter', function () {
|
|
|
220
448
|
response = spec.buildRequests([bidRequestWithPosEquals2], bidRequest)[0];
|
|
221
449
|
expect(response.data.imp[0].video.ext.context).to.equal(null);
|
|
222
450
|
});
|
|
223
|
-
|
|
224
|
-
|
|
451
|
+
|
|
452
|
+
it('builds request video object correctly with multi-dimensions size array', () => {
|
|
453
|
+
let response;
|
|
454
|
+
const bidRequestWithVideo = utils.deepClone(bidRequest);
|
|
225
455
|
bidRequestWithVideo.mediaTypes.video = {
|
|
226
456
|
playerSize: [[304, 254], [305, 255]],
|
|
227
|
-
context: 'instream'
|
|
457
|
+
context: 'instream',
|
|
458
|
+
mimes: ['video/mpeg'],
|
|
459
|
+
skip: 1,
|
|
460
|
+
placement: 1,
|
|
461
|
+
minduration: 1,
|
|
462
|
+
playbackmethod: 1,
|
|
463
|
+
startdelay: 1,
|
|
228
464
|
};
|
|
229
465
|
|
|
230
|
-
|
|
231
|
-
expect(response.data.imp[1].video.
|
|
232
|
-
|
|
466
|
+
response = spec.buildRequests([bidRequestWithVideo], bidRequest)[0];
|
|
467
|
+
expect(response.data.imp[1].video.ext.context).to.equal('instream');
|
|
468
|
+
bidRequestWithVideo.mediaTypes.video.context = 'outstream';
|
|
233
469
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
470
|
+
const bidRequestWithPosEquals1 = utils.deepClone(bidRequestWithVideo);
|
|
471
|
+
bidRequestWithPosEquals1.mediaTypes.video.context = 'outstream';
|
|
472
|
+
response = spec.buildRequests([bidRequestWithPosEquals1], bidRequest)[0];
|
|
473
|
+
expect(response.data.imp[1].video.ext.context).to.equal('outstream');
|
|
238
474
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
475
|
+
const bidRequestWithPosEquals2 = utils.deepClone(bidRequestWithVideo);
|
|
476
|
+
bidRequestWithPosEquals2.mediaTypes.video.context = null;
|
|
477
|
+
response = spec.buildRequests([bidRequestWithPosEquals2], bidRequest)[0];
|
|
478
|
+
expect(response.data.imp[1].video.ext.context).to.equal(null);
|
|
242
479
|
});
|
|
243
480
|
|
|
244
|
-
it('builds request with gdpr consent',
|
|
481
|
+
it('builds request with gdpr consent', () => {
|
|
245
482
|
let response = spec.buildRequests([bidRequest], bidRequest)[0];
|
|
483
|
+
|
|
484
|
+
expect(response.data.ext.gdpr_consent).to.not.equal(null).and.not.equal(undefined);
|
|
246
485
|
expect(response.data.ext).to.have.property('gdpr_consent');
|
|
247
|
-
expect(response.data.ext.gdpr_consent.consent_string).to.equal(
|
|
248
|
-
'some string'
|
|
249
|
-
);
|
|
486
|
+
expect(response.data.ext.gdpr_consent.consent_string).to.equal('some string');
|
|
250
487
|
expect(response.data.ext.gdpr_consent.consent_required).to.equal(true);
|
|
251
|
-
});
|
|
252
|
-
});
|
|
253
|
-
|
|
254
|
-
describe('interpretResponse', function() {
|
|
255
|
-
const bannerBidRequest = {
|
|
256
|
-
adUnitCode: 'adunit-code',
|
|
257
|
-
auctionId: '1d1a030790a475',
|
|
258
|
-
mediaTypes: {
|
|
259
|
-
banner: {}
|
|
260
|
-
},
|
|
261
|
-
params: {
|
|
262
|
-
supplyPartnerId: supplyPartnerId
|
|
263
|
-
},
|
|
264
|
-
sizes: [[300, 250], [300, 600]],
|
|
265
|
-
transactionId: 'a123456789',
|
|
266
|
-
bidId: '111',
|
|
267
|
-
refererInfo: { referer: 'https://examplereferer.com' }
|
|
268
|
-
};
|
|
269
488
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
mediaTypes: {
|
|
274
|
-
video: {}
|
|
275
|
-
},
|
|
276
|
-
params: {
|
|
277
|
-
supplyPartnerId: supplyPartnerId
|
|
278
|
-
},
|
|
279
|
-
sizes: [[300, 250], [300, 600]],
|
|
280
|
-
transactionId: 'a123456789',
|
|
281
|
-
bidId: '111',
|
|
282
|
-
refererInfo: { referer: 'https://examplereferer.com' }
|
|
283
|
-
};
|
|
489
|
+
expect(response.data.regs.ext.gdpr).to.not.equal(null).and.not.equal(undefined);
|
|
490
|
+
expect(response.data.user.ext.consent).to.equal('some string');
|
|
491
|
+
});
|
|
284
492
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
{
|
|
301
|
-
id: '0',
|
|
302
|
-
impid: '1',
|
|
303
|
-
price: 2.016,
|
|
304
|
-
adid: '579ef31bfa788b9d2000d562',
|
|
305
|
-
nurl:
|
|
306
|
-
'https://bidder.cleanmediaads.com/pix/monitoring/win_notice/imp_5b05b9fde4b09084267a556f/im.gif?r=imp_5b05b9fde4b09084267a556f&i=1&a=579ef31bfa788b9d2000d562&b=0',
|
|
307
|
-
adm:
|
|
308
|
-
'<?xml version="1.0" encoding="UTF-8"?><VAST version="2.0">↵<Ad id="99aaef40-bbc0-4829-8599-f5313ea27ee9">↵<Wrapper>↵<AdSystem version="2.0"><![CDATA[cleanmediaads.com]]></AdSystem>↵<VASTAdTagURI><![CDATA[https://static.gambid.io/demo/vast.xml]]></VASTAdTagURI>↵<Error><![CDATA[https://bidder.cleanmediaads.com/pix/1707/verror/imp_5c4dcd32e4b044440442782e/im.gif?r=imp_5c4dcd32e4b044440442782e&i=99aaef40-bbc0-4829-8599-f5313ea27ee9&a=1274&b=gb_1&error=[ERRORCODE]]]></Error>↵<Impression><![CDATA[https://bidder.cleanmediaads.com/pix/1707/vimp/imp_5c4dcd32e4b044440442782e/im.gif?r=imp_5c4dcd32e4b044440442782e&i=99aaef40-bbc0-4829-8599-f5313ea27ee9&a=1274&b=gb_1]]></Impression>↵<Creatives>↵<Creative AdID="1274">↵<Linear>↵<TrackingEvents>↵<Tracking event="start"><![CDATA[https://bidder.cleanmediaads.com/pix/1707/start/imp_5c4dcd32e4b044440442782e/im.gif?r=imp_5c4dcd32e4b044440442782e&i=99aaef40-bbc0-4829-8599-f5313ea27ee9&a=1274&b=gb_1]]></Tracking>↵<Tracking event="firstQuartile"><![CDATA[https://bidder.cleanmediaads.com/pix/1707/fq/imp_5c4dcd32e4b044440442782e/im.gif?r=imp_5c4dcd32e4b044440442782e&i=99aaef40-bbc0-4829-8599-f5313ea27ee9&a=1274&b=gb_1]]></Tracking>↵<Tracking event="midpoint"><![CDATA[https://bidder.cleanmediaads.com/pix/1707/mp/imp_5c4dcd32e4b044440442782e/im.gif?r=imp_5c4dcd32e4b044440442782e&i=99aaef40-bbc0-4829-8599-f5313ea27ee9&a=1274&b=gb_1]]></Tracking>↵<Tracking event="thirdQuartile"><![CDATA[https://bidder.cleanmediaads.com/pix/1707/tq/imp_5c4dcd32e4b044440442782e/im.gif?r=imp_5c4dcd32e4b044440442782e&i=99aaef40-bbc0-4829-8599-f5313ea27ee9&a=1274&b=gb_1]]></Tracking>↵<Tracking event="complete"><![CDATA[https://bidder.cleanmediaads.com/pix/1707/comp/imp_5c4dcd32e4b044440442782e/im.gif?r=imp_5c4dcd32e4b044440442782e&i=99aaef40-bbc0-4829-8599-f5313ea27ee9&a=1274&b=gb_1]]></Tracking>↵</TrackingEvents>↵</Linear>↵</Creative>↵</Creatives>↵</Wrapper></Ad>↵</VAST>',
|
|
309
|
-
adomain: ['aaa.com'],
|
|
310
|
-
cid: '579ef268fa788b9d2000d55c',
|
|
311
|
-
crid: '579ef31bfa788b9d2000d562',
|
|
312
|
-
attr: [],
|
|
313
|
-
h: 600,
|
|
314
|
-
w: 120,
|
|
315
|
-
ext: {
|
|
316
|
-
vast_url: 'https://my.vast.com',
|
|
317
|
-
utrk: [{ type: 'iframe', url: '//p.partner1.io/user/sync/1' }]
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
]
|
|
321
|
-
},
|
|
322
|
-
{
|
|
323
|
-
seat: 'seat2',
|
|
324
|
-
group: 0,
|
|
325
|
-
bid: [
|
|
326
|
-
{
|
|
327
|
-
id: '1',
|
|
328
|
-
impid: '1',
|
|
329
|
-
price: 3,
|
|
330
|
-
adid: '542jlhdfd2112jnjf3x',
|
|
331
|
-
nurl:
|
|
332
|
-
'https://bidder.cleanmediaads.com/pix/monitoring/win_notice/imp_5b05b9fde4b09084267a556f/im.gif?r=imp_5b05b9fde4b09084267a556f&i=1&a=579ef31bfa788b9d2000d562&b=0',
|
|
333
|
-
adm:
|
|
334
|
-
'<img width="300px" height="250px" src="https://dummyimage.com/300x250/030d00/52b31e.gif&text=Cleanmedia+Demo" onclick="window.open(\'https://www.cleanmediaads.com\')"> <img width="0px" height="0px" src="https://bidder.cleanmediaads.com/pix/monitoring/imp/imp_5b05b9fde4b09084267a556f/im.gif?r=imp_5b05b9fde4b09084267a556f&i=1&a=579ef31bfa788b9d2000d562&b=0"/>',
|
|
335
|
-
adomain: ['bbb.com'],
|
|
336
|
-
cid: 'fgdlwjh2498ydjhg1',
|
|
337
|
-
crid: 'kjh34297ydh2133d',
|
|
338
|
-
attr: [],
|
|
339
|
-
h: 250,
|
|
340
|
-
w: 300,
|
|
341
|
-
ext: {
|
|
342
|
-
utrk: [{ type: 'image', url: '//p.partner2.io/user/sync/1' }]
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
]
|
|
346
|
-
}
|
|
347
|
-
]
|
|
348
|
-
};
|
|
493
|
+
it('build request with ID5 Id', () => {
|
|
494
|
+
const bidRequestClone = utils.deepClone(bidRequest);
|
|
495
|
+
bidRequestClone.userId = {};
|
|
496
|
+
bidRequestClone.userId.id5id = { uid: 'id5-user-id' };
|
|
497
|
+
let request = spec.buildRequests([bidRequestClone], bidRequestClone)[0];
|
|
498
|
+
expect(request.data.user.ext.eids).to.deep.equal([{
|
|
499
|
+
'source': 'id5-sync.com',
|
|
500
|
+
'uids': [{
|
|
501
|
+
'id': 'id5-user-id',
|
|
502
|
+
'ext': {
|
|
503
|
+
'rtiPartner': 'ID5ID'
|
|
504
|
+
}
|
|
505
|
+
}]
|
|
506
|
+
}]);
|
|
507
|
+
});
|
|
349
508
|
|
|
350
|
-
it('
|
|
351
|
-
|
|
509
|
+
it('build request with unified Id', () => {
|
|
510
|
+
const bidRequestClone = utils.deepClone(bidRequest);
|
|
511
|
+
bidRequestClone.userId = {};
|
|
512
|
+
bidRequestClone.userId.tdid = 'tdid-user-id';
|
|
513
|
+
let request = spec.buildRequests([bidRequestClone], bidRequestClone)[0];
|
|
514
|
+
expect(request.data.user.ext.eids).to.deep.equal([{
|
|
515
|
+
'source': 'adserver.org',
|
|
516
|
+
'uids': [{
|
|
517
|
+
'id': 'tdid-user-id',
|
|
518
|
+
'ext': {
|
|
519
|
+
'rtiPartner': 'TDID'
|
|
520
|
+
}
|
|
521
|
+
}]
|
|
522
|
+
}]);
|
|
523
|
+
});
|
|
524
|
+
});
|
|
352
525
|
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
});
|
|
526
|
+
describe('interpretResponse', () => {
|
|
527
|
+
it('returns an empty array on missing response', () => {
|
|
528
|
+
let response = spec.interpretResponse(undefined, {bidRequest: bannerBidRequest});
|
|
356
529
|
expect(Array.isArray(response)).to.equal(true);
|
|
357
530
|
expect(response.length).to.equal(0);
|
|
358
531
|
|
|
359
|
-
response = spec.interpretResponse({}, {
|
|
532
|
+
response = spec.interpretResponse({}, {bidRequest: bannerBidRequest});
|
|
360
533
|
expect(Array.isArray(response)).to.equal(true);
|
|
361
534
|
expect(response.length).to.equal(0);
|
|
362
535
|
});
|
|
363
536
|
|
|
364
|
-
it('aggregates banner bids from all seat bids',
|
|
365
|
-
const response = spec.interpretResponse(
|
|
366
|
-
{ body: rtbResponse },
|
|
367
|
-
{ bidRequest: bannerBidRequest }
|
|
368
|
-
);
|
|
537
|
+
it('aggregates banner bids from all seat bids', () => {
|
|
538
|
+
const response = spec.interpretResponse({body: rtbResponse}, {bidRequest: bannerBidRequest});
|
|
369
539
|
expect(Array.isArray(response)).to.equal(true);
|
|
370
540
|
expect(response.length).to.equal(1);
|
|
371
|
-
|
|
372
541
|
const ad0 = response[0];
|
|
373
542
|
expect(ad0.requestId).to.equal(bannerBidRequest.bidId);
|
|
374
543
|
expect(ad0.cpm).to.equal(rtbResponse.seatbid[1].bid[0].price);
|
|
375
544
|
expect(ad0.width).to.equal(rtbResponse.seatbid[1].bid[0].w);
|
|
376
545
|
expect(ad0.height).to.equal(rtbResponse.seatbid[1].bid[0].h);
|
|
377
|
-
expect(ad0.ttl).to.equal(
|
|
546
|
+
expect(ad0.ttl).to.equal(TTL);
|
|
378
547
|
expect(ad0.creativeId).to.equal(rtbResponse.seatbid[1].bid[0].crid);
|
|
379
548
|
expect(ad0.netRevenue).to.equal(true);
|
|
380
|
-
expect(ad0.currency).to.equal(
|
|
381
|
-
rtbResponse.seatbid[1].bid[0].cur || rtbResponse.cur || 'USD'
|
|
382
|
-
);
|
|
549
|
+
expect(ad0.currency).to.equal(rtbResponse.seatbid[1].bid[0].cur || rtbResponse.cur || 'USD');
|
|
383
550
|
expect(ad0.ad).to.equal(rtbResponse.seatbid[1].bid[0].adm);
|
|
384
551
|
expect(ad0.vastXml).to.be.an('undefined');
|
|
385
552
|
expect(ad0.vastUrl).to.be.an('undefined');
|
|
553
|
+
expect(ad0.meta.advertiserDomains).to.be.equal(rtbResponse.seatbid[1].bid[0].adomain);
|
|
386
554
|
});
|
|
387
555
|
|
|
388
|
-
it('aggregates video bids from all seat bids',
|
|
389
|
-
const response = spec.interpretResponse(
|
|
390
|
-
{ body: rtbResponse },
|
|
391
|
-
{ bidRequest: videoBidRequest }
|
|
392
|
-
);
|
|
556
|
+
it('aggregates video bids from all seat bids', () => {
|
|
557
|
+
const response = spec.interpretResponse({body: rtbResponse}, {bidRequest: videoBidRequest});
|
|
393
558
|
expect(Array.isArray(response)).to.equal(true);
|
|
394
559
|
expect(response.length).to.equal(1);
|
|
395
|
-
|
|
396
560
|
const ad0 = response[0];
|
|
397
561
|
expect(ad0.requestId).to.equal(videoBidRequest.bidId);
|
|
398
562
|
expect(ad0.cpm).to.equal(rtbResponse.seatbid[0].bid[0].price);
|
|
399
563
|
expect(ad0.width).to.equal(rtbResponse.seatbid[0].bid[0].w);
|
|
400
564
|
expect(ad0.height).to.equal(rtbResponse.seatbid[0].bid[0].h);
|
|
401
|
-
expect(ad0.ttl).to.equal(
|
|
565
|
+
expect(ad0.ttl).to.equal(TTL);
|
|
402
566
|
expect(ad0.creativeId).to.equal(rtbResponse.seatbid[0].bid[0].crid);
|
|
403
567
|
expect(ad0.netRevenue).to.equal(true);
|
|
404
|
-
expect(ad0.currency).to.equal(
|
|
405
|
-
rtbResponse.seatbid[0].bid[0].cur || rtbResponse.cur || 'USD'
|
|
406
|
-
);
|
|
568
|
+
expect(ad0.currency).to.equal(rtbResponse.seatbid[0].bid[0].cur || rtbResponse.cur || 'USD');
|
|
407
569
|
expect(ad0.ad).to.be.an('undefined');
|
|
408
570
|
expect(ad0.vastXml).to.equal(rtbResponse.seatbid[0].bid[0].adm);
|
|
409
571
|
expect(ad0.vastUrl).to.equal(rtbResponse.seatbid[0].bid[0].ext.vast_url);
|
|
410
572
|
});
|
|
411
573
|
|
|
412
|
-
it('aggregates user-sync pixels',
|
|
413
|
-
const response = spec.getUserSyncs({}, [{
|
|
574
|
+
it('aggregates user-sync pixels', () => {
|
|
575
|
+
const response = spec.getUserSyncs({}, [{body: rtbResponse}]);
|
|
414
576
|
expect(Array.isArray(response)).to.equal(true);
|
|
415
577
|
expect(response.length).to.equal(4);
|
|
416
578
|
expect(response[0].type).to.equal(rtbResponse.ext.utrk[0].type);
|
|
417
|
-
expect(response[0].url).to.equal(
|
|
418
|
-
rtbResponse.ext.utrk[0].url + '?gc=missing'
|
|
419
|
-
);
|
|
579
|
+
expect(response[0].url).to.equal('//bidder.cleanmediaads.com/user/sync/1?gdpr=0&consent=&usp=');
|
|
420
580
|
expect(response[1].type).to.equal(rtbResponse.ext.utrk[1].type);
|
|
421
|
-
expect(response[1].url).to.equal(
|
|
422
|
-
|
|
423
|
-
);
|
|
424
|
-
expect(response[
|
|
425
|
-
|
|
426
|
-
);
|
|
427
|
-
expect(response[2].url).to.equal(
|
|
428
|
-
rtbResponse.seatbid[0].bid[0].ext.utrk[0].url + '?gc=missing'
|
|
429
|
-
);
|
|
430
|
-
expect(response[3].type).to.equal(
|
|
431
|
-
rtbResponse.seatbid[1].bid[0].ext.utrk[0].type
|
|
432
|
-
);
|
|
433
|
-
expect(response[3].url).to.equal(
|
|
434
|
-
rtbResponse.seatbid[1].bid[0].ext.utrk[0].url + '?gc=missing'
|
|
435
|
-
);
|
|
581
|
+
expect(response[1].url).to.equal('//bidder.cleanmediaads.com/user/sync/2');
|
|
582
|
+
expect(response[2].type).to.equal(rtbResponse.seatbid[0].bid[0].ext.utrk[0].type);
|
|
583
|
+
expect(response[2].url).to.equal('//p.partner1.io/user/sync/1');
|
|
584
|
+
expect(response[3].type).to.equal(rtbResponse.seatbid[1].bid[0].ext.utrk[0].type);
|
|
585
|
+
expect(response[3].url).to.equal('//p.partner2.io/user/sync/1');
|
|
436
586
|
});
|
|
437
587
|
|
|
438
|
-
it('supports configuring outstream renderers',
|
|
439
|
-
const videoResponse = {
|
|
440
|
-
id: '64f32497-b2f7-48ec-9205-35fc39894d44',
|
|
441
|
-
bidid: 'imp_5c24924de4b0d106447af333',
|
|
442
|
-
cur: 'USD',
|
|
443
|
-
seatbid: [
|
|
444
|
-
{
|
|
445
|
-
seat: '3668',
|
|
446
|
-
group: 0,
|
|
447
|
-
bid: [
|
|
448
|
-
{
|
|
449
|
-
id: 'gb_1',
|
|
450
|
-
impid: 'afbb5852-7cea-4a81-aa9a-a41aab505c23',
|
|
451
|
-
price: 5.0,
|
|
452
|
-
adid: '1274',
|
|
453
|
-
nurl:
|
|
454
|
-
'https://bidder.cleanmediaads.com/pix/1275/win_notice/imp_5c24924de4b0d106447af333/im.gif?r=imp_5c24924de4b0d106447af333&i=afbb5852-7cea-4a81-aa9a-a41aab505c23&a=1274&b=gb_1',
|
|
455
|
-
adomain: [],
|
|
456
|
-
adm:
|
|
457
|
-
'<?xml version="1.0" encoding="UTF-8"?><VAST version="2.0">\n<Ad id="afbb5852-7cea-4a81-aa9a-a41aab505c23">\n<Wrapper>\n<AdSystem version="2.0"><![CDATA[cleanmediaads.com]]></AdSystem>\n<VASTAdTagURI><![CDATA[https://static.gambid.io/demo/vast.xml]]></VASTAdTagURI>\n<Error><![CDATA[https://bidder.cleanmediaads.com/pix/1275/verror/imp_5c24924de4b0d106447af333/im.gif?r=imp_5c24924de4b0d106447af333&i=afbb5852-7cea-4a81-aa9a-a41aab505c23&a=1274&b=gb_1&error=[ERRORCODE]]]></Error>\n<Impression><![CDATA[https://bidder.cleanmediaads.com/pix/1275/vimp/imp_5c24924de4b0d106447af333/im.gif?r=imp_5c24924de4b0d106447af333&i=afbb5852-7cea-4a81-aa9a-a41aab505c23&a=1274&b=gb_1]]></Impression>\n<Creatives>\n<Creative AdID="1274">\n<Linear>\n<TrackingEvents>\n<Tracking event="start"><![CDATA[https://bidder.cleanmediaads.com/pix/1275/start/imp_5c24924de4b0d106447af333/im.gif?r=imp_5c24924de4b0d106447af333&i=afbb5852-7cea-4a81-aa9a-a41aab505c23&a=1274&b=gb_1]]></Tracking>\n<Tracking event="firstQuartile"><![CDATA[https://bidder.cleanmediaads.com/pix/1275/fq/imp_5c24924de4b0d106447af333/im.gif?r=imp_5c24924de4b0d106447af333&i=afbb5852-7cea-4a81-aa9a-a41aab505c23&a=1274&b=gb_1]]></Tracking>\n<Tracking event="midpoint"><![CDATA[https://bidder.cleanmediaads.com/pix/1275/mp/imp_5c24924de4b0d106447af333/im.gif?r=imp_5c24924de4b0d106447af333&i=afbb5852-7cea-4a81-aa9a-a41aab505c23&a=1274&b=gb_1]]></Tracking>\n<Tracking event="thirdQuartile"><![CDATA[https://bidder.cleanmediaads.com/pix/1275/tq/imp_5c24924de4b0d106447af333/im.gif?r=imp_5c24924de4b0d106447af333&i=afbb5852-7cea-4a81-aa9a-a41aab505c23&a=1274&b=gb_1]]></Tracking>\n<Tracking event="complete"><![CDATA[https://bidder.cleanmediaads.com/pix/1275/comp/imp_5c24924de4b0d106447af333/im.gif?r=imp_5c24924de4b0d106447af333&i=afbb5852-7cea-4a81-aa9a-a41aab505c23&a=1274&b=gb_1]]></Tracking>\n</TrackingEvents>\n</Linear>\n</Creative>\n</Creatives>\n</Wrapper>\n</Ad>\n</VAST>\n',
|
|
458
|
-
cid: '3668',
|
|
459
|
-
crid: '1274',
|
|
460
|
-
cat: [],
|
|
461
|
-
attr: [],
|
|
462
|
-
h: 250,
|
|
463
|
-
w: 300,
|
|
464
|
-
ext: {
|
|
465
|
-
vast_url:
|
|
466
|
-
'https://bidder.cleanmediaads.com/pix/1275/vast_o/imp_5c24924de4b0d106447af333/im.xml?r=imp_5c24924de4b0d106447af333&i=afbb5852-7cea-4a81-aa9a-a41aab505c23&a=1274&b=gb_1&w=300&h=250&vatu=aHR0cHM6Ly9zdGF0aWMuZ2FtYmlkLmlvL2RlbW8vdmFzdC54bWw&vwarv',
|
|
467
|
-
imptrackers: [
|
|
468
|
-
'https://bidder.cleanmediaads.com/pix/1275/imp/imp_5c24924de4b0d106447af333/im.gif?r=imp_5c24924de4b0d106447af333&i=afbb5852-7cea-4a81-aa9a-a41aab505c23&a=1274&b=gb_1'
|
|
469
|
-
]
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
]
|
|
473
|
-
}
|
|
474
|
-
],
|
|
475
|
-
ext: {
|
|
476
|
-
utrk: [
|
|
477
|
-
{
|
|
478
|
-
type: 'image',
|
|
479
|
-
url:
|
|
480
|
-
'https://bidder.cleanmediaads.com/pix/1275/scm?cb=1545900621675'
|
|
481
|
-
}
|
|
482
|
-
]
|
|
483
|
-
}
|
|
484
|
-
};
|
|
588
|
+
it('supports configuring outstream renderers', () => {
|
|
485
589
|
const videoRequest = utils.deepClone(videoBidRequest);
|
|
486
590
|
videoRequest.mediaTypes.video.context = 'outstream';
|
|
487
|
-
const result = spec.interpretResponse(
|
|
488
|
-
{ body: videoResponse },
|
|
489
|
-
{ bidRequest: videoRequest }
|
|
490
|
-
);
|
|
591
|
+
const result = spec.interpretResponse({body: videoResponse}, {bidRequest: videoRequest});
|
|
491
592
|
expect(result[0].renderer).to.not.equal(undefined);
|
|
492
593
|
});
|
|
493
594
|
|
|
494
|
-
it('validates in/existing of gdpr consent',
|
|
495
|
-
let
|
|
496
|
-
id: '64f32497-b2f7-48ec-9205-35fc39894d44',
|
|
497
|
-
bidid: 'imp_5c24924de4b0d106447af333',
|
|
498
|
-
cur: 'USD',
|
|
499
|
-
seatbid: [
|
|
500
|
-
{
|
|
501
|
-
seat: '3668',
|
|
502
|
-
group: 0,
|
|
503
|
-
bid: [
|
|
504
|
-
{
|
|
505
|
-
id: 'gb_1',
|
|
506
|
-
impid: 'afbb5852-7cea-4a81-aa9a-a41aab505c23',
|
|
507
|
-
price: 5.0,
|
|
508
|
-
adid: '1274',
|
|
509
|
-
nurl:
|
|
510
|
-
'https://bidder.cleanmediaads.com/pix/1275/win_notice/imp_5c24924de4b0d106447af333/im.gif?r=imp_5c24924de4b0d106447af333&i=afbb5852-7cea-4a81-aa9a-a41aab505c23&a=1274&b=gb_1',
|
|
511
|
-
adomain: [],
|
|
512
|
-
adm:
|
|
513
|
-
'<?xml version="1.0" encoding="UTF-8"?><VAST version="2.0">\n<Ad id="afbb5852-7cea-4a81-aa9a-a41aab505c23">\n<Wrapper>\n<AdSystem version="2.0"><![CDATA[cleanmediaads.com]]></AdSystem>\n<VASTAdTagURI><![CDATA[https://static.gambid.io/demo/vast.xml]]></VASTAdTagURI>\n<Error><![CDATA[https://bidder.cleanmediaads.com/pix/1275/verror/imp_5c24924de4b0d106447af333/im.gif?r=imp_5c24924de4b0d106447af333&i=afbb5852-7cea-4a81-aa9a-a41aab505c23&a=1274&b=gb_1&error=[ERRORCODE]]]></Error>\n<Impression><![CDATA[https://bidder.cleanmediaads.com/pix/1275/vimp/imp_5c24924de4b0d106447af333/im.gif?r=imp_5c24924de4b0d106447af333&i=afbb5852-7cea-4a81-aa9a-a41aab505c23&a=1274&b=gb_1]]></Impression>\n<Creatives>\n<Creative AdID="1274">\n<Linear>\n<TrackingEvents>\n<Tracking event="start"><![CDATA[https://bidder.cleanmediaads.com/pix/1275/start/imp_5c24924de4b0d106447af333/im.gif?r=imp_5c24924de4b0d106447af333&i=afbb5852-7cea-4a81-aa9a-a41aab505c23&a=1274&b=gb_1]]></Tracking>\n<Tracking event="firstQuartile"><![CDATA[https://bidder.cleanmediaads.com/pix/1275/fq/imp_5c24924de4b0d106447af333/im.gif?r=imp_5c24924de4b0d106447af333&i=afbb5852-7cea-4a81-aa9a-a41aab505c23&a=1274&b=gb_1]]></Tracking>\n<Tracking event="midpoint"><![CDATA[https://bidder.cleanmediaads.com/pix/1275/mp/imp_5c24924de4b0d106447af333/im.gif?r=imp_5c24924de4b0d106447af333&i=afbb5852-7cea-4a81-aa9a-a41aab505c23&a=1274&b=gb_1]]></Tracking>\n<Tracking event="thirdQuartile"><![CDATA[https://bidder.cleanmediaads.com/pix/1275/tq/imp_5c24924de4b0d106447af333/im.gif?r=imp_5c24924de4b0d106447af333&i=afbb5852-7cea-4a81-aa9a-a41aab505c23&a=1274&b=gb_1]]></Tracking>\n<Tracking event="complete"><![CDATA[https://bidder.cleanmediaads.com/pix/1275/comp/imp_5c24924de4b0d106447af333/im.gif?r=imp_5c24924de4b0d106447af333&i=afbb5852-7cea-4a81-aa9a-a41aab505c23&a=1274&b=gb_1]]></Tracking>\n</TrackingEvents>\n</Linear>\n</Creative>\n</Creatives>\n</Wrapper>\n</Ad>\n</VAST>\n',
|
|
514
|
-
cid: '3668',
|
|
515
|
-
crid: '1274',
|
|
516
|
-
cat: [],
|
|
517
|
-
attr: [],
|
|
518
|
-
h: 250,
|
|
519
|
-
w: 300,
|
|
520
|
-
ext: {
|
|
521
|
-
vast_url:
|
|
522
|
-
'https://bidder.cleanmediaads.com/pix/1275/vast_o/imp_5c24924de4b0d106447af333/im.xml?r=imp_5c24924de4b0d106447af333&i=afbb5852-7cea-4a81-aa9a-a41aab505c23&a=1274&b=gb_1&w=300&h=250&vatu=aHR0cHM6Ly9zdGF0aWMuZ2FtYmlkLmlvL2RlbW8vdmFzdC54bWw&vwarv',
|
|
523
|
-
imptrackers: [
|
|
524
|
-
'https://bidder.cleanmediaads.com/pix/1275/imp/imp_5c24924de4b0d106447af333/im.gif?r=imp_5c24924de4b0d106447af333&i=afbb5852-7cea-4a81-aa9a-a41aab505c23&a=1274&b=gb_1'
|
|
525
|
-
]
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
|
-
]
|
|
529
|
-
}
|
|
530
|
-
],
|
|
531
|
-
ext: {
|
|
532
|
-
utrk: [
|
|
533
|
-
{
|
|
534
|
-
type: 'image',
|
|
535
|
-
url:
|
|
536
|
-
'https://bidder.cleanmediaads.com/pix/1275/scm?cb=1545900621675'
|
|
537
|
-
}
|
|
538
|
-
]
|
|
539
|
-
}
|
|
540
|
-
};
|
|
541
|
-
let gdprConsent = {
|
|
542
|
-
gdprApplies: true,
|
|
543
|
-
consentString: 'consent string'
|
|
544
|
-
};
|
|
545
|
-
let result = spec.getUserSyncs(
|
|
546
|
-
{},
|
|
547
|
-
[{ body: videoResponse }],
|
|
548
|
-
gdprConsent
|
|
549
|
-
);
|
|
595
|
+
it('validates in/existing of gdpr consent', () => {
|
|
596
|
+
let result = spec.getUserSyncs({}, [{body: videoResponse}], gdprConsent, 'cleanmediaCCPA');
|
|
550
597
|
expect(result).to.be.an('array');
|
|
551
598
|
expect(result.length).to.equal(1);
|
|
552
599
|
expect(result[0].type).to.equal('image');
|
|
553
|
-
expect(result[0].url).to.equal(
|
|
554
|
-
'https://bidder.cleanmediaads.com/pix/1275/scm?cb=1545900621675&gc=consent%20string'
|
|
555
|
-
);
|
|
600
|
+
expect(result[0].url).to.equal('https://bidder.cleanmediaads.com/pix/1275/scm?cb=1545900621675&gdpr=1&consent=consent%20string&us_privacy=cleanmediaCCPA');
|
|
556
601
|
|
|
557
602
|
gdprConsent.gdprApplies = false;
|
|
558
|
-
result = spec.getUserSyncs({}, [{
|
|
603
|
+
result = spec.getUserSyncs({}, [{body: videoResponse}], gdprConsent, 'cleanmediaCCPA');
|
|
559
604
|
expect(result).to.be.an('array');
|
|
560
605
|
expect(result.length).to.equal(1);
|
|
561
606
|
expect(result[0].type).to.equal('image');
|
|
562
|
-
expect(result[0].url).to.equal(
|
|
563
|
-
'https://bidder.cleanmediaads.com/pix/1275/scm?cb=1545900621675&gc=missing'
|
|
564
|
-
);
|
|
607
|
+
expect(result[0].url).to.equal('https://bidder.cleanmediaads.com/pix/1275/scm?cb=1545900621675&gdpr=0&consent=&us_privacy=cleanmediaCCPA');
|
|
565
608
|
|
|
566
|
-
videoResponse.ext.utrk[0].url =
|
|
567
|
-
|
|
568
|
-
result
|
|
609
|
+
videoResponse.ext.utrk[0].url = 'https://bidder.cleanmediaads.com/pix/1275/scm';
|
|
610
|
+
result = spec.getUserSyncs({}, [{body: videoResponse}], gdprConsent);
|
|
611
|
+
expect(result).to.be.an('array');
|
|
612
|
+
expect(result.length).to.equal(1);
|
|
613
|
+
expect(result[0].type).to.equal('image');
|
|
614
|
+
expect(result[0].url).to.equal('https://bidder.cleanmediaads.com/pix/1275/scm');
|
|
615
|
+
});
|
|
616
|
+
|
|
617
|
+
it('validates existence of gdpr, gdpr consent and usp consent', () => {
|
|
618
|
+
let result = spec.getUserSyncs({}, [{body: videoResponse}], gdprConsent, 'cleanmediaCCPA');
|
|
619
|
+
expect(result).to.be.an('array');
|
|
620
|
+
expect(result.length).to.equal(1);
|
|
621
|
+
expect(result[0].type).to.equal('image');
|
|
622
|
+
expect(result[0].url).to.equal('https://bidder.cleanmediaads.com/pix/1275/scm?cb=1545900621675&gdpr=1&consent=consent%20string&us_privacy=cleanmediaCCPA');
|
|
623
|
+
|
|
624
|
+
gdprConsent.gdprApplies = false;
|
|
625
|
+
result = spec.getUserSyncs({}, [{body: videoResponse}], gdprConsent, '');
|
|
569
626
|
expect(result).to.be.an('array');
|
|
570
627
|
expect(result.length).to.equal(1);
|
|
571
628
|
expect(result[0].type).to.equal('image');
|
|
572
|
-
expect(result[0].url).to.equal(
|
|
573
|
-
'https://bidder.cleanmediaads.com/pix/1275/scm?gc=missing'
|
|
574
|
-
);
|
|
629
|
+
expect(result[0].url).to.equal('https://bidder.cleanmediaads.com/pix/1275/scm?cb=1545900621675&gdpr=0&consent=&us_privacy=');
|
|
575
630
|
});
|
|
576
631
|
});
|
|
577
632
|
});
|