prebid.js 6.26.0 → 6.27.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/adWMGAnalyticsAdapter.js +1 -1
- package/dist/adagioAnalyticsAdapter.js +1 -1
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/adkernelAdnAnalyticsAdapter.js +1 -1
- package/dist/adlooxAdServerVideo.js +1 -1
- package/dist/adlooxAnalyticsAdapter.js +1 -1
- package/dist/adlooxRtdProvider.js +1 -1
- package/dist/adomikAnalyticsAdapter.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adxcgAnalyticsAdapter.js +1 -1
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/adxpremiumAnalyticsAdapter.js +1 -1
- package/dist/ajaBidAdapter.js +1 -1
- package/dist/akamaiDapRtdProvider.js +1 -1
- package/dist/amxBidAdapter.js +1 -1
- package/dist/amxIdSystem.js +1 -1
- package/dist/appierAnalyticsAdapter.js +1 -1
- package/dist/appnexusAnalyticsAdapter.js +1 -1
- package/dist/appnexusBidAdapter.js +1 -1
- package/dist/asoBidAdapter.js +1 -1
- package/dist/atsAnalyticsAdapter.js +1 -1
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/bidwatchAnalyticsAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/byDataAnalyticsAdapter.js +1 -1
- package/dist/colossussspBidAdapter.js +1 -1
- package/dist/concertAnalyticsAdapter.js +1 -1
- package/dist/concertBidAdapter.js +1 -1
- package/dist/connectadBidAdapter.js +1 -1
- package/dist/consumableBidAdapter.js +1 -1
- package/dist/conversantBidAdapter.js +1 -1
- package/dist/craftBidAdapter.js +1 -1
- package/dist/criteoBidAdapter.js +1 -1
- package/dist/datablocksAnalyticsAdapter.js +1 -1
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/eplanningAnalyticsAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/fintezaAnalyticsAdapter.js +1 -1
- package/dist/ftrackIdSystem.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/hadronAnalyticsAdapter.js +1 -1
- package/dist/id5AnalyticsAdapter.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/invisiblyAnalyticsAdapter.js +1 -1
- package/dist/ixBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/kargoAnalyticsAdapter.js +1 -1
- package/dist/koblerBidAdapter.js +1 -1
- package/dist/konduitAnalyticsAdapter.js +1 -1
- package/dist/livewrappedAnalyticsAdapter.js +1 -1
- package/dist/liveyieldAnalyticsAdapter.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.js +1 -1
- package/dist/malltvAnalyticsAdapter.js +1 -1
- package/dist/marsmediaAnalyticsAdapter.js +1 -1
- package/dist/marsmediaBidAdapter.js +1 -1
- package/dist/mediafuseBidAdapter.js +1 -1
- package/dist/medianetAnalyticsAdapter.js +1 -1
- package/dist/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/naveggIdSystem.js +1 -1
- package/dist/not-for-prod/prebid.js +153 -152
- package/dist/novatiqIdSystem.js +1 -1
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/oneVideoBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/openxAnalyticsAdapter.js +1 -1
- package/dist/optimonAnalyticsAdapter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/parrableIdSystem.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/prebid-core.js +3 -3
- package/dist/prebidmanagerAnalyticsAdapter.js +1 -1
- package/dist/publinkIdSystem.js +1 -1
- package/dist/pubmaticAnalyticsAdapter.js +1 -1
- package/dist/pubmaticBidAdapter.js +1 -1
- package/dist/pubperfAnalyticsAdapter.js +1 -1
- package/dist/pubstackAnalyticsAdapter.js +1 -1
- package/dist/pubwiseAnalyticsAdapter.js +1 -1
- package/dist/pubxaiAnalyticsAdapter.js +1 -1
- package/dist/pulsepointAnalyticsAdapter.js +1 -1
- package/dist/pxyzBidAdapter.js +1 -1
- package/dist/quantcastBidAdapter.js +1 -1
- package/dist/readpeakBidAdapter.js +1 -1
- package/dist/realvuAnalyticsAdapter.js +1 -1
- package/dist/relaidoBidAdapter.js +1 -1
- package/dist/relevantAnalyticsAdapter.js +1 -1
- package/dist/rhythmoneBidAdapter.js +1 -1
- package/dist/riseBidAdapter.js +1 -1
- package/dist/rivrAnalyticsAdapter.js +1 -1
- package/dist/roxotAnalyticsAdapter.js +1 -1
- package/dist/rubiconAnalyticsAdapter.js +1 -1
- package/dist/rubiconBidAdapter.js +1 -1
- package/dist/scaleableAnalyticsAdapter.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/sigmoidAnalyticsAdapter.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/sonobiAnalyticsAdapter.js +1 -1
- package/dist/sonobiBidAdapter.js +1 -1
- package/dist/sortableAnalyticsAdapter.js +1 -1
- package/dist/sortableBidAdapter.js +1 -1
- package/dist/sovrnAnalyticsAdapter.js +1 -1
- package/dist/sovrnBidAdapter.js +1 -1
- package/dist/sspBCBidAdapter.js +1 -1
- package/dist/staqAnalyticsAdapter.js +1 -1
- package/dist/sublimeBidAdapter.js +1 -1
- package/dist/synacormediaBidAdapter.js +1 -1
- package/dist/taboolaBidAdapter.js +1 -0
- package/dist/targetVideoBidAdapter.js +1 -1
- package/dist/teadsBidAdapter.js +1 -1
- package/dist/terceptAnalyticsAdapter.js +1 -1
- package/dist/trionBidAdapter.js +1 -1
- package/dist/tripleliftBidAdapter.js +1 -1
- package/dist/trustxBidAdapter.js +1 -1
- package/dist/ttdBidAdapter.js +1 -1
- package/dist/ucfunnelAnalyticsAdapter.js +1 -1
- package/dist/underdogmediaBidAdapter.js +1 -1
- package/dist/undertoneBidAdapter.js +1 -1
- package/dist/vidazooBidAdapter.js +1 -1
- package/dist/videobyteBidAdapter.js +1 -1
- package/dist/visxBidAdapter.js +1 -1
- package/dist/vuukleBidAdapter.js +1 -1
- package/dist/widespaceBidAdapter.js +1 -1
- package/dist/winrBidAdapter.js +1 -1
- package/dist/yahoosspBidAdapter.js +1 -1
- package/dist/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/dist/yuktamediaAnalyticsAdapter.js +1 -1
- package/dist/zeta_global_sspAnalyticsAdapter.js +1 -1
- package/integrationExamples/gpt/akamaidap_segments_example.html +5 -3
- package/modules/.submodules.json +1 -0
- package/modules/adlooxAnalyticsAdapter.js +9 -5
- package/modules/adlooxAnalyticsAdapter.md +3 -3
- package/modules/adlooxRtdProvider.js +3 -5
- package/modules/adlooxRtdProvider.md +2 -2
- package/modules/akamaiDapRtdProvider.js +460 -130
- package/modules/akamaiDapRtdProvider.md +5 -3
- package/modules/colossussspBidAdapter.js +17 -17
- package/modules/conversantBidAdapter.js +2 -2
- package/modules/ftrackIdSystem.js +3 -4
- package/modules/hadronAnalyticsAdapter.js +5 -1
- package/modules/koblerBidAdapter.js +54 -45
- package/modules/koblerBidAdapter.md +12 -17
- package/modules/naveggIdSystem.js +3 -2
- package/modules/novatiqIdSystem.js +6 -1
- package/modules/relaidoBidAdapter.js +0 -3
- package/modules/taboolaBidAdapter.js +265 -0
- package/modules/taboolaBidAdapter.md +49 -0
- package/package.json +1 -1
- package/src/AnalyticsAdapter.js +5 -1
- package/src/adloader.js +2 -1
- package/test/mocks/analyticsStub.js +13 -0
- package/test/mocks/xhr.js +22 -0
- package/test/spec/AnalyticsAdapter_spec.js +4 -0
- package/test/spec/modules/akamaiDapRtdProvider_spec.js +402 -108
- package/test/spec/modules/conversantBidAdapter_spec.js +36 -5
- package/test/spec/modules/datablocksBidAdapter_spec.js +9 -8
- package/test/spec/modules/fintezaAnalyticsAdapter_spec.js +4 -4
- package/test/spec/modules/ftrackIdSystem_spec.js +1 -9
- package/test/spec/modules/koblerBidAdapter_spec.js +160 -124
- package/test/spec/modules/naveggIdSystem_spec.js +25 -1
- package/test/spec/modules/proxistoreBidAdapter_spec.js +0 -2
- package/test/spec/modules/sovrnBidAdapter_spec.js +253 -264
- package/test/spec/modules/taboolaBidAdapter_spec.js +455 -0
- package/test/test_deps.js +1 -0
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
import {registerBidder} from '../src/adapters/bidderFactory.js';
|
|
4
|
+
import {BANNER} from '../src/mediaTypes.js';
|
|
5
|
+
import {config} from '../src/config.js';
|
|
6
|
+
import {getWindowSelf, getWindowTop} from '../src/utils.js'
|
|
7
|
+
import {getStorageManager} from '../src/storageManager.js';
|
|
8
|
+
|
|
9
|
+
const BIDDER_CODE = 'taboola';
|
|
10
|
+
const GVLID = 42;
|
|
11
|
+
const CURRENCY = 'USD';
|
|
12
|
+
export const END_POINT_URL = 'http://hb.bidder.taboola.com/TaboolaHBOpenRTBRequestHandlerServlet';
|
|
13
|
+
const USER_ID = 'user-id';
|
|
14
|
+
const STORAGE_KEY = `taboola global:${USER_ID}`;
|
|
15
|
+
const COOKIE_KEY = 'trc_cookie_storage';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* extract User Id by that order:
|
|
19
|
+
* 1. local storage
|
|
20
|
+
* 2. first party cookie
|
|
21
|
+
* 3. rendered trc
|
|
22
|
+
* 4. new user set it to 0
|
|
23
|
+
*/
|
|
24
|
+
export const userData = {
|
|
25
|
+
storageManager: getStorageManager({gvlid: GVLID, bidderCode: BIDDER_CODE}),
|
|
26
|
+
getUserId: () => {
|
|
27
|
+
const {getFromLocalStorage, getFromCookie, getFromTRC} = userData;
|
|
28
|
+
|
|
29
|
+
try {
|
|
30
|
+
return getFromLocalStorage() || getFromCookie() || getFromTRC();
|
|
31
|
+
} catch (ex) {
|
|
32
|
+
return 0;
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
getFromCookie() {
|
|
36
|
+
const {cookiesAreEnabled, getCookie} = userData.storageManager;
|
|
37
|
+
if (cookiesAreEnabled()) {
|
|
38
|
+
const cookieData = getCookie(COOKIE_KEY);
|
|
39
|
+
const userId = userData.getCookieDataByKey(cookieData, USER_ID);
|
|
40
|
+
if (userId) {
|
|
41
|
+
return userId;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
getCookieDataByKey(cookieData, key) {
|
|
46
|
+
const [, value = ''] = cookieData.split(`${key}=`)
|
|
47
|
+
return value;
|
|
48
|
+
},
|
|
49
|
+
getFromLocalStorage() {
|
|
50
|
+
const {hasLocalStorage, localStorageIsEnabled, getDataFromLocalStorage} = userData.storageManager;
|
|
51
|
+
|
|
52
|
+
if (hasLocalStorage() && localStorageIsEnabled()) {
|
|
53
|
+
return getDataFromLocalStorage(STORAGE_KEY);
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
getFromTRC() {
|
|
57
|
+
return window.TRC ? window.TRC.user_id : 0;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export const internal = {
|
|
62
|
+
getPageUrl: (refererInfo = {}) => {
|
|
63
|
+
if (refererInfo.canonicalUrl) {
|
|
64
|
+
return refererInfo.canonicalUrl;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (config.getConfig('pageUrl')) {
|
|
68
|
+
return config.getConfig('pageUrl');
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
try {
|
|
72
|
+
return getWindowTop().location.href;
|
|
73
|
+
} catch (e) {
|
|
74
|
+
return getWindowSelf().location.href;
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
getReferrer: (refererInfo = {}) => {
|
|
78
|
+
if (refererInfo.referer) {
|
|
79
|
+
return refererInfo.referer;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
try {
|
|
83
|
+
return getWindowTop().document.referrer;
|
|
84
|
+
} catch (e) {
|
|
85
|
+
return getWindowSelf().document.referrer;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export const spec = {
|
|
91
|
+
supportedMediaTypes: [BANNER],
|
|
92
|
+
gvlid: GVLID,
|
|
93
|
+
code: BIDDER_CODE,
|
|
94
|
+
isBidRequestValid: (bidRequest) => {
|
|
95
|
+
return !!(bidRequest.sizes &&
|
|
96
|
+
bidRequest.params &&
|
|
97
|
+
bidRequest.params.publisherId &&
|
|
98
|
+
bidRequest.params.tagId);
|
|
99
|
+
},
|
|
100
|
+
buildRequests: (validBidRequests, bidderRequest) => {
|
|
101
|
+
const [bidRequest] = validBidRequests;
|
|
102
|
+
const {refererInfo, gdprConsent = {}, uspConsent} = bidderRequest;
|
|
103
|
+
const {publisherId} = bidRequest.params;
|
|
104
|
+
const site = getSiteProperties(bidRequest.params, refererInfo);
|
|
105
|
+
const device = {ua: navigator.userAgent};
|
|
106
|
+
const imps = getImps(validBidRequests);
|
|
107
|
+
const user = {
|
|
108
|
+
buyeruid: userData.getUserId(gdprConsent, uspConsent),
|
|
109
|
+
ext: {}
|
|
110
|
+
};
|
|
111
|
+
const regs = {
|
|
112
|
+
coppa: 0,
|
|
113
|
+
ext: {}
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
if (gdprConsent.gdprApplies) {
|
|
117
|
+
user.ext.consent = bidderRequest.gdprConsent.consentString;
|
|
118
|
+
regs.ext.gdpr = 1;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (uspConsent) {
|
|
122
|
+
regs.ext.us_privacy = uspConsent;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if (config.getConfig('coppa')) {
|
|
126
|
+
regs.coppa = 1
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const ortb2 = config.getConfig('ortb2') || {
|
|
130
|
+
badv: [],
|
|
131
|
+
bcat: []
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
const request = {
|
|
135
|
+
id: bidderRequest.auctionId,
|
|
136
|
+
imp: imps,
|
|
137
|
+
site,
|
|
138
|
+
device,
|
|
139
|
+
source: {fd: 1},
|
|
140
|
+
tmax: bidderRequest.timeout,
|
|
141
|
+
bcat: ortb2.bcat,
|
|
142
|
+
badv: ortb2.badv,
|
|
143
|
+
user,
|
|
144
|
+
regs
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
const url = [END_POINT_URL, publisherId].join('/');
|
|
148
|
+
|
|
149
|
+
return {
|
|
150
|
+
url,
|
|
151
|
+
method: 'POST',
|
|
152
|
+
data: JSON.stringify(request),
|
|
153
|
+
bids: validBidRequests,
|
|
154
|
+
options: {
|
|
155
|
+
withCredentials: false
|
|
156
|
+
},
|
|
157
|
+
};
|
|
158
|
+
},
|
|
159
|
+
interpretResponse: (serverResponse, {bids}) => {
|
|
160
|
+
if (!bids) {
|
|
161
|
+
return [];
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const {bidResponses, cur: currency} = getBidResponses(serverResponse);
|
|
165
|
+
|
|
166
|
+
if (!bidResponses) {
|
|
167
|
+
return [];
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
return bids.map((bid, id) => getBid(bid.bidId, currency, bidResponses[id])).filter(Boolean);
|
|
171
|
+
},
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
function getSiteProperties({publisherId, bcat = []}, refererInfo) {
|
|
175
|
+
const {getPageUrl, getReferrer} = internal;
|
|
176
|
+
return {
|
|
177
|
+
id: publisherId,
|
|
178
|
+
name: publisherId,
|
|
179
|
+
domain: window.location.host,
|
|
180
|
+
page: getPageUrl(refererInfo),
|
|
181
|
+
ref: getReferrer(refererInfo),
|
|
182
|
+
publisher: {
|
|
183
|
+
id: publisherId
|
|
184
|
+
},
|
|
185
|
+
content: {
|
|
186
|
+
language: navigator.language
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function getImps(validBidRequests) {
|
|
192
|
+
return validBidRequests.map((bid, id) => {
|
|
193
|
+
const {tagId, bidfloor = null, bidfloorcur = CURRENCY} = bid.params;
|
|
194
|
+
|
|
195
|
+
return {
|
|
196
|
+
id: id + 1,
|
|
197
|
+
banner: getBanners(bid),
|
|
198
|
+
tagid: tagId,
|
|
199
|
+
bidfloor,
|
|
200
|
+
bidfloorcur,
|
|
201
|
+
};
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
function getBanners(bid) {
|
|
206
|
+
return getSizes(bid.sizes);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
function getSizes(sizes) {
|
|
210
|
+
return {
|
|
211
|
+
format: sizes.map(size => {
|
|
212
|
+
return {
|
|
213
|
+
w: size[0],
|
|
214
|
+
h: size[1]
|
|
215
|
+
}
|
|
216
|
+
})
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
function getBidResponses({body}) {
|
|
221
|
+
if (!body) {
|
|
222
|
+
return [];
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
const {seatbid, cur} = body;
|
|
226
|
+
|
|
227
|
+
if (!seatbid.length || !seatbid[0].bid) {
|
|
228
|
+
return [];
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
return {
|
|
232
|
+
bidResponses: seatbid[0].bid,
|
|
233
|
+
cur
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
function getBid(requestId, currency, bidResponse) {
|
|
238
|
+
if (!bidResponse) {
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
const {
|
|
243
|
+
price: cpm, crid: creativeId, adm: ad, w: width, h: height, adomain: advertiserDomains, meta = {}
|
|
244
|
+
} = bidResponse;
|
|
245
|
+
|
|
246
|
+
if (advertiserDomains && advertiserDomains.length > 0) {
|
|
247
|
+
meta.advertiserDomains = advertiserDomains
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
return {
|
|
251
|
+
requestId,
|
|
252
|
+
ttl: 360,
|
|
253
|
+
mediaType: BANNER,
|
|
254
|
+
cpm,
|
|
255
|
+
creativeId,
|
|
256
|
+
currency,
|
|
257
|
+
ad,
|
|
258
|
+
width,
|
|
259
|
+
height,
|
|
260
|
+
meta,
|
|
261
|
+
netRevenue: false
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
registerBidder(spec);
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Overview
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
Module Name: Taboola Adapter
|
|
5
|
+
Module Type: Bidder Adapter
|
|
6
|
+
Maintainer: prebid@taboola.com
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
# Description
|
|
10
|
+
|
|
11
|
+
Module that connects to Taboola bidder to fetch bids.
|
|
12
|
+
- Supports `display` format
|
|
13
|
+
- Uses `OpenRTB` standard
|
|
14
|
+
|
|
15
|
+
The Taboola Bidding adapter requires setup before beginning. Please contact us on prebid@taboola.com
|
|
16
|
+
|
|
17
|
+
# Test Display Parameters
|
|
18
|
+
``` javascript
|
|
19
|
+
var adUnits = [{
|
|
20
|
+
code: 'your-unit-container-id',
|
|
21
|
+
mediaTypes: {
|
|
22
|
+
banner: {
|
|
23
|
+
sizes: [[300, 250], [300,600]]
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
bids: [{
|
|
27
|
+
bidder: 'taboola',
|
|
28
|
+
params: {
|
|
29
|
+
tagId: 'tester-placement', // Placement Name
|
|
30
|
+
publisherId: 'tester-pub', // your-publisher-id
|
|
31
|
+
bidfloor: 0.25, // Optional - default is null
|
|
32
|
+
bcat: ['IAB1-1'], // Optional - default is []
|
|
33
|
+
badv: ['example.com'] // Optional - default is []
|
|
34
|
+
}
|
|
35
|
+
}]
|
|
36
|
+
}];
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
# Parameters
|
|
40
|
+
|
|
41
|
+
| Name | Scope | Description | Example | Type |
|
|
42
|
+
|----------------|----------|---------------------------------------------------------|----------------------------|--------------|
|
|
43
|
+
| `tagId` | required | Tag ID / Placement Name <br>(as provided by Taboola) | `'Below The Article'` | `String` |
|
|
44
|
+
| `publisherId` | required | Alphabetic Publisher ID <br>(as provided by Taboola) | `'acme-publishing'` | `String` |
|
|
45
|
+
| `bcat` | optional | List of blocked advertiser categories (IAB) | `['IAB1-1']` | `Array` |
|
|
46
|
+
| `badv` | optional | Blocked Advertiser Domains | `'example.com'` | `String Url` |
|
|
47
|
+
| `bidfloor` | optional | CPM bid floor | `0.25` | `Integer` |
|
|
48
|
+
|
|
49
|
+
|
package/package.json
CHANGED
package/src/AnalyticsAdapter.js
CHANGED
|
@@ -3,6 +3,10 @@ import { ajax } from './ajax.js';
|
|
|
3
3
|
import { logMessage, _each } from './utils.js';
|
|
4
4
|
import * as events from './events.js'
|
|
5
5
|
|
|
6
|
+
export const _internal = {
|
|
7
|
+
ajax
|
|
8
|
+
};
|
|
9
|
+
|
|
6
10
|
const {
|
|
7
11
|
EVENTS: {
|
|
8
12
|
AUCTION_INIT,
|
|
@@ -61,7 +65,7 @@ export default function AnalyticsAdapter({ url, analyticsType, global, handler }
|
|
|
61
65
|
}
|
|
62
66
|
|
|
63
67
|
function _callEndpoint({ eventType, args, callback }) {
|
|
64
|
-
ajax(url, callback, JSON.stringify({ eventType, args }));
|
|
68
|
+
_internal.ajax(url, callback, JSON.stringify({ eventType, args }));
|
|
65
69
|
}
|
|
66
70
|
|
|
67
71
|
function _enqueue({ eventType, args }) {
|
package/src/adloader.js
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {_internal} from '../../src/AnalyticsAdapter.js';
|
|
2
|
+
|
|
3
|
+
before(() => {
|
|
4
|
+
// stub out analytics networking to avoid random events polluting the global xhr mock
|
|
5
|
+
disableAjaxForAnalytics();
|
|
6
|
+
})
|
|
7
|
+
|
|
8
|
+
export function disableAjaxForAnalytics() {
|
|
9
|
+
sinon.stub(_internal, 'ajax').callsFake(() => null);
|
|
10
|
+
}
|
|
11
|
+
export function enableAjaxForAnalytics() {
|
|
12
|
+
_internal.ajax.restore();
|
|
13
|
+
}
|
package/test/mocks/xhr.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import {getUniqueIdentifierStr} from '../../src/utils.js';
|
|
1
2
|
|
|
2
3
|
export let server = sinon.createFakeServer();
|
|
3
4
|
export let xhr = global.XMLHttpRequest;
|
|
@@ -7,3 +8,24 @@ beforeEach(function() {
|
|
|
7
8
|
server = sinon.createFakeServer();
|
|
8
9
|
xhr = global.XMLHttpRequest;
|
|
9
10
|
});
|
|
11
|
+
|
|
12
|
+
const bid = getUniqueIdentifierStr().substring(4);
|
|
13
|
+
let fid = 0;
|
|
14
|
+
|
|
15
|
+
/* eslint-disable */
|
|
16
|
+
afterEach(function () {
|
|
17
|
+
if (this?.currentTest?.state === 'failed') {
|
|
18
|
+
const prepend = (() => {
|
|
19
|
+
const preamble = `[Failure ${bid}-${fid++}]`;
|
|
20
|
+
return (s) => s.split('\n').map(s => `${preamble} ${s}`).join('\n');
|
|
21
|
+
})();
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
console.log(prepend(`XHR mock state after failure (for test '${this.currentTest.fullTitle()}'): ${server.requests.length} requests`))
|
|
25
|
+
server.requests.forEach((req, i) => {
|
|
26
|
+
console.log(prepend(`Request #${i}:`));
|
|
27
|
+
console.log(prepend(JSON.stringify(req, null, 2)));
|
|
28
|
+
})
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
/* eslint-enable */
|
|
@@ -2,6 +2,7 @@ import { expect } from 'chai';
|
|
|
2
2
|
import * as events from 'src/events.js';
|
|
3
3
|
import CONSTANTS from 'src/constants.json';
|
|
4
4
|
import { server } from 'test/mocks/xhr.js';
|
|
5
|
+
import {disableAjaxForAnalytics, enableAjaxForAnalytics} from '../mocks/analyticsStub.js';
|
|
5
6
|
|
|
6
7
|
const REQUEST_BIDS = CONSTANTS.EVENTS.REQUEST_BIDS;
|
|
7
8
|
const BID_REQUESTED = CONSTANTS.EVENTS.BID_REQUESTED;
|
|
@@ -25,6 +26,9 @@ FEATURE: Analytics Adapters API
|
|
|
25
26
|
AND an \`example\` instance of \`AnalyticsAdapter\`\n`, () => {
|
|
26
27
|
let adapter;
|
|
27
28
|
|
|
29
|
+
before(enableAjaxForAnalytics);
|
|
30
|
+
after(disableAjaxForAnalytics);
|
|
31
|
+
|
|
28
32
|
beforeEach(function () {
|
|
29
33
|
adapter = new AnalyticsAdapter(config);
|
|
30
34
|
});
|