prebid.js 5.17.0 → 5.18.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/modules/adgenerationBidAdapter.js +28 -4
- package/modules/adkernelBidAdapter.js +2 -1
- package/modules/admixerBidAdapter.js +11 -0
- package/modules/aolBidAdapter.js +2 -1
- package/modules/bliinkBidAdapter.js +58 -32
- package/modules/bliinkBidAdapter.md +29 -6
- package/modules/cwireBidAdapter.js +272 -0
- package/modules/cwireBidAdapter.md +43 -0
- package/modules/dgkeywordRtdProvider.js +0 -1
- package/modules/livewrappedAnalyticsAdapter.js +4 -2
- package/modules/mediakeysBidAdapter.js +2 -1
- package/modules/nativoBidAdapter.js +1 -1
- package/modules/oguryBidAdapter.js +22 -6
- package/modules/pixfutureBidAdapter.js +24 -4
- package/modules/pixfutureBidAdapter.md +127 -0
- package/modules/prebidServerBidAdapter/index.js +1 -1
- package/modules/proxistoreBidAdapter.js +4 -6
- package/modules/pubmaticBidAdapter.js +9 -0
- package/modules/pubmaticBidAdapter.md +1 -1
- package/modules/talkadsBidAdapter.js +129 -0
- package/modules/talkadsBidAdapter.md +60 -0
- package/modules/unicornBidAdapter.js +3 -3
- package/modules/visxBidAdapter.js +15 -22
- package/modules/yahoosspBidAdapter.js +637 -0
- package/modules/yahoosspBidAdapter.md +795 -0
- package/modules/yieldlabBidAdapter.js +48 -3
- package/modules/yieldlabBidAdapter.md +16 -1
- package/package.json +1 -1
- package/test/spec/modules/adgenerationBidAdapter_spec.js +121 -50
- package/test/spec/modules/bliinkBidAdapter_spec.js +87 -36
- package/test/spec/modules/cwireBidAdapter_spec.js +246 -0
- package/test/spec/modules/livewrappedAnalyticsAdapter_spec.js +17 -7
- package/test/spec/modules/oguryBidAdapter_spec.js +72 -25
- package/test/spec/modules/pubmaticBidAdapter_spec.js +39 -1
- package/test/spec/modules/talkadsBidAdapter_spec.js +231 -0
- package/test/spec/modules/unicornBidAdapter_spec.js +4 -4
- package/test/spec/modules/visxBidAdapter_spec.js +48 -4
- package/test/spec/modules/yahoosspBidAdapter_spec.js +1332 -0
- package/test/spec/modules/yieldlabBidAdapter_spec.js +65 -1
- package/modules/turktelekomBidAdapter.md +0 -49
- package/yarn.lock +0 -13122
|
@@ -8,6 +8,7 @@ import { ajax } from '../src/ajax.js'
|
|
|
8
8
|
const BIDDER_CODE = 'ogury';
|
|
9
9
|
const DEFAULT_TIMEOUT = 1000;
|
|
10
10
|
const BID_HOST = 'https://mweb-hb.presage.io/api/header-bidding-request';
|
|
11
|
+
const TIMEOUT_MONITORING_HOST = 'https://ms-ads-monitoring-events.presage.io';
|
|
11
12
|
const MS_COOKIE_SYNC_DOMAIN = 'https://ms-cookie-sync.presage.io';
|
|
12
13
|
|
|
13
14
|
function isBidRequestValid(bid) {
|
|
@@ -23,10 +24,16 @@ function isBidRequestValid(bid) {
|
|
|
23
24
|
function getUserSyncs(syncOptions, serverResponses, gdprConsent, uspConsent) {
|
|
24
25
|
if (!syncOptions.pixelEnabled) return [];
|
|
25
26
|
|
|
26
|
-
return [
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
return [
|
|
28
|
+
{
|
|
29
|
+
type: 'image',
|
|
30
|
+
url: `${MS_COOKIE_SYNC_DOMAIN}/v1/init-sync/bid-switch?iab_string=${(gdprConsent && gdprConsent.consentString) || ''}&source=prebid`
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
type: 'image',
|
|
34
|
+
url: `${MS_COOKIE_SYNC_DOMAIN}/ttd/init-sync?iab_string=${(gdprConsent && gdprConsent.consentString) || ''}&source=prebid`
|
|
35
|
+
}
|
|
36
|
+
]
|
|
30
37
|
}
|
|
31
38
|
|
|
32
39
|
function buildRequests(validBidRequests, bidderRequest) {
|
|
@@ -40,7 +47,8 @@ function buildRequests(validBidRequests, bidderRequest) {
|
|
|
40
47
|
},
|
|
41
48
|
},
|
|
42
49
|
site: {
|
|
43
|
-
domain: location.hostname
|
|
50
|
+
domain: location.hostname,
|
|
51
|
+
page: location.href
|
|
44
52
|
},
|
|
45
53
|
user: {
|
|
46
54
|
ext: {
|
|
@@ -141,6 +149,13 @@ function onBidWon(bid) {
|
|
|
141
149
|
if (bid && bid.hasOwnProperty('nurl') && bid.nurl.length > 0) ajax(bid['nurl'], null);
|
|
142
150
|
}
|
|
143
151
|
|
|
152
|
+
function onTimeout(timeoutData) {
|
|
153
|
+
ajax(`${TIMEOUT_MONITORING_HOST}/bid_timeout`, null, JSON.stringify(timeoutData[0]), {
|
|
154
|
+
method: 'POST',
|
|
155
|
+
contentType: 'application/json'
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
|
|
144
159
|
export const spec = {
|
|
145
160
|
code: BIDDER_CODE,
|
|
146
161
|
supportedMediaTypes: [BANNER],
|
|
@@ -149,7 +164,8 @@ export const spec = {
|
|
|
149
164
|
buildRequests,
|
|
150
165
|
interpretResponse,
|
|
151
166
|
getFloor,
|
|
152
|
-
onBidWon
|
|
167
|
+
onBidWon,
|
|
168
|
+
onTimeout
|
|
153
169
|
}
|
|
154
170
|
|
|
155
171
|
registerBidder(spec);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { convertCamelToUnderscore, isArray, isNumber, isPlainObject, deepAccess, isEmpty, transformBidderParamKeywords, isFn } from '../src/utils.js';
|
|
2
1
|
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
3
2
|
import { getStorageManager } from '../src/storageManager.js';
|
|
4
3
|
import { BANNER } from '../src/mediaTypes.js';
|
|
5
4
|
import { config } from '../src/config.js';
|
|
6
5
|
import includes from 'core-js-pure/features/array/includes.js';
|
|
6
|
+
import { convertCamelToUnderscore, isArray, isNumber, isPlainObject, deepAccess, isEmpty, transformBidderParamKeywords, isFn } from '../src/utils.js';
|
|
7
7
|
import { auctionManager } from '../src/auctionManager.js';
|
|
8
8
|
import find from 'core-js-pure/features/array/find.js';
|
|
9
9
|
|
|
@@ -12,7 +12,7 @@ const storageManager = getStorageManager();
|
|
|
12
12
|
const USER_PARAMS = ['age', 'externalUid', 'segments', 'gender', 'dnt', 'language'];
|
|
13
13
|
export const spec = {
|
|
14
14
|
code: 'pixfuture',
|
|
15
|
-
hostname: 'https://
|
|
15
|
+
hostname: 'https://gosrv.pixfuture.com',
|
|
16
16
|
|
|
17
17
|
getHostname() {
|
|
18
18
|
let ret = this.hostname;
|
|
@@ -77,7 +77,7 @@ export const spec = {
|
|
|
77
77
|
};
|
|
78
78
|
|
|
79
79
|
if (bidderRequest && bidderRequest.uspConsent) {
|
|
80
|
-
payload.us_privacy = bidderRequest.uspConsent
|
|
80
|
+
payload.us_privacy = bidderRequest.uspConsent;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
if (bidderRequest && bidderRequest.refererInfo) {
|
|
@@ -112,7 +112,7 @@ export const spec = {
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
const ret = {
|
|
115
|
-
url: `${hostname}
|
|
115
|
+
url: `${hostname}/pixservices`,
|
|
116
116
|
method: 'POST',
|
|
117
117
|
options: {withCredentials: false},
|
|
118
118
|
data: {
|
|
@@ -153,6 +153,16 @@ export const spec = {
|
|
|
153
153
|
|
|
154
154
|
return bids;
|
|
155
155
|
},
|
|
156
|
+
getUserSyncs: function (syncOptions, bid, gdprConsent) {
|
|
157
|
+
var pixid = '';
|
|
158
|
+
if (typeof bid[0] === 'undefined' || bid[0] === null) { pixid = '0'; } else { pixid = bid[0].body.pix_id; }
|
|
159
|
+
if (syncOptions.iframeEnabled && hasPurpose1Consent({gdprConsent})) {
|
|
160
|
+
return [{
|
|
161
|
+
type: 'iframe',
|
|
162
|
+
url: 'https://gosrv.pixfuture.com/cookiesync?adsync=' + gdprConsent.consentString + '&pixid=' + pixid + '&gdprconcent=' + gdprConsent.gdprApplies
|
|
163
|
+
}];
|
|
164
|
+
}
|
|
165
|
+
}
|
|
156
166
|
};
|
|
157
167
|
|
|
158
168
|
function newBid(serverBid, rtbBid, placementId, uuid) {
|
|
@@ -179,6 +189,16 @@ function newBid(serverBid, rtbBid, placementId, uuid) {
|
|
|
179
189
|
return bid;
|
|
180
190
|
}
|
|
181
191
|
|
|
192
|
+
function hasPurpose1Consent(bidderRequest) {
|
|
193
|
+
let result = true;
|
|
194
|
+
if (bidderRequest && bidderRequest.gdprConsent) {
|
|
195
|
+
if (bidderRequest.gdprConsent.gdprApplies && bidderRequest.gdprConsent.apiVersion === 2) {
|
|
196
|
+
result = !!(deepAccess(bidderRequest.gdprConsent, 'vendorData.purpose.consents.1') === true);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
return result;
|
|
200
|
+
}
|
|
201
|
+
|
|
182
202
|
// Functions related optional parameters
|
|
183
203
|
function bidToTag(bid) {
|
|
184
204
|
const tag = {};
|
|
@@ -25,3 +25,130 @@ var adUnits = [{
|
|
|
25
25
|
"pix_id": "Abc123"
|
|
26
26
|
}];
|
|
27
27
|
```
|
|
28
|
+
|
|
29
|
+
# Test Example
|
|
30
|
+
...
|
|
31
|
+
<html>
|
|
32
|
+
|
|
33
|
+
<head>
|
|
34
|
+
<link rel="icon" type="image/png" href="/favicon.ico">
|
|
35
|
+
<script async src="//www.googletagservices.com/tag/js/gpt.js"></script>
|
|
36
|
+
<script async src="https://cdn.pixfuture.com/pixfuture_prebidjs/prebid.js"></script>
|
|
37
|
+
<script>
|
|
38
|
+
var div_1_sizes = [
|
|
39
|
+
[300, 250],
|
|
40
|
+
[300, 600]
|
|
41
|
+
];
|
|
42
|
+
var div_2_sizes = [
|
|
43
|
+
[728, 90],
|
|
44
|
+
[970, 250]
|
|
45
|
+
];
|
|
46
|
+
var PREBID_TIMEOUT = 1000;
|
|
47
|
+
var FAILSAFE_TIMEOUT = 3000;
|
|
48
|
+
|
|
49
|
+
var adUnits = [
|
|
50
|
+
{
|
|
51
|
+
code: '/19968336/header-bid-tag-0',
|
|
52
|
+
mediaTypes: {
|
|
53
|
+
banner: {
|
|
54
|
+
sizes: div_1_sizes
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
bids: [{
|
|
58
|
+
bidder: 'pixfuture',
|
|
59
|
+
params: {
|
|
60
|
+
"pix_id": "777"
|
|
61
|
+
}
|
|
62
|
+
}]
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
code: '/19968336/header-bid-tag-1',
|
|
66
|
+
mediaTypes: {
|
|
67
|
+
banner: {
|
|
68
|
+
sizes: div_2_sizes
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
bids: [{
|
|
72
|
+
bidder: 'appnexus',
|
|
73
|
+
params: {
|
|
74
|
+
placementId: 13144370
|
|
75
|
+
}
|
|
76
|
+
}]
|
|
77
|
+
}
|
|
78
|
+
];
|
|
79
|
+
|
|
80
|
+
// ======== DO NOT EDIT BELOW THIS LINE =========== //
|
|
81
|
+
var googletag = googletag || {};
|
|
82
|
+
googletag.cmd = googletag.cmd || [];
|
|
83
|
+
googletag.cmd.push(function() {
|
|
84
|
+
googletag.pubads().disableInitialLoad();
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
var pbjs = pbjs || {};
|
|
88
|
+
pbjs.que = pbjs.que || [];
|
|
89
|
+
|
|
90
|
+
pbjs.que.push(function() {
|
|
91
|
+
pbjs.addAdUnits(adUnits);
|
|
92
|
+
pbjs.requestBids({
|
|
93
|
+
bidsBackHandler: initAdserver,
|
|
94
|
+
timeout: PREBID_TIMEOUT
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
function initAdserver() {
|
|
99
|
+
if (pbjs.initAdserverSet) return;
|
|
100
|
+
pbjs.initAdserverSet = true;
|
|
101
|
+
googletag.cmd.push(function() {
|
|
102
|
+
pbjs.que.push(function() {
|
|
103
|
+
pbjs.setTargetingForGPTAsync();
|
|
104
|
+
googletag.pubads().refresh();
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
// in case PBJS doesn't load
|
|
109
|
+
setTimeout(function() {
|
|
110
|
+
initAdserver();
|
|
111
|
+
}, FAILSAFE_TIMEOUT);
|
|
112
|
+
|
|
113
|
+
googletag.cmd.push(function() {
|
|
114
|
+
googletag.defineSlot('/19968336/header-bid-tag-0', div_1_sizes, 'div-1').addService(googletag.pubads());
|
|
115
|
+
googletag.pubads().enableSingleRequest();
|
|
116
|
+
googletag.enableServices();
|
|
117
|
+
});
|
|
118
|
+
googletag.cmd.push(function() {
|
|
119
|
+
googletag.defineSlot('/19968336/header-bid-tag-1', div_2_sizes, 'div-2').addService(googletag.pubads());
|
|
120
|
+
googletag.pubads().enableSingleRequest();
|
|
121
|
+
googletag.enableServices();
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
</script>
|
|
125
|
+
|
|
126
|
+
</head>
|
|
127
|
+
|
|
128
|
+
<body>
|
|
129
|
+
<h2>Basic Prebid.js Example</h2>
|
|
130
|
+
<h5>Div-1</h5>
|
|
131
|
+
<div id='div-1'>
|
|
132
|
+
<script type='text/javascript'>
|
|
133
|
+
googletag.cmd.push(function() {
|
|
134
|
+
googletag.display('div-1');
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
</script>
|
|
138
|
+
</div>
|
|
139
|
+
|
|
140
|
+
<br>
|
|
141
|
+
|
|
142
|
+
<h5>Div-2</h5>
|
|
143
|
+
<div id='div-2'>
|
|
144
|
+
<script type='text/javascript'>
|
|
145
|
+
googletag.cmd.push(function() {
|
|
146
|
+
googletag.display('div-2');
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
</script>
|
|
150
|
+
</div>
|
|
151
|
+
|
|
152
|
+
</body>
|
|
153
|
+
|
|
154
|
+
</html>
|
|
@@ -799,7 +799,7 @@ const OPEN_RTB_PROTOCOL = {
|
|
|
799
799
|
if (requestedBidders && isArray(requestedBidders)) {
|
|
800
800
|
eidPermissions.forEach(i => {
|
|
801
801
|
if (i.bidders) {
|
|
802
|
-
i.bidders = i.bidders.filter(bidder =>
|
|
802
|
+
i.bidders = i.bidders.filter(bidder => includes(requestedBidders, bidder))
|
|
803
803
|
}
|
|
804
804
|
});
|
|
805
805
|
}
|
|
@@ -4,7 +4,8 @@ import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
|
4
4
|
const BIDDER_CODE = 'proxistore';
|
|
5
5
|
const PROXISTORE_VENDOR_ID = 418;
|
|
6
6
|
const COOKIE_BASE_URL = 'https://abs.proxistore.com/v3/rtb/prebid/multi';
|
|
7
|
-
const COOKIE_LESS_URL =
|
|
7
|
+
const COOKIE_LESS_URL =
|
|
8
|
+
'https://abs.cookieless-proxistore.com/v3/rtb/prebid/multi';
|
|
8
9
|
|
|
9
10
|
function _createServerRequest(bidRequests, bidderRequest) {
|
|
10
11
|
var sizeIds = [];
|
|
@@ -181,11 +182,7 @@ function _assignFloor(bid) {
|
|
|
181
182
|
size: '*',
|
|
182
183
|
});
|
|
183
184
|
|
|
184
|
-
if (
|
|
185
|
-
isPlainObject(floor) &&
|
|
186
|
-
!isNaN(floor.floor) &&
|
|
187
|
-
floor.currency === 'EUR'
|
|
188
|
-
) {
|
|
185
|
+
if (isPlainObject(floor) && !isNaN(floor.floor) && floor.currency === 'EUR') {
|
|
189
186
|
return floor.floor;
|
|
190
187
|
}
|
|
191
188
|
return null;
|
|
@@ -196,6 +193,7 @@ export const spec = {
|
|
|
196
193
|
isBidRequestValid: isBidRequestValid,
|
|
197
194
|
buildRequests: buildRequests,
|
|
198
195
|
interpretResponse: interpretResponse,
|
|
196
|
+
gvlid: PROXISTORE_VENDOR_ID,
|
|
199
197
|
};
|
|
200
198
|
|
|
201
199
|
registerBidder(spec);
|
|
@@ -17,6 +17,7 @@ const DEFAULT_HEIGHT = 0;
|
|
|
17
17
|
const PREBID_NATIVE_HELP_LINK = 'http://prebid.org/dev-docs/show-native-ads.html';
|
|
18
18
|
const PUBLICATION = 'pubmatic'; // Your publication on Blue Billywig, potentially with environment (e.g. publication.bbvms.com or publication.test.bbvms.com)
|
|
19
19
|
const RENDERER_URL = 'https://pubmatic.bbvms.com/r/'.concat('$RENDERER', '.js'); // URL of the renderer application
|
|
20
|
+
const MSG_VIDEO_PLACEMENT_MISSING = 'Video.Placement param missing';
|
|
20
21
|
const CUSTOM_PARAMS = {
|
|
21
22
|
'kadpageurl': '', // Custom page url
|
|
22
23
|
'gender': '', // User gender
|
|
@@ -537,12 +538,20 @@ function _createBannerRequest(bid) {
|
|
|
537
538
|
return bannerObj;
|
|
538
539
|
}
|
|
539
540
|
|
|
541
|
+
export function checkVideoPlacement(videoData, adUnitCode) {
|
|
542
|
+
// Check for video.placement property. If property is missing display log message.
|
|
543
|
+
if (!deepAccess(videoData, 'placement')) {
|
|
544
|
+
logWarn(MSG_VIDEO_PLACEMENT_MISSING + ' for ' + adUnitCode);
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
|
|
540
548
|
function _createVideoRequest(bid) {
|
|
541
549
|
var videoData = mergeDeep(deepAccess(bid.mediaTypes, 'video'), bid.params.video);
|
|
542
550
|
var videoObj;
|
|
543
551
|
|
|
544
552
|
if (videoData !== UNDEFINED) {
|
|
545
553
|
videoObj = {};
|
|
554
|
+
checkVideoPlacement(videoData, bid.adUnitCode);
|
|
546
555
|
for (var key in VIDEO_CUSTOM_PARAMS) {
|
|
547
556
|
if (videoData.hasOwnProperty(key)) {
|
|
548
557
|
videoObj[key] = _checkParamDataType(key, videoData[key], VIDEO_CUSTOM_PARAMS[key]);
|
|
@@ -25,7 +25,7 @@ var adUnits = [
|
|
|
25
25
|
bidder: 'pubmatic',
|
|
26
26
|
params: {
|
|
27
27
|
publisherId: '156209', // required, must be a string, not an integer or other js type.
|
|
28
|
-
|
|
28
|
+
outstreamAU: 'renderer_test_pubmatic', // required if mediaTypes-> video-> context is 'outstream' and optional if renderer is defined in adUnits or in mediaType video. This value can be get by BlueBillyWig Team.
|
|
29
29
|
adSlot: 'pubmatic_test2', // optional, must be a string, not an integer or other js type.
|
|
30
30
|
pmzoneid: 'zone1, zone11', // optional
|
|
31
31
|
lat: '40.712775', // optional
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
2
|
+
import { NATIVE, BANNER } from '../src/mediaTypes.js';
|
|
3
|
+
import * as utils from '../src/utils.js';
|
|
4
|
+
import {ajax} from '../src/ajax.js';
|
|
5
|
+
|
|
6
|
+
const CURRENCY = 'EUR';
|
|
7
|
+
const BIDDER_CODE = 'talkads';
|
|
8
|
+
|
|
9
|
+
export const spec = {
|
|
10
|
+
code: BIDDER_CODE,
|
|
11
|
+
supportedMediaTypes: [ NATIVE, BANNER ],
|
|
12
|
+
params: null,
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Determines whether or not the given bid request is valid.
|
|
16
|
+
*
|
|
17
|
+
* @param poBid The bid params to validate.
|
|
18
|
+
* @return boolean True if this is a valid bid, and false otherwise.
|
|
19
|
+
*/
|
|
20
|
+
isBidRequestValid: (poBid) => {
|
|
21
|
+
utils.logInfo('isBidRequestValid : ', poBid);
|
|
22
|
+
if (poBid.params === undefined) {
|
|
23
|
+
utils.logError('VALIDATION FAILED : the parameters must be defined');
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
if (poBid.params.tag_id === undefined) {
|
|
27
|
+
utils.logError('VALIDATION FAILED : the parameter "tag_id" must be defined');
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
if (poBid.params.bidder_url === undefined) {
|
|
31
|
+
utils.logError('VALIDATION FAILED : the parameter "bidder_url" must be defined');
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
this.params = poBid.params;
|
|
35
|
+
return !!(poBid.nativeParams || poBid.sizes);
|
|
36
|
+
}, // isBidRequestValid
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Make a server request from the list of BidRequests.
|
|
40
|
+
*
|
|
41
|
+
* @param paValidBidRequests An array of bids
|
|
42
|
+
* @param poBidderRequest
|
|
43
|
+
* @return ServerRequest Info describing the request to the server.
|
|
44
|
+
*/
|
|
45
|
+
buildRequests: (paValidBidRequests, poBidderRequest) => {
|
|
46
|
+
utils.logInfo('buildRequests : ', paValidBidRequests, poBidderRequest);
|
|
47
|
+
const laBids = paValidBidRequests.map((poBid, piId) => {
|
|
48
|
+
const loOne = { id: piId, ad_unit: poBid.adUnitCode, bid_id: poBid.bidId, type: '', size: [] };
|
|
49
|
+
if (poBid.nativeParams) {
|
|
50
|
+
loOne.type = 'native';
|
|
51
|
+
} else {
|
|
52
|
+
loOne.type = 'banner';
|
|
53
|
+
loOne.size = poBid.sizes;
|
|
54
|
+
}
|
|
55
|
+
return loOne;
|
|
56
|
+
});
|
|
57
|
+
const loServerRequest = {
|
|
58
|
+
cur: CURRENCY,
|
|
59
|
+
timeout: poBidderRequest.timeout,
|
|
60
|
+
auction_id: paValidBidRequests[0].auctionId,
|
|
61
|
+
transaction_id: paValidBidRequests[0].transactionId,
|
|
62
|
+
bids: laBids,
|
|
63
|
+
gdpr: { applies: false, consent: false },
|
|
64
|
+
};
|
|
65
|
+
if (poBidderRequest && poBidderRequest.gdprConsent) {
|
|
66
|
+
const loGdprConsent = poBidderRequest.gdprConsent;
|
|
67
|
+
if ((typeof loGdprConsent.gdprApplies === 'boolean') && loGdprConsent.gdprApplies) {
|
|
68
|
+
loServerRequest.gdpr.applies = true;
|
|
69
|
+
}
|
|
70
|
+
if ((typeof loGdprConsent.consentString === 'string') && loGdprConsent.consentString) {
|
|
71
|
+
loServerRequest.gdpr.consent = poBidderRequest.gdprConsent.consentString;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
const lsUrl = this.params.bidder_url + '/' + this.params.tag_id;
|
|
75
|
+
return {
|
|
76
|
+
method: 'POST',
|
|
77
|
+
url: lsUrl,
|
|
78
|
+
data: JSON.stringify(loServerRequest),
|
|
79
|
+
};
|
|
80
|
+
}, // buildRequests
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Unpack the response from the server into a list of bids.
|
|
84
|
+
*
|
|
85
|
+
* @param poServerResponse A successful response from the server.
|
|
86
|
+
* @param poPidRequest Request original server request
|
|
87
|
+
* @return An array of bids which were nested inside the server.
|
|
88
|
+
*/
|
|
89
|
+
interpretResponse: (poServerResponse, poPidRequest) => {
|
|
90
|
+
utils.logInfo('interpretResponse : ', poServerResponse);
|
|
91
|
+
if (!poServerResponse.body) {
|
|
92
|
+
return [];
|
|
93
|
+
}
|
|
94
|
+
let laResponse = [];
|
|
95
|
+
if (poServerResponse.body.status !== 'ok') {
|
|
96
|
+
utils.logInfo('Error : ', poServerResponse.body.error);
|
|
97
|
+
return laResponse;
|
|
98
|
+
}
|
|
99
|
+
poServerResponse.body.bids.forEach((poResponse) => {
|
|
100
|
+
laResponse[laResponse.length] = {
|
|
101
|
+
requestId: poResponse.requestId,
|
|
102
|
+
cpm: poResponse.cpm,
|
|
103
|
+
currency: poResponse.currency,
|
|
104
|
+
width: poResponse.width,
|
|
105
|
+
height: poResponse.height,
|
|
106
|
+
ad: poResponse.ad,
|
|
107
|
+
ttl: poResponse.ttl,
|
|
108
|
+
creativeId: poResponse.creativeId,
|
|
109
|
+
netRevenue: poResponse.netRevenue,
|
|
110
|
+
pbid: poServerResponse.body.pbid,
|
|
111
|
+
};
|
|
112
|
+
});
|
|
113
|
+
return laResponse;
|
|
114
|
+
}, // interpretResponse
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Register bidder specific code, which will execute if a bid from this bidder won the auction.
|
|
118
|
+
*
|
|
119
|
+
* @param poBid The bid that won the auction
|
|
120
|
+
*/
|
|
121
|
+
onBidWon: (poBid) => {
|
|
122
|
+
utils.logInfo('onBidWon : ', poBid);
|
|
123
|
+
if (poBid.pbid) {
|
|
124
|
+
ajax(this.params.bidder_url + 'won/' + poBid.pbid);
|
|
125
|
+
}
|
|
126
|
+
}, // onBidWon
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
registerBidder(spec);
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Overview
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
Module Name: TalkAds Adapter
|
|
5
|
+
Module Type: Bidder Adapter
|
|
6
|
+
Maintainer: technical_team@natexo.com
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
# Description
|
|
10
|
+
|
|
11
|
+
Module that connects to TalkAds bidder to fetch bids.
|
|
12
|
+
Both native and banner formats are supported but not at the same time.
|
|
13
|
+
The only currently supported currency is EUR.
|
|
14
|
+
|
|
15
|
+
This adapter requires setup and approval from the Natexo programmatic team.
|
|
16
|
+
|
|
17
|
+
# Configuration
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# Test parameters
|
|
23
|
+
|
|
24
|
+
## Test banner Parameters
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
var adUnits = [
|
|
28
|
+
code: 'prebid_banner_test',
|
|
29
|
+
mediaTypes: {
|
|
30
|
+
banner: {
|
|
31
|
+
sizes: [[300, 250], [300, 600]],
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
bids: [{
|
|
35
|
+
bidder: 'talkads',
|
|
36
|
+
params: {
|
|
37
|
+
tag_id: 0,
|
|
38
|
+
bidder_url: 'https://d.natexo-programmatic.com/tad/tag/testbid',
|
|
39
|
+
},
|
|
40
|
+
}]
|
|
41
|
+
];
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Test native parameters
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
var adUnits = [
|
|
48
|
+
code: 'prebid_native_test',
|
|
49
|
+
mediaTypes: {
|
|
50
|
+
native: {}
|
|
51
|
+
},
|
|
52
|
+
bids: [{
|
|
53
|
+
bidder: 'talkads',
|
|
54
|
+
params: {
|
|
55
|
+
tag_id: 0,
|
|
56
|
+
bidder_url: 'https://d.natexo-programmatic.com/tad/tag/testbid',
|
|
57
|
+
},
|
|
58
|
+
}]
|
|
59
|
+
];
|
|
60
|
+
```
|
|
@@ -8,7 +8,7 @@ const BIDDER_CODE = 'unicorn';
|
|
|
8
8
|
const UNICORN_ENDPOINT = 'https://ds.uncn.jp/pb/0/bid.json';
|
|
9
9
|
const UNICORN_DEFAULT_CURRENCY = 'JPY';
|
|
10
10
|
const UNICORN_PB_COOKIE_KEY = '__pb_unicorn_aud';
|
|
11
|
-
const UNICORN_PB_VERSION = '1.
|
|
11
|
+
const UNICORN_PB_VERSION = '1.1';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Placement ID and Account ID are required.
|
|
@@ -58,11 +58,11 @@ function buildOpenRtbBidRequestPayload(validBidRequests, bidderRequest) {
|
|
|
58
58
|
id: bidderRequest.auctionId,
|
|
59
59
|
at: 1,
|
|
60
60
|
imp,
|
|
61
|
-
cur: UNICORN_DEFAULT_CURRENCY,
|
|
61
|
+
cur: [UNICORN_DEFAULT_CURRENCY],
|
|
62
62
|
site: {
|
|
63
63
|
id: deepAccess(validBidRequests[0], 'params.mediaId') || '',
|
|
64
64
|
publisher: {
|
|
65
|
-
id: deepAccess(validBidRequests[0], 'params.publisherId') || 0
|
|
65
|
+
id: String(deepAccess(validBidRequests[0], 'params.publisherId') || 0)
|
|
66
66
|
},
|
|
67
67
|
domain: window.location.hostname,
|
|
68
68
|
page: window.location.href,
|
|
@@ -168,16 +168,21 @@ export const spec = {
|
|
|
168
168
|
return bidResponses;
|
|
169
169
|
},
|
|
170
170
|
getUserSyncs: function(syncOptions, serverResponses, gdprConsent) {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
if (gdprConsent) {
|
|
174
|
-
|
|
175
|
-
query.push('gdpr_consent=' + encodeURIComponent(gdprConsent.consentString));
|
|
176
|
-
}
|
|
177
|
-
query.push('gdpr_applies=' + encodeURIComponent(
|
|
178
|
-
(typeof gdprConsent.gdprApplies === 'boolean')
|
|
179
|
-
? Number(gdprConsent.gdprApplies) : 1));
|
|
171
|
+
var query = [];
|
|
172
|
+
if (gdprConsent) {
|
|
173
|
+
if (gdprConsent.consentString) {
|
|
174
|
+
query.push('gdpr_consent=' + encodeURIComponent(gdprConsent.consentString));
|
|
180
175
|
}
|
|
176
|
+
query.push('gdpr_applies=' + encodeURIComponent(
|
|
177
|
+
(typeof gdprConsent.gdprApplies === 'boolean')
|
|
178
|
+
? Number(gdprConsent.gdprApplies) : 1));
|
|
179
|
+
}
|
|
180
|
+
if (syncOptions.iframeEnabled) {
|
|
181
|
+
return [{
|
|
182
|
+
type: 'iframe',
|
|
183
|
+
url: buildUrl(ADAPTER_SYNC_PATH) + '?iframe=1' + (query.length ? '&' + query.join('&') : '')
|
|
184
|
+
}];
|
|
185
|
+
} else if (syncOptions.pixelEnabled) {
|
|
181
186
|
return [{
|
|
182
187
|
type: 'image',
|
|
183
188
|
url: buildUrl(ADAPTER_SYNC_PATH) + (query.length ? '?' + query.join('&') : '')
|
|
@@ -230,7 +235,7 @@ function makeVideo(videoParams = {}) {
|
|
|
230
235
|
return result;
|
|
231
236
|
}, { w: deepAccess(videoParams, 'playerSize.0.0'), h: deepAccess(videoParams, 'playerSize.0.1') });
|
|
232
237
|
|
|
233
|
-
if (video.w && video.h
|
|
238
|
+
if (video.w && video.h) {
|
|
234
239
|
return video;
|
|
235
240
|
}
|
|
236
241
|
}
|
|
@@ -347,18 +352,6 @@ function _isValidVideoBid(bid, logErrors = false) {
|
|
|
347
352
|
}
|
|
348
353
|
result = false;
|
|
349
354
|
}
|
|
350
|
-
if (!videoMediaType.mimes) {
|
|
351
|
-
if (logErrors) {
|
|
352
|
-
logError(LOG_ERROR_MESS.videoMissing + 'mimes');
|
|
353
|
-
}
|
|
354
|
-
result = false;
|
|
355
|
-
}
|
|
356
|
-
if (!videoMediaType.protocols) {
|
|
357
|
-
if (logErrors) {
|
|
358
|
-
logError(LOG_ERROR_MESS.videoMissing + 'protocols');
|
|
359
|
-
}
|
|
360
|
-
result = false;
|
|
361
|
-
}
|
|
362
355
|
return result;
|
|
363
356
|
}
|
|
364
357
|
|