prebid.js 7.48.0 → 7.50.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/README.md +3 -0
- 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/admixerBidAdapter.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adtrgtmeBidAdapter.js +1 -1
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/adyoulikeBidAdapter.js +1 -1
- package/dist/aidemBidAdapter.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/beopBidAdapter.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/carodaBidAdapter.js +1 -1
- package/dist/chtnwBidAdapter.js +1 -1
- package/dist/concertBidAdapter.js +1 -1
- package/dist/confiantRtdProvider.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/dependencies.json +3 -0
- 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/greenbidsAnalyticsAdapter.js +1 -1
- package/dist/greenbidsRtdProvider.js +1 -1
- package/dist/gridBidAdapter.js +1 -1
- package/dist/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.js +1 -1
- package/dist/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/kulturemediaBidAdapter.js +1 -1
- package/dist/lassoBidAdapter.js +1 -1
- package/dist/lifestreetBidAdapter.js +1 -1
- package/dist/liveIntentIdSystem.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/nexx360BidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +136 -134
- 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/prebidServerBidAdapter.js +1 -1
- package/dist/publinkIdSystem.js +1 -1
- package/dist/pubmaticAnalyticsAdapter.js +1 -1
- package/dist/pubmaticBidAdapter.js +1 -1
- package/dist/pubwiseAnalyticsAdapter.js +1 -1
- package/dist/pxyzBidAdapter.js +1 -1
- package/dist/quantcastBidAdapter.js +1 -1
- package/dist/readpeakBidAdapter.js +1 -1
- package/dist/relaidoBidAdapter.js +1 -1
- package/dist/retailspotBidAdapter.js +1 -0
- 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/silverpushBidAdapter.js +1 -0
- 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 -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/uid2IdSystem.js +1 -1
- package/dist/underdogmediaBidAdapter.js +1 -1
- package/dist/undertoneBidAdapter.js +1 -1
- package/dist/vidazooBidAdapter.js +1 -1
- package/dist/video.js +1 -1
- package/dist/videoModule.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/yieldlabBidAdapter.js +1 -1
- package/dist/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/integrationExamples/videoModule/eventsUI/eventsUI.css +205 -0
- package/integrationExamples/videoModule/eventsUI/eventsUI.js +181 -0
- package/integrationExamples/videoModule/jwplayer/eventsUI.html +295 -0
- package/integrationExamples/videoModule/videojs/eventsUI.html +319 -0
- package/libraries/video/shared/helpers.js +14 -0
- package/modules/33acrossBidAdapter.js +1 -1
- package/modules/adgenerationBidAdapter.js +24 -15
- package/modules/admixerBidAdapter.js +15 -9
- package/modules/aidemBidAdapter.js +3 -1
- package/modules/appnexusBidAdapter.js +1 -0
- package/modules/beopBidAdapter.js +1 -0
- package/modules/confiantRtdProvider.js +15 -12
- package/modules/conversantAnalyticsAdapter.js +7 -5
- package/modules/conversantBidAdapter.js +1 -1
- package/modules/criteoBidAdapter.js +17 -1
- package/modules/gridBidAdapter.js +3 -0
- package/modules/ixBidAdapter.js +65 -47
- package/modules/kueezRtbBidAdapter.js +30 -33
- package/modules/liveIntentIdSystem.js +8 -4
- package/modules/magniteAnalyticsAdapter.js +26 -3
- package/modules/mgidBidAdapter.js +9 -8
- package/modules/minutemediaBidAdapter.js +6 -0
- package/modules/minutemediaplusBidAdapter.js +30 -32
- package/modules/nexx360BidAdapter.js +2 -1
- package/modules/permutiveRtdProvider.js +9 -38
- package/modules/prebidServerBidAdapter/index.js +1 -3
- package/modules/prebidServerBidAdapter/ortbConverter.js +5 -1
- package/modules/pubmaticAnalyticsAdapter.js +3 -2
- package/modules/retailspotBidAdapter .md +32 -0
- package/modules/retailspotBidAdapter.js +186 -0
- package/modules/riseBidAdapter.js +6 -0
- package/modules/rubiconBidAdapter.js +6 -2
- package/modules/silverpushBidAdapter.js +326 -0
- package/modules/silverpushBidAdapter.md +107 -0
- package/modules/ttdBidAdapter.js +23 -22
- package/modules/underdogmediaBidAdapter.js +2 -2
- package/modules/vidazooBidAdapter.js +28 -32
- package/modules/videoModule/adQueue.js +2 -2
- package/modules/videoModule/index.js +9 -5
- package/modules/yahoosspBidAdapter.js +6 -0
- package/modules/yahoosspBidAdapter.md +37 -0
- package/modules/yieldlabBidAdapter.js +27 -5
- package/package.json +1 -1
- package/src/adapterManager.js +4 -0
- package/src/adapters/bidderFactory.js +1 -0
- package/src/auction.js +2 -0
- package/src/prebid.js +36 -12
- package/src/utils/cpm.js +4 -1
- package/test/spec/modules/33acrossBidAdapter_spec.js +4 -3
- package/test/spec/modules/adgenerationBidAdapter_spec.js +6 -6
- package/test/spec/modules/admixerBidAdapter_spec.js +64 -25
- package/test/spec/modules/aidemBidAdapter_spec.js +3 -0
- package/test/spec/modules/beopBidAdapter_spec.js +4 -0
- package/test/spec/modules/confiantRtdProvider_spec.js +4 -1
- package/test/spec/modules/conversantBidAdapter_spec.js +2 -1
- package/test/spec/modules/criteoBidAdapter_spec.js +109 -0
- package/test/spec/modules/gridBidAdapter_spec.js +3 -0
- package/test/spec/modules/ixBidAdapter_spec.js +66 -1
- package/test/spec/modules/kueezRtbBidAdapter_spec.js +3 -2
- package/test/spec/modules/liveIntentIdMinimalSystem_spec.js +28 -0
- package/test/spec/modules/liveIntentIdSystem_spec.js +45 -0
- package/test/spec/modules/magniteAnalyticsAdapter_spec.js +16 -36
- package/test/spec/modules/mass_spec.js +2 -0
- package/test/spec/modules/mgidBidAdapter_spec.js +9 -9
- package/test/spec/modules/minutemediaBidAdapter_spec.js +18 -0
- package/test/spec/modules/minutemediaplusBidAdapter_spec.js +3 -2
- package/test/spec/modules/permutiveRtdProvider_spec.js +0 -20
- package/test/spec/modules/prebidServerBidAdapter_spec.js +96 -1
- package/test/spec/modules/pubmaticAnalyticsAdapter_spec.js +6 -1
- package/test/spec/modules/retailspotBidAdapter_spec.js +426 -0
- package/test/spec/modules/riseBidAdapter_spec.js +18 -0
- package/test/spec/modules/rubiconBidAdapter_spec.js +143 -67
- package/test/spec/modules/silverpushBidAdapter_spec.js +394 -0
- package/test/spec/modules/ttdBidAdapter_spec.js +129 -2
- package/test/spec/modules/underdogmediaBidAdapter_spec.js +1 -1
- package/test/spec/modules/vidazooBidAdapter_spec.js +3 -2
- package/test/spec/modules/videoModule/shared/helpers_spec.js +22 -0
- package/test/spec/modules/yahoosspBidAdapter_spec.js +60 -1
- package/test/spec/modules/yieldlabBidAdapter_spec.js +8 -1
- package/test/spec/unit/core/bidderFactory_spec.js +9 -9
- package/test/spec/unit/pbjs_api_spec.js +59 -1
- package/test/spec/unit/utils/cpm_spec.js +56 -1
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
import { expect } from 'chai';
|
|
2
|
+
|
|
3
|
+
import { spec } from 'modules/retailspotBidAdapter.js';
|
|
4
|
+
import { newBidder } from 'src/adapters/bidderFactory.js';
|
|
5
|
+
|
|
6
|
+
describe('RetailSpot Adapter', function () {
|
|
7
|
+
const canonicalUrl = 'https://canonical.url/?t=%26';
|
|
8
|
+
const referrerUrl = 'http://referrer.url/?param=value';
|
|
9
|
+
const pageUrl = 'http://page.url/?param=value';
|
|
10
|
+
const domain = 'domain:123';
|
|
11
|
+
const env = 'preprod';
|
|
12
|
+
const consentString = 'BOJ8RZsOJ8RZsABAB8AAAAAZ+A==';
|
|
13
|
+
const bidderRequest = {
|
|
14
|
+
'auctionId': '1d1a030790a475',
|
|
15
|
+
'bidderRequestId': '22edbae2733bf6',
|
|
16
|
+
'timeout': 3000,
|
|
17
|
+
'gdprConsent': {
|
|
18
|
+
consentString: consentString,
|
|
19
|
+
gdprApplies: true
|
|
20
|
+
},
|
|
21
|
+
refererInfo: {location: referrerUrl, canonicalUrl, domain, topmostLocation: 'fakePageURL'},
|
|
22
|
+
ortb2: {site: {page: pageUrl, ref: referrerUrl}}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const bidRequestWithSinglePlacement = [
|
|
26
|
+
{
|
|
27
|
+
'bidId': 'bid_id_0',
|
|
28
|
+
'bidder': 'retailspot',
|
|
29
|
+
'placementCode': 'adunit/hb-0',
|
|
30
|
+
'params': {
|
|
31
|
+
'placement': 'placement_0'
|
|
32
|
+
},
|
|
33
|
+
'sizes': '300x250',
|
|
34
|
+
'mediaTypes': {
|
|
35
|
+
'banner': {
|
|
36
|
+
'sizes': ['300x250']
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
'transactionId': 'bid_id_0_transaction_id'
|
|
40
|
+
}
|
|
41
|
+
];
|
|
42
|
+
|
|
43
|
+
const bidRequestWithMultipleMediatype = [
|
|
44
|
+
{
|
|
45
|
+
'bidId': 'bid_id_0',
|
|
46
|
+
'bidder': 'retailspot',
|
|
47
|
+
'placementCode': 'adunit/hb-0',
|
|
48
|
+
'params': {
|
|
49
|
+
'placement': 'placement_0'
|
|
50
|
+
},
|
|
51
|
+
'sizes': '300x250',
|
|
52
|
+
'mediaTypes': {
|
|
53
|
+
'banner': {
|
|
54
|
+
'sizes': ['640x480']
|
|
55
|
+
},
|
|
56
|
+
'video': {
|
|
57
|
+
'playerSize': [640, 480],
|
|
58
|
+
'context': 'outstream'
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
'transactionId': 'bid_id_0_transaction_id'
|
|
62
|
+
}
|
|
63
|
+
];
|
|
64
|
+
|
|
65
|
+
const sentBidVideo = [
|
|
66
|
+
{
|
|
67
|
+
'bidId': 'bid_id_0',
|
|
68
|
+
'placement': 'test-1234',
|
|
69
|
+
'video': {
|
|
70
|
+
'playerSize': [640, 480]
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
];
|
|
74
|
+
|
|
75
|
+
const bidRequestWithDevPlacement = [
|
|
76
|
+
{
|
|
77
|
+
'bidId': 'bid_id_0',
|
|
78
|
+
'bidder': 'retailspot',
|
|
79
|
+
'placementCode': 'adunit/hb-0',
|
|
80
|
+
'params': {
|
|
81
|
+
'placement': 'placement_0',
|
|
82
|
+
'env': 'dev'
|
|
83
|
+
},
|
|
84
|
+
'sizes': '300x250',
|
|
85
|
+
'mediaTypes':
|
|
86
|
+
{ 'banner':
|
|
87
|
+
{'sizes': ['300x250']
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
'transactionId': 'bid_id_0_transaction_id'
|
|
91
|
+
}
|
|
92
|
+
];
|
|
93
|
+
|
|
94
|
+
const bidRequestMultiPlacements = [
|
|
95
|
+
{
|
|
96
|
+
'bidId': 'bid_id_0',
|
|
97
|
+
'bidder': 'retailspot',
|
|
98
|
+
'placementCode': 'adunit/hb-0',
|
|
99
|
+
'params': {
|
|
100
|
+
'placement': 'placement_0'
|
|
101
|
+
},
|
|
102
|
+
'sizes': '300x250',
|
|
103
|
+
'mediaTypes':
|
|
104
|
+
{ 'banner':
|
|
105
|
+
{'sizes': ['300x250']
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
'transactionId': 'bid_id_0_transaction_id'
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
'bidId': 'bid_id_1',
|
|
112
|
+
'bidder': 'retailspot',
|
|
113
|
+
'placementCode': 'adunit/hb-1',
|
|
114
|
+
'params': {
|
|
115
|
+
'placement': 'placement_1'
|
|
116
|
+
},
|
|
117
|
+
'sizes': [[300, 600]],
|
|
118
|
+
'mediaTypes':
|
|
119
|
+
{ 'banner':
|
|
120
|
+
{'sizes': ['300x600']
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
'transactionId': 'bid_id_1_transaction_id'
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
'bidId': 'bid_id_2',
|
|
127
|
+
'bidder': 'retailspot',
|
|
128
|
+
'placementCode': 'adunit/hb-2',
|
|
129
|
+
'params': {},
|
|
130
|
+
'sizes': '300x400',
|
|
131
|
+
'transactionId': 'bid_id_2_transaction_id'
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
'bidId': 'bid_id_3',
|
|
135
|
+
'bidder': 'retailspot',
|
|
136
|
+
'placementCode': 'adunit/hb-3',
|
|
137
|
+
'params': {
|
|
138
|
+
'placement': 'placement_3'
|
|
139
|
+
},
|
|
140
|
+
'transactionId': 'bid_id_3_transaction_id'
|
|
141
|
+
}
|
|
142
|
+
];
|
|
143
|
+
|
|
144
|
+
const requestDataOnePlacement = [
|
|
145
|
+
{
|
|
146
|
+
'bidId': 'bid_id_0',
|
|
147
|
+
'placement': 'e622af275681965d3095808561a1e510',
|
|
148
|
+
'width': 300,
|
|
149
|
+
'height': 600
|
|
150
|
+
}
|
|
151
|
+
]
|
|
152
|
+
|
|
153
|
+
const requestDataMultiPlacement = [
|
|
154
|
+
{
|
|
155
|
+
'bidId': 'bid_id_0',
|
|
156
|
+
'placement': 'e622af275681965d3095808561a1e510',
|
|
157
|
+
'width': 300,
|
|
158
|
+
'height': 600
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
'bidId': 'bid_id_1',
|
|
162
|
+
'placement': 'e622af275681965d3095808561a1e510',
|
|
163
|
+
'width': 400,
|
|
164
|
+
'height': 250
|
|
165
|
+
}
|
|
166
|
+
]
|
|
167
|
+
|
|
168
|
+
const testMetaObject = {
|
|
169
|
+
'networkId': 123,
|
|
170
|
+
'advertiserId': '3',
|
|
171
|
+
'advertiserName': 'foobar',
|
|
172
|
+
'advertiserDomains': ['foobar.com'],
|
|
173
|
+
'brandId': '345',
|
|
174
|
+
'brandName': 'Foo',
|
|
175
|
+
'primaryCatId': '34',
|
|
176
|
+
'secondaryCatIds': ['IAB-222', 'IAB-333'],
|
|
177
|
+
'mediaType': 'banner'
|
|
178
|
+
};
|
|
179
|
+
const admSample = "\u003cscript id=\"ayl-prebid-a11a121205932e75e622af275681965d\"\u003e\n(function(){\n\twindow.isPrebid = true\n\tvar prebidResults = /*PREBID*/{\"OnEvents\": {\"CLICK\": [{\"Kind\": \"PIXEL_URL\",\"Url\": \"https://testPixelCLICK.com/fake\"}],\"IMPRESSION\": [{\"Kind\": \"PIXEL_URL\",\"Url\": \"https://testPixelIMP.com/fake\"}, {\"Kind\": \"JAVASCRIPT_URL\",\"Url\": \"https://testJsIMP.com/fake.js\"}]},\"Disabled\": false,\"Attempt\": \"a11a121205932e75e622af275681965d\",\"ApiPrefix\": \"https://fo-api.omnitagjs.com/fo-api\",\"TrackingPrefix\": \"https://tracking.omnitagjs.com/tracking\",\"DynamicPrefix\": \"https://tag-dyn.omnitagjs.com/fo-dyn\",\"StaticPrefix\": \"https://fo-static.omnitagjs.com/fo-static\",\"BlobPrefix\": \"https://fo-api.omnitagjs.com/fo-api/blobs\",\"SspPrefix\": \"https://fo-ssp.omnitagjs.com/fo-ssp\",\"VisitorPrefix\": \"https://visitor.omnitagjs.com/visitor\",\"Trusted\": true,\"Placement\": \"e622af275681965d3095808561a1e510\",\"PlacementAccess\": \"ALL\",\"Site\": \"6e2df7a92203c3c7a25561ed63f25a27\",\"Lang\": \"EN\",\"SiteLogo\": null,\"HasSponsorImage\": true,\"ResizeIframe\": true,\"IntegrationConfig\": {\"Kind\": \"WIDGET\",\"Widget\": {\"ExtraStyleSheet\": \"\",\"Placeholders\": {\"Body\": {\"Color\": {\"R\": 77,\"G\": 21,\"B\": 82,\"A\": 100},\"BackgroundColor\": {\"R\": 255,\"G\": 255,\"B\": 255,\"A\": 100},\"FontFamily\": \"Lato\",\"Width\": \"100%\",\"Align\": \"\",\"BoxShadow\": true},\"CallToAction\": {\"Color\": {\"R\": 26,\"G\": 157,\"B\": 212,\"A\": 100}},\"Description\": {\"Length\": 130},\"Image\": {\"Width\": 600,\"Height\": 600,\"Lowres\": false,\"Raw\": false},\"Size\": {\"Height\": \"250px\",\"Width\": \"300px\"},\"Title\": {\"Color\": {\"R\": 219,\"G\": 181,\"B\": 255,\"A\": 100}}},\"Selector\": {\"Kind\": \"CSS\",\"Css\": \"#ayl-prebid-a11a121205932e75e622af275681965d\"},\"Insertion\": \"AFTER\",\"ClickFormat\": true,\"Creative20\": true,\"WidgetKind\": \"CREATIVE_TEMPLATE_4\"}},\"Legal\": \"Sponsored\",\"ForcedCampaign\": \"f1c80d4bb5643c222ae8de75e9b2f991\",\"ForcedTrack\": \"\",\"ForcedCreative\": \"\",\"ForcedSource\": \"\",\"DisplayMode\": \"DEFAULT\",\"Campaign\": \"f1c80d4bb5643c222ae8de75e9b2f991\",\"CampaignAccess\": \"ALL\",\"CampaignKind\": \"AD_TRAFFIC\",\"DataSource\": \"LOCAL\",\"DataSourceUrl\": \"\",\"DataSourceOnEventsIsolated\": false,\"DataSourceWithoutCookie\": false,\"Content\": {\"Preview\": {\"Thumbnail\": {\"Image\": {\"Kind\": \"EXTERNAL\",\"Data\": {\"External\": {\"Url\": \"https://tag-dyn.omnitagjs.com/fo-dyn/native/preview/image?key=fd4362d35bb174d6f1c80d4bb5643c22\\u0026kind=INTERNAL\\u0026ztop=0.000000\\u0026zleft=0.000000\\u0026zwidth=0.333333\\u0026zheight=1.000000\\u0026width=[width]\\u0026height=[height]\"}},\"ZoneTop\": 0,\"ZoneLeft\": 0,\"ZoneWidth\": 1,\"ZoneHeight\": 1,\"Smart\": false,\"NoTransform\": false,\"Quality\": \"NORMAL\"}},\"Text\": {\"CALLTOACTION\": \"Click here to learn more\",\"DESCRIPTION\": \"Considérant l'extrémité conjoncturelle, il serait bon d'anticiper toutes les voies de bon sens.\",\"SPONSOR\": \"Tested by\",\"TITLE\": \"Adserver Traffic Redirect Internal\"},\"Sponsor\": {\"Name\": \"QA Team\",\"Logo\": {\"Resource\": {\"Kind\": \"EXTERNAL\",\"Data\": {\"External\": {\"Url\": \"https://fo-static.omnitagjs.com/fo-static/native/images/info-ayl.svg\"}},\"ZoneTop\": 0,\"ZoneLeft\": 0,\"ZoneWidth\": 1,\"ZoneHeight\": 1,\"Smart\": false,\"NoTransform\": false,\"Quality\": \"NORMAL\"}}},\"Credit\": {\"Logo\": {\"Resource\": {\"Kind\": \"EXTERNAL\",\"Data\": {\"External\": {\"Url\": \"https://fo-static.omnitagjs.com/fo-static/native/images/info-ayl.png\"}},\"ZoneTop\": 0,\"ZoneLeft\": 0,\"ZoneWidth\": 1,\"ZoneHeight\": 1,\"Smart\": false,\"NoTransform\": false,\"Quality\": \"NORMAL\"}},\"Url\": \"https://blobs.omnitagjs.com/adchoice/\"}},\"Landing\": {\"Url\": \"https://www.w3.org/People/mimasa/test/xhtml/entities/entities-11.xhtml#lat1\",\"LegacyTracking\": false},\"ViewButtons\": {\"Close\": {\"Skip\": 6000}},\"InternalContentFields\": {\"AnimatedImage\": false}},\"AdDomain\": \"retailspot.com\",\"Opener\": \"REDIRECT\",\"PerformUITriggers\": [\"CLICK\"],\"RedirectionTarget\": \"TAB\"}/*PREBID*/;\n\tvar insertAds = function insertAds() {\insertAds();\n\t}\n})();\n\u003c/script\u003e";
|
|
180
|
+
const responseWithSinglePlacement = [
|
|
181
|
+
{
|
|
182
|
+
'requestId': 'bid_id_0',
|
|
183
|
+
'placement': 'placement_0',
|
|
184
|
+
'ad': admSample,
|
|
185
|
+
'cpm': 0.5,
|
|
186
|
+
'height': 250,
|
|
187
|
+
'width': 300,
|
|
188
|
+
'meta': testMetaObject,
|
|
189
|
+
'mediaType': 'banner'
|
|
190
|
+
}
|
|
191
|
+
];
|
|
192
|
+
|
|
193
|
+
const responseWithSingleVideo = [{
|
|
194
|
+
'requestId': 'bid_id_0',
|
|
195
|
+
'placement': 'placement_0',
|
|
196
|
+
'vastXml': 'PFZBU1Q+RW1wdHkgc2FtcGxlPC92YXN0Pg==',
|
|
197
|
+
'cpm': 0.5,
|
|
198
|
+
'height': 300,
|
|
199
|
+
'width': 530,
|
|
200
|
+
'mediaType': 'video',
|
|
201
|
+
'creativeId': 'testvideo123',
|
|
202
|
+
'netRevenue': true,
|
|
203
|
+
'currency': 'USD',
|
|
204
|
+
'adId': 'fakeAdID',
|
|
205
|
+
'dealId': 'fakeDealId'
|
|
206
|
+
}];
|
|
207
|
+
|
|
208
|
+
const videoResult = [{
|
|
209
|
+
bidderCode: 'retailspot',
|
|
210
|
+
cpm: 0.5,
|
|
211
|
+
creativeId: 'testvideo123',
|
|
212
|
+
currency: 'USD',
|
|
213
|
+
height: 300,
|
|
214
|
+
netRevenue: true,
|
|
215
|
+
requestId: 'bid_id_0',
|
|
216
|
+
ttl: 3600,
|
|
217
|
+
mediaType: 'video',
|
|
218
|
+
meta: {
|
|
219
|
+
advertiserDomains: ['retail-spot.io']
|
|
220
|
+
},
|
|
221
|
+
vastXml: '<VAST>Empty sample</vast>',
|
|
222
|
+
width: 530,
|
|
223
|
+
adId: 'fakeAdID',
|
|
224
|
+
dealId: 'fakeDealId'
|
|
225
|
+
}];
|
|
226
|
+
|
|
227
|
+
const responseWithMultiplePlacements = [
|
|
228
|
+
{
|
|
229
|
+
'requestId': 'bid_id_0',
|
|
230
|
+
'mediaType': 'banner',
|
|
231
|
+
'placement': 'placement_0',
|
|
232
|
+
'ad': 'placement_0',
|
|
233
|
+
'cpm': 0.5,
|
|
234
|
+
'height': 0, // test with wrong value
|
|
235
|
+
'width': 300,
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
'requestId': 'bid_id_1',
|
|
239
|
+
'mediaType': 'banner',
|
|
240
|
+
'placement': 'placement_1',
|
|
241
|
+
'ad': 'placement_1',
|
|
242
|
+
'cpm': 0.6,
|
|
243
|
+
'height': 250
|
|
244
|
+
// 'width' test with missing value
|
|
245
|
+
}
|
|
246
|
+
];
|
|
247
|
+
const adapter = newBidder(spec);
|
|
248
|
+
|
|
249
|
+
const DEV_URL = 'http://localhost:8090/';
|
|
250
|
+
|
|
251
|
+
describe('inherited functions', function () {
|
|
252
|
+
it('exists and is a function', function () {
|
|
253
|
+
expect(adapter.callBids).to.exist.and.to.be.a('function');
|
|
254
|
+
});
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
describe('isBidRequestValid', function () {
|
|
258
|
+
let bid = {
|
|
259
|
+
'bidId': 'bid_id_1',
|
|
260
|
+
'bidder': 'retailspot',
|
|
261
|
+
'placementCode': 'adunit/hb-1',
|
|
262
|
+
'params': {
|
|
263
|
+
'placement': 'placement_1'
|
|
264
|
+
},
|
|
265
|
+
'sizes': [[300, 600]],
|
|
266
|
+
'transactionId': 'bid_id_1_transaction_id'
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
let bidWSize = {
|
|
270
|
+
'bidId': 'bid_id_1',
|
|
271
|
+
'bidder': 'retailspot',
|
|
272
|
+
'placementCode': 'adunit/hb-1',
|
|
273
|
+
'params': {
|
|
274
|
+
'placement': 'placement_1',
|
|
275
|
+
'size': [250, 300],
|
|
276
|
+
},
|
|
277
|
+
'transactionId': 'bid_id_1_transaction_id'
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
it('should return true when required params found', function () {
|
|
281
|
+
expect(!!spec.isBidRequestValid(bid)).to.equal(true);
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
it('should return true when required params found with size in bid params', function () {
|
|
285
|
+
expect(!!spec.isBidRequestValid(bidWSize)).to.equal(true);
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
it('should return false when required params are not passed', function () {
|
|
289
|
+
let bid = Object.assign({}, bid);
|
|
290
|
+
delete bid.size;
|
|
291
|
+
|
|
292
|
+
expect(!!spec.isBidRequestValid(bid)).to.equal(false);
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
it('should return false when required params are not passed', function () {
|
|
296
|
+
let bid = Object.assign({}, bid);
|
|
297
|
+
delete bid.params;
|
|
298
|
+
bid.params = {
|
|
299
|
+
'placement': 0
|
|
300
|
+
};
|
|
301
|
+
expect(!!spec.isBidRequestValid(bid)).to.equal(false);
|
|
302
|
+
});
|
|
303
|
+
});
|
|
304
|
+
|
|
305
|
+
describe('buildRequests', function () {
|
|
306
|
+
it('should add gdpr/usp consent information to the request', function () {
|
|
307
|
+
let consentString = 'BOJ8RZsOJ8RZsABAB8AAAAAZ+A==';
|
|
308
|
+
let uspConsentData = '1YCC';
|
|
309
|
+
let bidderRequest = {
|
|
310
|
+
'auctionId': '1d1a030790a475',
|
|
311
|
+
'bidderRequestId': '22edbae2733bf6',
|
|
312
|
+
'timeout': 3000,
|
|
313
|
+
'gdprConsent': {
|
|
314
|
+
consentString: consentString,
|
|
315
|
+
gdprApplies: true
|
|
316
|
+
},
|
|
317
|
+
'uspConsent': uspConsentData
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
bidderRequest.Bids = bidRequestWithSinglePlacement;
|
|
321
|
+
|
|
322
|
+
const request = spec.buildRequests(bidRequestWithSinglePlacement, bidderRequest);
|
|
323
|
+
const payload = JSON.parse(request.data);
|
|
324
|
+
|
|
325
|
+
expect(payload.gdprConsent).to.exist;
|
|
326
|
+
expect(payload.gdprConsent.consentString).to.exist.and.to.equal(consentString);
|
|
327
|
+
expect(payload.uspConsent).to.exist.and.to.equal(uspConsentData);
|
|
328
|
+
});
|
|
329
|
+
|
|
330
|
+
it('sends bid request to endpoint with single placement', function () {
|
|
331
|
+
bidderRequest.Bids = bidRequestWithSinglePlacement;
|
|
332
|
+
|
|
333
|
+
const request = spec.buildRequests(bidRequestWithSinglePlacement, bidderRequest);
|
|
334
|
+
const payload = JSON.parse(request.data);
|
|
335
|
+
|
|
336
|
+
expect(request.url).to.contain('https://ssp.retail-spot.io/prebid');
|
|
337
|
+
expect(request.method).to.equal('POST');
|
|
338
|
+
|
|
339
|
+
expect(payload).to.deep.equal(bidderRequest);
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
it('sends bid request to endpoint with single placement multiple mediatype', function () {
|
|
343
|
+
bidderRequest.Bids = bidRequestWithMultipleMediatype;
|
|
344
|
+
const request = spec.buildRequests(bidRequestWithSinglePlacement, bidderRequest);
|
|
345
|
+
const payload = JSON.parse(request.data);
|
|
346
|
+
|
|
347
|
+
expect(request.url).to.contain('https://ssp.retail-spot.io/prebid');
|
|
348
|
+
expect(request.method).to.equal('POST');
|
|
349
|
+
|
|
350
|
+
expect(payload).to.deep.equal(bidderRequest);
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
it('sends bid request to endpoint with multiple placements', function () {
|
|
354
|
+
bidderRequest.Bids = bidRequestMultiPlacements;
|
|
355
|
+
const request = spec.buildRequests(bidRequestMultiPlacements, bidderRequest);
|
|
356
|
+
const payload = JSON.parse(request.data);
|
|
357
|
+
|
|
358
|
+
expect(request.url).to.contain('https://ssp.retail-spot.io/prebid');
|
|
359
|
+
expect(request.method).to.equal('POST');
|
|
360
|
+
|
|
361
|
+
expect(payload).to.deep.equal(bidderRequest);
|
|
362
|
+
});
|
|
363
|
+
|
|
364
|
+
it('sends bid request to endpoint setted by parameters', function () {
|
|
365
|
+
const request = spec.buildRequests(bidRequestWithDevPlacement, bidderRequest);
|
|
366
|
+
expect(request.url).to.contain(DEV_URL);
|
|
367
|
+
});
|
|
368
|
+
});
|
|
369
|
+
//
|
|
370
|
+
describe('interpretResponse', function () {
|
|
371
|
+
let serverResponse;
|
|
372
|
+
|
|
373
|
+
beforeEach(function () {
|
|
374
|
+
serverResponse = {
|
|
375
|
+
body: {}
|
|
376
|
+
}
|
|
377
|
+
});
|
|
378
|
+
|
|
379
|
+
it('handles nobid responses', function () {
|
|
380
|
+
let response = [{
|
|
381
|
+
requestId: '123dfsdf',
|
|
382
|
+
placement: '12df1'
|
|
383
|
+
}];
|
|
384
|
+
serverResponse.body = response;
|
|
385
|
+
let result = spec.interpretResponse(serverResponse, []);
|
|
386
|
+
expect(result).deep.equal([]);
|
|
387
|
+
});
|
|
388
|
+
|
|
389
|
+
it('receive reponse with single placement', function () {
|
|
390
|
+
serverResponse.body = responseWithSinglePlacement;
|
|
391
|
+
let result = spec.interpretResponse(serverResponse, {data: '{"bids":' + JSON.stringify(requestDataOnePlacement) + '}'});
|
|
392
|
+
|
|
393
|
+
expect(result.length).to.equal(1);
|
|
394
|
+
expect(result[0].cpm).to.equal(0.5);
|
|
395
|
+
expect(result[0].ad).to.equal(admSample);
|
|
396
|
+
expect(result[0].width).to.equal(300);
|
|
397
|
+
expect(result[0].height).to.equal(250);
|
|
398
|
+
expect(result[0].meta).to.deep.equal(testMetaObject);
|
|
399
|
+
});
|
|
400
|
+
|
|
401
|
+
it('receive reponse with multiple placement', function () {
|
|
402
|
+
serverResponse.body = responseWithMultiplePlacements;
|
|
403
|
+
let result = spec.interpretResponse(serverResponse, {data: '{"bids":' + JSON.stringify(requestDataMultiPlacement) + '}'});
|
|
404
|
+
|
|
405
|
+
expect(result.length).to.equal(2);
|
|
406
|
+
|
|
407
|
+
expect(result[0].cpm).to.equal(0.5);
|
|
408
|
+
expect(result[0].ad).to.equal('placement_0');
|
|
409
|
+
expect(result[0].width).to.equal(300);
|
|
410
|
+
expect(result[0].height).to.equal(600);
|
|
411
|
+
|
|
412
|
+
expect(result[1].cpm).to.equal(0.6);
|
|
413
|
+
expect(result[1].ad).to.equal('placement_1');
|
|
414
|
+
expect(result[1].width).to.equal(400);
|
|
415
|
+
expect(result[1].height).to.equal(250);
|
|
416
|
+
});
|
|
417
|
+
|
|
418
|
+
it('receive Vast reponse with Video ad', function () {
|
|
419
|
+
serverResponse.body = responseWithSingleVideo;
|
|
420
|
+
let result = spec.interpretResponse(serverResponse, {data: '{"bids":' + JSON.stringify(sentBidVideo) + '}'});
|
|
421
|
+
|
|
422
|
+
expect(result.length).to.equal(1);
|
|
423
|
+
expect(result).to.deep.equal(videoResult);
|
|
424
|
+
});
|
|
425
|
+
});
|
|
426
|
+
});
|
|
@@ -341,6 +341,24 @@ describe('riseAdapter', function () {
|
|
|
341
341
|
expect(request.data.bids[0]).to.be.an('object');
|
|
342
342
|
expect(request.data.bids[0]).to.have.property('floorPrice', 1.5);
|
|
343
343
|
});
|
|
344
|
+
|
|
345
|
+
describe('COPPA Param', function() {
|
|
346
|
+
it('should set coppa equal 0 in bid request if coppa is set to false', function() {
|
|
347
|
+
const request = spec.buildRequests(bidRequests, bidderRequest);
|
|
348
|
+
expect(request.data.bids[0].coppa).to.be.equal(0);
|
|
349
|
+
});
|
|
350
|
+
|
|
351
|
+
it('should set coppa equal 1 in bid request if coppa is set to true', function() {
|
|
352
|
+
const bid = utils.deepClone(bidRequests[0]);
|
|
353
|
+
bid.ortb2 = {
|
|
354
|
+
'regs': {
|
|
355
|
+
'coppa': true,
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
const request = spec.buildRequests([bid], bidderRequest);
|
|
359
|
+
expect(request.data.bids[0].coppa).to.be.equal(1);
|
|
360
|
+
});
|
|
361
|
+
});
|
|
344
362
|
});
|
|
345
363
|
|
|
346
364
|
describe('interpretResponse', function () {
|