prebid.js 7.30.0 → 7.32.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/adkernelBidAdapter.js +1 -1
- package/dist/adlooxRtdProvider.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adtrgtmeBidAdapter.js +1 -1
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/aidemBidAdapter.js +1 -1
- package/dist/ajaBidAdapter.js +1 -1
- package/dist/alkimiBidAdapter.js +1 -1
- package/dist/amxBidAdapter.js +1 -1
- package/dist/amxIdSystem.js +1 -1
- package/dist/aolBidAdapter.js +1 -1
- package/dist/appierAnalyticsAdapter.js +1 -1
- package/dist/appnexusBidAdapter.js +1 -1
- package/dist/appushBidAdapter.js +1 -0
- 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/carodaBidAdapter.js +1 -1
- package/dist/chtnwBidAdapter.js +1 -1
- package/dist/concertBidAdapter.js +1 -1
- package/dist/confiantRtdProvider.js +1 -0
- package/dist/connectIdSystem.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/datawrkzBidAdapter.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/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/holidBidAdapter.js +1 -0
- 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/jwplayerVideoProvider.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/medianetRtdProvider.js +1 -1
- package/dist/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/nexx360BidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +131 -127
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/orbitsoftBidAdapter.js +1 -0
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/parrableIdSystem.js +1 -1
- package/dist/pbsExtensions.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/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/rhythmoneBidAdapter.js +1 -1
- package/dist/riseBidAdapter.js +1 -1
- package/dist/rubiconAnalyticsAdapter.js +1 -1
- package/dist/rubiconBidAdapter.js +1 -1
- package/dist/seedingAllianceBidAdapter.js +1 -1
- package/dist/seedtagBidAdapter.js +1 -1
- package/dist/sharethroughAnalyticsAdapter.js +1 -1
- package/dist/sharethroughBidAdapter.js +1 -1
- package/dist/shinezBidAdapter.js +1 -1
- package/dist/smaatoBidAdapter.js +1 -1
- package/dist/smartadserverBidAdapter.js +1 -1
- package/dist/smartxBidAdapter.js +1 -1
- package/dist/smilewantedBidAdapter.js +1 -1
- package/dist/sonobiBidAdapter.js +1 -1
- package/dist/sovrnAnalyticsAdapter.js +1 -1
- package/dist/sovrnBidAdapter.js +1 -1
- package/dist/sspBCBidAdapter.js +1 -1
- package/dist/sublimeBidAdapter.js +1 -1
- package/dist/synacormediaBidAdapter.js +1 -1
- package/dist/taboolaBidAdapter.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/yieldlabBidAdapter.js +1 -1
- package/dist/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/integrationExamples/gpt/adloox.html +5 -0
- package/libraries/pbsExtensions/processors/adUnitCode.js +13 -0
- package/libraries/pbsExtensions/processors/pbs.js +5 -0
- package/modules/.submodules.json +1 -0
- package/modules/adagioBidAdapter.js +0 -4
- package/modules/adagioBidAdapter.md +4 -22
- package/modules/adkernelBidAdapter.js +2 -1
- package/modules/adlooxAnalyticsAdapter.md +5 -3
- package/modules/adlooxRtdProvider.js +82 -278
- package/modules/adlooxRtdProvider.md +6 -6
- package/modules/aidemBidAdapter.js +4 -0
- package/modules/aidemBidAdapter.md +1 -0
- package/modules/alkimiBidAdapter.js +23 -6
- package/modules/aolBidAdapter.js +12 -0
- package/modules/appnexusBidAdapter.js +2 -2
- package/modules/appushBidAdapter.js +188 -0
- package/modules/appushBidAdapter.md +79 -0
- package/modules/asoBidAdapter.js +8 -5
- package/modules/confiantRtdProvider.js +128 -0
- package/modules/confiantRtdProvider.md +45 -0
- package/modules/connectIdSystem.js +15 -1
- package/modules/datawrkzBidAdapter.js +24 -4
- package/modules/feedadBidAdapter.js +17 -7
- package/modules/holidBidAdapter.js +170 -0
- package/modules/holidBidAdapter.md +36 -0
- package/modules/jwplayerVideoProvider.js +10 -3
- package/modules/kueezRtbBidAdapter.js +21 -8
- package/modules/medianetRtdProvider.js +4 -4
- package/modules/nexx360BidAdapter.js +5 -7
- package/modules/orbitsoftBidAdapter.js +150 -0
- package/modules/permutiveRtdProvider.js +1 -1
- package/modules/prebidServerBidAdapter/ortbConverter.js +1 -0
- package/modules/riseBidAdapter.js +2 -1
- package/modules/riseBidAdapter.md +2 -0
- package/modules/seedtagBidAdapter.js +12 -0
- package/modules/smartxBidAdapter.js +6 -0
- package/modules/taboolaBidAdapter.js +61 -14
- package/modules/yahoosspBidAdapter.js +5 -0
- package/modules/yieldlabBidAdapter.js +150 -134
- package/modules/yieldmoBidAdapter.js +1 -12
- package/package.json +1 -1
- package/src/adloader.js +2 -1
- package/src/prebid.js +7 -8
- package/test/spec/modules/adagioBidAdapter_spec.js +1 -28
- package/test/spec/modules/adlooxRtdProvider_spec.js +28 -120
- package/test/spec/modules/aidemBidAdapter_spec.js +10 -2
- package/test/spec/modules/alkimiBidAdapter_spec.js +15 -3
- package/test/spec/modules/aolBidAdapter_spec.js +22 -0
- package/test/spec/modules/appnexusBidAdapter_spec.js +7 -3
- package/test/spec/modules/appushBidAdapter_spec.js +372 -0
- package/test/spec/modules/confiantRtdProvider_spec.js +107 -0
- package/test/spec/modules/connectIdSystem_spec.js +17 -5
- package/test/spec/modules/feedadBidAdapter_spec.js +60 -13
- package/test/spec/modules/holidBidAdapter_spec.js +165 -0
- package/test/spec/modules/kueezRtbBidAdapter_spec.js +147 -24
- package/test/spec/modules/medianetRtdProvider_spec.js +3 -3
- package/test/spec/modules/orbitsoftBidAdapter_spec.js +255 -0
- package/test/spec/modules/riseBidAdapter_spec.js +7 -0
- package/test/spec/modules/seedtagBidAdapter_spec.js +56 -10
- package/test/spec/modules/smartxBidAdapter_spec.js +10 -0
- package/test/spec/modules/taboolaBidAdapter_spec.js +142 -5
- package/test/spec/modules/videoModule/submodules/jwplayerVideoProvider_spec.js +45 -10
- package/test/spec/modules/yahoosspBidAdapter_spec.js +16 -1
- package/test/spec/modules/yieldlabBidAdapter_spec.js +311 -301
- package/test/spec/modules/yieldmoBidAdapter_spec.js +70 -0
- package/test/spec/ortbConverter/pbsExtensions/adUnitCode_spec.js +23 -0
- package/test/spec/unit/pbjs_api_spec.js +11 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { isFn, deepAccess, logMessage, logError } from '../src/utils.js';
|
|
2
|
+
import { convertOrtbRequestToProprietaryNative } from '../src/native.js';
|
|
3
|
+
|
|
4
|
+
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
5
|
+
import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
|
|
6
|
+
import { config } from '../src/config.js';
|
|
7
|
+
|
|
8
|
+
const BIDDER_CODE = 'appush';
|
|
9
|
+
const AD_URL = 'https://hb.appush.com/pbjs';
|
|
10
|
+
|
|
11
|
+
function isBidResponseValid(bid) {
|
|
12
|
+
if (!bid.requestId || !bid.cpm || !bid.creativeId || !bid.ttl || !bid.currency) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
switch (bid.mediaType) {
|
|
17
|
+
case BANNER:
|
|
18
|
+
return Boolean(bid.width && bid.height && bid.ad);
|
|
19
|
+
case VIDEO:
|
|
20
|
+
return Boolean(bid.vastUrl || bid.vastXml);
|
|
21
|
+
case NATIVE:
|
|
22
|
+
return Boolean(bid.native && bid.native.impressionTrackers && bid.native.impressionTrackers.length);
|
|
23
|
+
default:
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function getPlacementReqData(bid) {
|
|
29
|
+
const { params, bidId, mediaTypes } = bid;
|
|
30
|
+
const schain = bid.schain || {};
|
|
31
|
+
const { placementId, endpointId } = params;
|
|
32
|
+
const bidfloor = getBidFloor(bid);
|
|
33
|
+
|
|
34
|
+
const placement = {
|
|
35
|
+
bidId,
|
|
36
|
+
schain,
|
|
37
|
+
bidfloor
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
if (placementId) {
|
|
41
|
+
placement.placementId = placementId;
|
|
42
|
+
placement.type = 'publisher';
|
|
43
|
+
} else if (endpointId) {
|
|
44
|
+
placement.endpointId = endpointId;
|
|
45
|
+
placement.type = 'network';
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (mediaTypes && mediaTypes[BANNER]) {
|
|
49
|
+
placement.adFormat = BANNER;
|
|
50
|
+
placement.sizes = mediaTypes[BANNER].sizes;
|
|
51
|
+
} else if (mediaTypes && mediaTypes[VIDEO]) {
|
|
52
|
+
placement.adFormat = VIDEO;
|
|
53
|
+
placement.playerSize = mediaTypes[VIDEO].playerSize;
|
|
54
|
+
placement.minduration = mediaTypes[VIDEO].minduration;
|
|
55
|
+
placement.maxduration = mediaTypes[VIDEO].maxduration;
|
|
56
|
+
placement.mimes = mediaTypes[VIDEO].mimes;
|
|
57
|
+
placement.protocols = mediaTypes[VIDEO].protocols;
|
|
58
|
+
placement.startdelay = mediaTypes[VIDEO].startdelay;
|
|
59
|
+
placement.placement = mediaTypes[VIDEO].placement;
|
|
60
|
+
placement.skip = mediaTypes[VIDEO].skip;
|
|
61
|
+
placement.skipafter = mediaTypes[VIDEO].skipafter;
|
|
62
|
+
placement.minbitrate = mediaTypes[VIDEO].minbitrate;
|
|
63
|
+
placement.maxbitrate = mediaTypes[VIDEO].maxbitrate;
|
|
64
|
+
placement.delivery = mediaTypes[VIDEO].delivery;
|
|
65
|
+
placement.playbackmethod = mediaTypes[VIDEO].playbackmethod;
|
|
66
|
+
placement.api = mediaTypes[VIDEO].api;
|
|
67
|
+
placement.linearity = mediaTypes[VIDEO].linearity;
|
|
68
|
+
} else if (mediaTypes && mediaTypes[NATIVE]) {
|
|
69
|
+
placement.native = mediaTypes[NATIVE];
|
|
70
|
+
placement.adFormat = NATIVE;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return placement;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function getBidFloor(bid) {
|
|
77
|
+
if (!isFn(bid.getFloor)) {
|
|
78
|
+
return deepAccess(bid, 'params.bidfloor', 0);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
try {
|
|
82
|
+
const bidFloor = bid.getFloor({
|
|
83
|
+
currency: 'USD',
|
|
84
|
+
mediaType: '*',
|
|
85
|
+
size: '*',
|
|
86
|
+
});
|
|
87
|
+
return bidFloor.floor;
|
|
88
|
+
} catch (err) {
|
|
89
|
+
logError(err);
|
|
90
|
+
return 0;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export const spec = {
|
|
95
|
+
code: BIDDER_CODE,
|
|
96
|
+
supportedMediaTypes: [BANNER, VIDEO, NATIVE],
|
|
97
|
+
|
|
98
|
+
isBidRequestValid: (bid = {}) => {
|
|
99
|
+
const { params, bidId, mediaTypes } = bid;
|
|
100
|
+
let valid = Boolean(bidId && params && (params.placementId || params.endpointId));
|
|
101
|
+
|
|
102
|
+
if (mediaTypes && mediaTypes[BANNER]) {
|
|
103
|
+
valid = valid && Boolean(mediaTypes[BANNER] && mediaTypes[BANNER].sizes);
|
|
104
|
+
} else if (mediaTypes && mediaTypes[VIDEO]) {
|
|
105
|
+
valid = valid && Boolean(mediaTypes[VIDEO] && mediaTypes[VIDEO].playerSize);
|
|
106
|
+
} else if (mediaTypes && mediaTypes[NATIVE]) {
|
|
107
|
+
valid = valid && Boolean(mediaTypes[NATIVE]);
|
|
108
|
+
} else {
|
|
109
|
+
valid = false;
|
|
110
|
+
}
|
|
111
|
+
return valid;
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
buildRequests: (validBidRequests = [], bidderRequest = {}) => {
|
|
115
|
+
// convert Native ORTB definition to old-style prebid native definition
|
|
116
|
+
validBidRequests = convertOrtbRequestToProprietaryNative(validBidRequests);
|
|
117
|
+
|
|
118
|
+
let deviceWidth = 0;
|
|
119
|
+
let deviceHeight = 0;
|
|
120
|
+
|
|
121
|
+
let winLocation;
|
|
122
|
+
try {
|
|
123
|
+
const winTop = window.top;
|
|
124
|
+
deviceWidth = winTop.screen.width;
|
|
125
|
+
deviceHeight = winTop.screen.height;
|
|
126
|
+
winLocation = winTop.location;
|
|
127
|
+
} catch (e) {
|
|
128
|
+
logMessage(e);
|
|
129
|
+
winLocation = window.location;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
const refferUrl = bidderRequest.refererInfo && bidderRequest.refererInfo.page;
|
|
133
|
+
let refferLocation;
|
|
134
|
+
try {
|
|
135
|
+
refferLocation = refferUrl && new URL(refferUrl);
|
|
136
|
+
} catch (e) {
|
|
137
|
+
logMessage(e);
|
|
138
|
+
}
|
|
139
|
+
// TODO: does the fallback make sense here?
|
|
140
|
+
let location = refferLocation || winLocation;
|
|
141
|
+
const language = (navigator && navigator.language) ? navigator.language.split('-')[0] : '';
|
|
142
|
+
const host = location.host;
|
|
143
|
+
const page = location.pathname;
|
|
144
|
+
const secure = location.protocol === 'https:' ? 1 : 0;
|
|
145
|
+
const placements = [];
|
|
146
|
+
const request = {
|
|
147
|
+
deviceWidth,
|
|
148
|
+
deviceHeight,
|
|
149
|
+
language,
|
|
150
|
+
secure,
|
|
151
|
+
host,
|
|
152
|
+
page,
|
|
153
|
+
placements,
|
|
154
|
+
coppa: config.getConfig('coppa') === true ? 1 : 0,
|
|
155
|
+
ccpa: bidderRequest.uspConsent || undefined,
|
|
156
|
+
gdpr: bidderRequest.gdprConsent || undefined,
|
|
157
|
+
tmax: config.getConfig('bidderTimeout')
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const len = validBidRequests.length;
|
|
161
|
+
for (let i = 0; i < len; i++) {
|
|
162
|
+
const bid = validBidRequests[i];
|
|
163
|
+
placements.push(getPlacementReqData(bid));
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
return {
|
|
167
|
+
method: 'POST',
|
|
168
|
+
url: AD_URL,
|
|
169
|
+
data: request
|
|
170
|
+
};
|
|
171
|
+
},
|
|
172
|
+
|
|
173
|
+
interpretResponse: (serverResponse) => {
|
|
174
|
+
let response = [];
|
|
175
|
+
for (let i = 0; i < serverResponse.body.length; i++) {
|
|
176
|
+
let resItem = serverResponse.body[i];
|
|
177
|
+
if (isBidResponseValid(resItem)) {
|
|
178
|
+
const advertiserDomains = resItem.adomain && resItem.adomain.length ? resItem.adomain : [];
|
|
179
|
+
resItem.meta = { ...resItem.meta, advertiserDomains };
|
|
180
|
+
|
|
181
|
+
response.push(resItem);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return response;
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
registerBidder(spec);
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Overview
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
Module Name: Appush Bidder Adapter
|
|
5
|
+
Module Type: Appush Bidder Adapter
|
|
6
|
+
Maintainer: support@appush.com
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
# Description
|
|
10
|
+
|
|
11
|
+
Connects to Appush exchange for bids.
|
|
12
|
+
Appush bid adapter supports Banner, Video (instream and outstream) and Native.
|
|
13
|
+
|
|
14
|
+
# Test Parameters
|
|
15
|
+
```
|
|
16
|
+
var adUnits = [
|
|
17
|
+
// Will return static test banner
|
|
18
|
+
{
|
|
19
|
+
code: 'adunit1',
|
|
20
|
+
mediaTypes: {
|
|
21
|
+
banner: {
|
|
22
|
+
sizes: [ [300, 250], [320, 50] ],
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
bids: [
|
|
26
|
+
{
|
|
27
|
+
bidder: 'appush',
|
|
28
|
+
params: {
|
|
29
|
+
placementId: 'testBanner',
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
code: 'addunit2',
|
|
36
|
+
mediaTypes: {
|
|
37
|
+
video: {
|
|
38
|
+
playerSize: [ [640, 480] ],
|
|
39
|
+
context: 'instream',
|
|
40
|
+
minduration: 5,
|
|
41
|
+
maxduration: 60,
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
bids: [
|
|
45
|
+
{
|
|
46
|
+
bidder: 'appush',
|
|
47
|
+
params: {
|
|
48
|
+
placementId: 'testVideo',
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
code: 'addunit3',
|
|
55
|
+
mediaTypes: {
|
|
56
|
+
native: {
|
|
57
|
+
title: {
|
|
58
|
+
required: true
|
|
59
|
+
},
|
|
60
|
+
body: {
|
|
61
|
+
required: true
|
|
62
|
+
},
|
|
63
|
+
icon: {
|
|
64
|
+
required: true,
|
|
65
|
+
size: [64, 64]
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
bids: [
|
|
70
|
+
{
|
|
71
|
+
bidder: 'appush',
|
|
72
|
+
params: {
|
|
73
|
+
placementId: 'testNative',
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
];
|
|
79
|
+
```
|
package/modules/asoBidAdapter.js
CHANGED
|
@@ -10,11 +10,11 @@ import {
|
|
|
10
10
|
parseSizesInput,
|
|
11
11
|
tryAppendQueryString
|
|
12
12
|
} from '../src/utils.js';
|
|
13
|
-
import {registerBidder} from '../src/adapters/bidderFactory.js';
|
|
14
|
-
import {config} from '../src/config.js';
|
|
15
|
-
import {BANNER, VIDEO} from '../src/mediaTypes.js';
|
|
16
|
-
import {Renderer} from '../src/Renderer.js';
|
|
17
|
-
import {parseDomain} from '../src/refererDetection.js';
|
|
13
|
+
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
14
|
+
import { config } from '../src/config.js';
|
|
15
|
+
import { BANNER, VIDEO } from '../src/mediaTypes.js';
|
|
16
|
+
import { Renderer } from '../src/Renderer.js';
|
|
17
|
+
import { parseDomain } from '../src/refererDetection.js';
|
|
18
18
|
|
|
19
19
|
const BIDDER_CODE = 'aso';
|
|
20
20
|
const DEFAULT_SERVER_URL = 'https://srv.aso1.net';
|
|
@@ -27,6 +27,9 @@ export const spec = {
|
|
|
27
27
|
|
|
28
28
|
code: BIDDER_CODE,
|
|
29
29
|
supportedMediaTypes: [BANNER, VIDEO],
|
|
30
|
+
aliases: [
|
|
31
|
+
{code: 'bcmint'}
|
|
32
|
+
],
|
|
30
33
|
|
|
31
34
|
isBidRequestValid: bid => {
|
|
32
35
|
return !!bid.params && !!bid.params.zone;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This module provides comprehensive detection of security, quality, and privacy threats by Confiant Inc,
|
|
3
|
+
* the industry leader in real-time detecting and blocking of bad ads
|
|
4
|
+
*
|
|
5
|
+
* The {@link module:modules/realTimeData} module is required
|
|
6
|
+
* The module will inject a Confiant Inc. script into the page to monitor ad impressions
|
|
7
|
+
* @module modules/confiantRtdProvider
|
|
8
|
+
* @requires module:modules/realTimeData
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { submodule } from '../src/hook.js';
|
|
12
|
+
import { logError, generateUUID } from '../src/utils.js';
|
|
13
|
+
import { loadExternalScript } from '../src/adloader.js';
|
|
14
|
+
import * as events from '../src/events.js';
|
|
15
|
+
import CONSTANTS from '../src/constants.json';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Injects the Confiant Inc. configuration script into the page, based on proprtyId provided
|
|
19
|
+
* @param {string} propertyId
|
|
20
|
+
*/
|
|
21
|
+
function injectConfigScript(propertyId) {
|
|
22
|
+
const scriptSrc = `https://cdn.confiant-integrations.net/${propertyId}/gpt_and_prebid/config.js`;
|
|
23
|
+
|
|
24
|
+
loadExternalScript(scriptSrc, 'confiant', () => {});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Set up page with Confiant integration
|
|
29
|
+
* @param {Object} config
|
|
30
|
+
*/
|
|
31
|
+
function setupPage(config) {
|
|
32
|
+
const propertyId = config?.params?.propertyId;
|
|
33
|
+
if (!propertyId) {
|
|
34
|
+
logError('Confiant pbjs module: no propertyId provided');
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const confiant = window.confiant || Object.create(null);
|
|
39
|
+
confiant[propertyId] = confiant[propertyId] || Object.create(null);
|
|
40
|
+
confiant[propertyId].clientSettings = confiant[propertyId].clientSettings || Object.create(null);
|
|
41
|
+
confiant[propertyId].clientSettings.isMGBL = true;
|
|
42
|
+
confiant[propertyId].clientSettings.prebidExcludeBidders = config?.params?.prebidExcludeBidders;
|
|
43
|
+
confiant[propertyId].clientSettings.prebidNameSpace = config?.params?.prebidNameSpace;
|
|
44
|
+
|
|
45
|
+
if (config?.params?.shouldEmitBillableEvent) {
|
|
46
|
+
if (window.frames['cnftComm']) {
|
|
47
|
+
subscribeToConfiantCommFrame(window);
|
|
48
|
+
} else {
|
|
49
|
+
setUpMutationObserver();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
injectConfigScript(propertyId);
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Subscribe to window's message events to report Billable events
|
|
59
|
+
* @param {Window} targetWindow window instance to subscribe to
|
|
60
|
+
*/
|
|
61
|
+
function subscribeToConfiantCommFrame(targetWindow) {
|
|
62
|
+
targetWindow.addEventListener('message', reportBillableEvents);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
let mutationObserver;
|
|
66
|
+
/**
|
|
67
|
+
* Set up mutation observer to subscribe to Confiant's communication channel ASAP
|
|
68
|
+
*/
|
|
69
|
+
function setUpMutationObserver() {
|
|
70
|
+
mutationObserver = new MutationObserver((mutations) => {
|
|
71
|
+
mutations.forEach((mutation) => {
|
|
72
|
+
mutation.addedNodes.forEach((addedNode) => {
|
|
73
|
+
if (addedNode.nodeName === 'IFRAME' && addedNode.name === 'cnftComm' && !addedNode.pbjsModuleSubscribed) {
|
|
74
|
+
addedNode.pbjsModuleSubscribed = true;
|
|
75
|
+
mutationObserver.disconnect();
|
|
76
|
+
mutationObserver = null;
|
|
77
|
+
const iframeWindow = addedNode.contentWindow;
|
|
78
|
+
subscribeToConfiantCommFrame(iframeWindow);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
mutationObserver.observe(document.head, { childList: true, subtree: true });
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Emit billable event when Confiant integration reports that it has monitored an impression
|
|
88
|
+
*/
|
|
89
|
+
function reportBillableEvents (e) {
|
|
90
|
+
events.emit(CONSTANTS.EVENTS.BILLABLE_EVENT, {
|
|
91
|
+
auctionId: e.data.auctionId,
|
|
92
|
+
billingId: generateUUID(),
|
|
93
|
+
transactionId: e.data.transactionId,
|
|
94
|
+
type: 'impression',
|
|
95
|
+
vendor: 'confiant'
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Confiant submodule registration
|
|
101
|
+
*/
|
|
102
|
+
function registerConfiantSubmodule() {
|
|
103
|
+
submodule('realTimeData', {
|
|
104
|
+
name: 'confiant',
|
|
105
|
+
init: (config) => {
|
|
106
|
+
try {
|
|
107
|
+
return setupPage(config);
|
|
108
|
+
} catch (err) {
|
|
109
|
+
logError(err.message);
|
|
110
|
+
if (mutationObserver) {
|
|
111
|
+
mutationObserver.disconnect();
|
|
112
|
+
}
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
registerConfiantSubmodule();
|
|
120
|
+
|
|
121
|
+
export default {
|
|
122
|
+
injectConfigScript,
|
|
123
|
+
setupPage,
|
|
124
|
+
subscribeToConfiantCommFrame,
|
|
125
|
+
setUpMutationObserver,
|
|
126
|
+
reportBillableEvents,
|
|
127
|
+
registerConfiantSubmodule
|
|
128
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Overview
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
Module Name: Confiant Inc. Rtd provider
|
|
5
|
+
Module Type: Rtd Provider
|
|
6
|
+
Maintainer:
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Confiant’s module provides comprehensive detection of security, quality, and privacy threats across your ad stack.
|
|
10
|
+
Confiant is the industry leader in real-time detecting and blocking of bad ads when it comes to protecting your users and brand reputation.
|
|
11
|
+
|
|
12
|
+
To start using this module, please contact [Confiant](https://www.confiant.com/contact) to get an account and customer key.
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
# Integration
|
|
16
|
+
|
|
17
|
+
1) Build Prebid bundle with Confiant module included:
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
gulp build --modules=confiantRtdProvider,...
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
2) Include the resulting bundle on your page.
|
|
25
|
+
|
|
26
|
+
# Configuration
|
|
27
|
+
|
|
28
|
+
Configuration of Confiant module is plain simple:
|
|
29
|
+
|
|
30
|
+
```javascript
|
|
31
|
+
pbjs.setConfig({
|
|
32
|
+
realTimeData: {
|
|
33
|
+
dataProviders: [{
|
|
34
|
+
name: 'confiant',
|
|
35
|
+
params: {
|
|
36
|
+
// so please get in touch with us so we could help you to set up the module with proper parameters
|
|
37
|
+
propertyId: '', // required, string param, obtained from Confiant Inc.
|
|
38
|
+
prebidExcludeBidders: '', // optional, comma separated list of bidders to exclude from Confiant's prebid.js integration
|
|
39
|
+
prebidNameSpace: '', // optional, string param, namespace for prebid.js integration
|
|
40
|
+
shouldEmitBillableEvent: false, // optional, boolean param, upon being set to true enables firing of the BillableEvent upon Confiant's impression scanning
|
|
41
|
+
}
|
|
42
|
+
}]
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
```
|
|
@@ -66,6 +66,11 @@ export const connectIdSubmodule = {
|
|
|
66
66
|
us_privacy: consentData && consentData.uspConsent ? consentData.uspConsent : ''
|
|
67
67
|
};
|
|
68
68
|
|
|
69
|
+
if (connectIdSubmodule.isUnderGPPJurisdiction(consentData)) {
|
|
70
|
+
data.gpp = consentData.gppConsent.gppString;
|
|
71
|
+
data.gpp_sid = encodeURIComponent(consentData.gppConsent.applicableSections.join(','));
|
|
72
|
+
}
|
|
73
|
+
|
|
69
74
|
INPUT_PARAM_KEYS.forEach(key => {
|
|
70
75
|
if (typeof params[key] != 'undefined') {
|
|
71
76
|
data[key] = params[key];
|
|
@@ -98,7 +103,7 @@ export const connectIdSubmodule = {
|
|
|
98
103
|
},
|
|
99
104
|
|
|
100
105
|
/**
|
|
101
|
-
* Utility function that returns a boolean flag indicating if the
|
|
106
|
+
* Utility function that returns a boolean flag indicating if the opportunity
|
|
102
107
|
* is subject to GDPR
|
|
103
108
|
* @returns {Boolean}
|
|
104
109
|
*/
|
|
@@ -106,6 +111,15 @@ export const connectIdSubmodule = {
|
|
|
106
111
|
return !!(consentData && consentData.gdpr && consentData.gdpr.gdprApplies);
|
|
107
112
|
},
|
|
108
113
|
|
|
114
|
+
/**
|
|
115
|
+
* Utility function that returns a boolean flag indicating if the opportunity
|
|
116
|
+
* is subject to GPP jurisdiction.
|
|
117
|
+
* @returns {Boolean}
|
|
118
|
+
*/
|
|
119
|
+
isUnderGPPJurisdiction(consentData) {
|
|
120
|
+
return !!(consentData && consentData.gppConsent && consentData.gppConsent.gppString);
|
|
121
|
+
},
|
|
122
|
+
|
|
109
123
|
/**
|
|
110
124
|
* Utility function that returns a boolean flag indicating if the user
|
|
111
125
|
* has opeted out via the Yahoo easy-opt-out mechanism.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { deepAccess, getBidIdParameter, isArray, getUniqueIdentifierStr, contains } from '../src/utils.js';
|
|
1
|
+
import { deepAccess, getBidIdParameter, isArray, getUniqueIdentifierStr, contains, isFn, isPlainObject } from '../src/utils.js';
|
|
2
2
|
import { config } from '../src/config.js';
|
|
3
3
|
import { Renderer } from '../src/Renderer.js';
|
|
4
4
|
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
@@ -84,7 +84,7 @@ export const spec = {
|
|
|
84
84
|
|
|
85
85
|
/* Generate bid request for banner adunit */
|
|
86
86
|
function buildBannerRequest(bidRequest, bidderRequest) {
|
|
87
|
-
let bidFloor =
|
|
87
|
+
let bidFloor = getBidFloor(bidRequest);
|
|
88
88
|
|
|
89
89
|
let adW = 0;
|
|
90
90
|
let adH = 0;
|
|
@@ -135,7 +135,7 @@ function buildNativeRequest(bidRequest, bidderRequest) {
|
|
|
135
135
|
let counter = 0;
|
|
136
136
|
let assets = [];
|
|
137
137
|
|
|
138
|
-
let bidFloor =
|
|
138
|
+
let bidFloor = getBidFloor(bidRequest);
|
|
139
139
|
|
|
140
140
|
let title = deepAccess(bidRequest, 'mediaTypes.native.title');
|
|
141
141
|
if (title && title.len) {
|
|
@@ -196,7 +196,7 @@ function buildNativeRequest(bidRequest, bidderRequest) {
|
|
|
196
196
|
|
|
197
197
|
/* Generate bid request for video adunit */
|
|
198
198
|
function buildVideoRequest(bidRequest, bidderRequest) {
|
|
199
|
-
let bidFloor =
|
|
199
|
+
let bidFloor = getBidFloor(bidRequest);
|
|
200
200
|
|
|
201
201
|
let sizeObj = getVideoAdUnitSize(bidRequest);
|
|
202
202
|
|
|
@@ -414,6 +414,7 @@ function buildBannerResponse(bidRequest, bidResponse) {
|
|
|
414
414
|
}
|
|
415
415
|
let bidSizes = (deepAccess(bidRequest, 'mediaTypes.banner.sizes')) ? deepAccess(bidRequest, 'mediaTypes.banner.sizes') : bidRequest.sizes;
|
|
416
416
|
bidResponse.requestId = bidRequest.bidId;
|
|
417
|
+
bidResponse.auctionId = bidRequest.auctionId;
|
|
417
418
|
bidResponse.transactionId = bidRequest.transactionId;
|
|
418
419
|
bidResponse.placementCode = placementCode;
|
|
419
420
|
bidResponse.cpm = responseCPM;
|
|
@@ -455,6 +456,7 @@ function buildNativeResponse(bidRequest, response) {
|
|
|
455
456
|
return;
|
|
456
457
|
}
|
|
457
458
|
bidResponse.requestId = bidRequest.bidId;
|
|
459
|
+
bidResponse.auctionId = bidRequest.auctionId;
|
|
458
460
|
bidResponse.transactionId = bidRequest.transactionId;
|
|
459
461
|
bidResponse.placementCode = placementCode;
|
|
460
462
|
bidResponse.cpm = responseCPM;
|
|
@@ -507,6 +509,7 @@ function buildVideoResponse(bidRequest, response) {
|
|
|
507
509
|
let context = bidRequest.mediaTypes.video.context;
|
|
508
510
|
|
|
509
511
|
bidResponse.requestId = bidRequest.bidId;
|
|
512
|
+
bidResponse.auctionId = bidRequest.auctionId;
|
|
510
513
|
bidResponse.transactionId = bidRequest.transactionId;
|
|
511
514
|
bidResponse.placementCode = placementCode;
|
|
512
515
|
bidResponse.cpm = responseCPM;
|
|
@@ -630,4 +633,21 @@ function getNativeAssestObj(obj, assets) {
|
|
|
630
633
|
}
|
|
631
634
|
}
|
|
632
635
|
|
|
636
|
+
// BUILD REQUESTS: BIDFLOORS
|
|
637
|
+
function getBidFloor(bid) {
|
|
638
|
+
if (!isFn(bid.getFloor)) {
|
|
639
|
+
return (bid.params.bidfloor) ? bid.params.bidfloor : null;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
let floor = bid.getFloor({
|
|
643
|
+
currency: 'USD',
|
|
644
|
+
mediaType: '*',
|
|
645
|
+
size: '*'
|
|
646
|
+
});
|
|
647
|
+
if (isPlainObject(floor) && !isNaN(floor.floor) && floor.currency === 'USD') {
|
|
648
|
+
return floor.floor;
|
|
649
|
+
}
|
|
650
|
+
return null;
|
|
651
|
+
}
|
|
652
|
+
|
|
633
653
|
registerBidder(spec);
|
|
@@ -7,7 +7,7 @@ import {ajax} from '../src/ajax.js';
|
|
|
7
7
|
* Version of the FeedAd bid adapter
|
|
8
8
|
* @type {string}
|
|
9
9
|
*/
|
|
10
|
-
const VERSION = '1.0.
|
|
10
|
+
const VERSION = '1.0.5';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* @typedef {object} FeedAdApiBidRequest
|
|
@@ -16,7 +16,8 @@ const VERSION = '1.0.3';
|
|
|
16
16
|
* @property {number} ad_type
|
|
17
17
|
* @property {string} client_token
|
|
18
18
|
* @property {string} placement_id
|
|
19
|
-
* @property {string}
|
|
19
|
+
* @property {string} prebid_adapter_version
|
|
20
|
+
* @property {string} prebid_sdk_version
|
|
20
21
|
* @property {boolean} app_hybrid
|
|
21
22
|
*
|
|
22
23
|
* @property {string} [app_bundle_id]
|
|
@@ -181,7 +182,8 @@ function createApiBidRParams(request) {
|
|
|
181
182
|
ad_type: 0,
|
|
182
183
|
client_token: request.params.clientToken,
|
|
183
184
|
placement_id: request.params.placementId,
|
|
184
|
-
|
|
185
|
+
prebid_adapter_version: VERSION,
|
|
186
|
+
prebid_sdk_version: '$prebid.version$',
|
|
185
187
|
app_hybrid: false,
|
|
186
188
|
});
|
|
187
189
|
}
|
|
@@ -207,7 +209,6 @@ function buildRequests(validBidRequests, bidderRequest) {
|
|
|
207
209
|
})
|
|
208
210
|
});
|
|
209
211
|
data.bids.forEach(bid => BID_METADATA[bid.bidId] = {
|
|
210
|
-
// TODO: is 'page' the right value here?
|
|
211
212
|
referer: data.refererInfo.page,
|
|
212
213
|
transactionId: bid.transactionId
|
|
213
214
|
});
|
|
@@ -266,7 +267,8 @@ function createTrackingParams(data, klass) {
|
|
|
266
267
|
prebid_bid_id: bidId,
|
|
267
268
|
prebid_transaction_id: transactionId,
|
|
268
269
|
referer,
|
|
269
|
-
|
|
270
|
+
prebid_adapter_version: VERSION,
|
|
271
|
+
prebid_sdk_version: '$prebid.version$',
|
|
270
272
|
};
|
|
271
273
|
}
|
|
272
274
|
|
|
@@ -294,12 +296,20 @@ function trackingHandlerFactory(klass) {
|
|
|
294
296
|
/**
|
|
295
297
|
* Reads the user syncs off the server responses and converts them into Prebid.JS format
|
|
296
298
|
* @param {SyncOptions} syncOptions
|
|
297
|
-
* @param {
|
|
299
|
+
* @param {ServerResponse[]} serverResponses
|
|
298
300
|
* @param gdprConsent
|
|
299
301
|
* @param uspConsent
|
|
300
302
|
*/
|
|
301
303
|
function getUserSyncs(syncOptions, serverResponses, gdprConsent, uspConsent) {
|
|
302
|
-
return serverResponses.map(response =>
|
|
304
|
+
return serverResponses.map(response => {
|
|
305
|
+
// validate response format
|
|
306
|
+
const ext = deepAccess(response, 'body.ext', []);
|
|
307
|
+
if (ext == null) {
|
|
308
|
+
return null;
|
|
309
|
+
}
|
|
310
|
+
return ext;
|
|
311
|
+
})
|
|
312
|
+
.filter(ext => ext != null)
|
|
303
313
|
.flatMap(extension => {
|
|
304
314
|
// extract user syncs from extension
|
|
305
315
|
const pixels = syncOptions.pixelEnabled && extension.pixels ? extension.pixels : [];
|