prebid.js 7.14.0 → 7.16.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/.circleci/config.yml +3 -0
- package/dist/1plusXRtdProvider.js +1 -1
- package/dist/33acrossBidAdapter.js +1 -1
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adfBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/adkernelAdnBidAdapter.js +1 -1
- package/dist/adkernelBidAdapter.js +1 -1
- package/dist/adlooxAdServerVideo.js +1 -1
- package/dist/adlooxRtdProvider.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adtrgtmeBidAdapter.js +1 -1
- package/dist/adtrueBidAdapter.js +1 -1
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/airgridRtdProvider.js +1 -1
- package/dist/ajaBidAdapter.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/asoBidAdapter.js +1 -1
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/beachfrontBidAdapter.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bizzclickBidAdapter.js +1 -1
- package/dist/bliinkBidAdapter.js +1 -1
- package/dist/bluebillywigBidAdapter.js +1 -1
- package/dist/brandmetricsRtdProvider.js +1 -1
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/brightcomBidAdapter.js +1 -1
- package/dist/browsiRtdProvider.js +1 -1
- package/dist/categoryTranslation.js +1 -1
- package/dist/concertBidAdapter.js +1 -1
- package/dist/connectadBidAdapter.js +1 -1
- package/dist/consentManagement.js +1 -1
- package/dist/consentManagementUsp.js +1 -1
- package/dist/consumableBidAdapter.js +1 -1
- package/dist/conversantBidAdapter.js +1 -1
- package/dist/cpmstarBidAdapter.js +1 -1
- package/dist/craftBidAdapter.js +1 -1
- package/dist/criteoBidAdapter.js +1 -1
- package/dist/currency.js +1 -1
- package/dist/dataControllerModule.js +1 -1
- package/dist/dchain.js +1 -1
- package/dist/deepintentBidAdapter.js +1 -1
- package/dist/dependencies.json +3 -0
- package/dist/dgkeywordRtdProvider.js +1 -1
- package/dist/dianomiBidAdapter.js +1 -1
- package/dist/distroscaleBidAdapter.js +1 -1
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/etargetBidAdapter.js +1 -1
- package/dist/feedadBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/fpdModule.js +1 -1
- package/dist/gamoshiBidAdapter.js +1 -1
- package/dist/glimpseBidAdapter.js +1 -1
- package/dist/gmosspBidAdapter.js +1 -1
- package/dist/goldbachBidAdapter.js +1 -1
- package/dist/gothamadsBidAdapter.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/iasRtdProvider.js +1 -1
- package/dist/id5IdSystem.js +1 -1
- package/dist/imRtdProvider.js +1 -1
- package/dist/impactifyBidAdapter.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/konduitAnalyticsAdapter.js +1 -1
- package/dist/kueezBidAdapter.js +1 -1
- package/dist/lassoBidAdapter.js +1 -1
- package/dist/lifestreetBidAdapter.js +1 -1
- package/dist/liveIntentAnalyticsAdapter.js +1 -0
- package/dist/liveyieldAnalyticsAdapter.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.js +1 -1
- package/dist/luponmediaBidAdapter.js +1 -1
- package/dist/malltvAnalyticsAdapter.js +1 -1
- package/dist/marsmediaBidAdapter.js +1 -1
- package/dist/mass.js +1 -1
- package/dist/mediafuseBidAdapter.js +1 -1
- package/dist/mediakeysBidAdapter.js +1 -1
- package/dist/mediasniperBidAdapter.js +1 -1
- package/dist/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/multibid.js +1 -1
- package/dist/naveggIdSystem.js +1 -1
- package/dist/newspassidBidAdapter.js +1 -1
- package/dist/nextMillenniumBidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +172 -171
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/oneKeyRtdProvider.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/openxBidAdapter.js +1 -1
- package/dist/openxOrtbBidAdapter.js +1 -1
- package/dist/operaadsBidAdapter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/ozoneBidAdapter.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 +2 -2
- package/dist/prebidServerBidAdapter.js +1 -1
- package/dist/priceFloors.js +1 -1
- package/dist/pubCommonId.js +1 -1
- package/dist/pubgeniusBidAdapter.js +1 -1
- package/dist/publinkIdSystem.js +1 -1
- package/dist/pubmaticBidAdapter.js +1 -1
- package/dist/pubwiseAnalyticsAdapter.js +1 -1
- package/dist/pubwiseBidAdapter.js +1 -1
- package/dist/pubxBidAdapter.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/rtdModule.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/sirdataRtdProvider.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/spotxBidAdapter.js +1 -1
- package/dist/sspBCBidAdapter.js +1 -1
- package/dist/stroeerCoreBidAdapter.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/ucfunnelBidAdapter.js +1 -1
- package/dist/underdogmediaBidAdapter.js +1 -1
- package/dist/undertoneBidAdapter.js +1 -1
- package/dist/userId.js +1 -1
- package/dist/vidazooBidAdapter.js +1 -1
- package/dist/videobyteBidAdapter.js +1 -1
- package/dist/viewability.js +1 -1
- package/dist/visxBidAdapter.js +1 -1
- package/dist/vuukleBidAdapter.js +1 -1
- package/dist/weboramaRtdProvider.js +1 -1
- package/dist/widespaceBidAdapter.js +1 -1
- package/dist/winrBidAdapter.js +1 -1
- package/dist/yahoosspBidAdapter.js +1 -1
- package/dist/yieldliftBidAdapter.js +1 -1
- package/dist/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/dist/zeta_global_sspBidAdapter.js +1 -1
- package/modules/amxBidAdapter.js +98 -78
- package/modules/appnexusBidAdapter.js +73 -12
- package/modules/categoryTranslation.js +9 -8
- package/modules/consentManagement.js +4 -2
- package/modules/consentManagementUsp.js +17 -14
- package/modules/cpmstarBidAdapter.js +2 -1
- package/modules/currency.js +4 -3
- package/modules/dataControllerModule/index.js +4 -3
- package/modules/dchain.js +3 -2
- package/modules/dianomiBidAdapter.js +17 -14
- package/modules/dianomiBidAdapter.md +1 -1
- package/modules/feedadBidAdapter.js +40 -8
- package/modules/fpdModule/index.js +3 -2
- package/modules/iasRtdProvider.js +17 -3
- package/modules/ixBidAdapter.js +2 -5
- package/modules/liveIntentAnalyticsAdapter.js +148 -0
- package/modules/liveIntentAnalyticsAdapter.md +22 -0
- package/modules/mass.js +5 -3
- package/modules/multibid/index.js +4 -2
- package/modules/naveggIdSystem.js +53 -22
- package/modules/nextMillenniumBidAdapter.js +168 -55
- package/modules/openxOrtbBidAdapter.js +1 -1
- package/modules/prebidServerBidAdapter/index.js +18 -4
- package/modules/priceFloors.js +5 -4
- package/modules/pubCommonId.js +3 -2
- package/modules/rtdModule/index.js +3 -2
- package/modules/sharethroughBidAdapter.js +8 -6
- package/modules/spotxBidAdapter.js +1 -0
- package/modules/stroeerCoreBidAdapter.js +129 -92
- package/modules/stroeerCoreBidAdapter.md +52 -14
- package/modules/teadsBidAdapter.js +32 -10
- package/modules/ucfunnelBidAdapter.js +9 -10
- package/modules/userId/index.js +73 -48
- package/modules/viewability.js +2 -170
- package/package.json +3 -3
- package/src/adapterManager.js +21 -13
- package/src/adapters/bidderFactory.js +28 -6
- package/src/auction.js +17 -4
- package/src/auctionManager.js +5 -0
- package/src/constants.json +2 -0
- package/src/native.js +5 -2
- package/src/prebid.js +52 -23
- package/src/secureCreatives.js +1 -1
- package/src/utils/perfMetrics.js +386 -0
- package/src/utils.js +1 -1
- package/test/helpers/testing-utils.js +4 -3
- package/test/spec/modules/adriverIdSystem_spec.js +7 -3
- package/test/spec/modules/amxBidAdapter_spec.js +250 -192
- package/test/spec/modules/appnexusBidAdapter_spec.js +61 -6
- package/test/spec/modules/consentManagementUsp_spec.js +6 -2
- package/test/spec/modules/dianomiBidAdapter_spec.js +326 -6
- package/test/spec/modules/feedadBidAdapter_spec.js +147 -11
- package/test/spec/modules/iasRtdProvider_spec.js +3 -1
- package/test/spec/modules/ixBidAdapter_spec.js +0 -64
- package/test/spec/modules/liveIntentAnalyticsAdapter_spec.js +297 -0
- package/test/spec/modules/nextMillenniumBidAdapter_spec.js +103 -1
- package/test/spec/modules/openxOrtbBidAdapter_spec.js +31 -0
- package/test/spec/modules/sharethroughBidAdapter_spec.js +23 -2
- package/test/spec/modules/spotxBidAdapter_spec.js +6 -0
- package/test/spec/modules/stroeerCoreBidAdapter_spec.js +315 -33
- package/test/spec/modules/teadsBidAdapter_spec.js +65 -11
- package/test/spec/modules/ucfunnelBidAdapter_spec.js +24 -10
- package/test/spec/native_spec.js +11 -0
- package/test/spec/unit/utils/perfMetrics_spec.js +394 -0
- package/wdio.conf.js +1 -0
- package/modules/viewability.md +0 -87
- package/test/spec/modules/viewability_spec.js +0 -280
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { getWindowSelf, getWindowTop,
|
|
1
|
+
import {buildUrl, deepAccess, getWindowSelf, getWindowTop, isEmpty, isStr, logWarn} from '../src/utils.js';
|
|
2
2
|
import {registerBidder} from '../src/adapters/bidderFactory.js';
|
|
3
|
-
import {BANNER} from '../src/mediaTypes.js';
|
|
3
|
+
import {BANNER, VIDEO} from '../src/mediaTypes.js';
|
|
4
4
|
|
|
5
5
|
const GVL_ID = 136;
|
|
6
6
|
const BIDDER_CODE = 'stroeerCore';
|
|
@@ -10,98 +10,33 @@ const DEFAULT_PORT = '';
|
|
|
10
10
|
const FIVE_MINUTES_IN_SECONDS = 300;
|
|
11
11
|
const USER_SYNC_IFRAME_URL = 'https://js.adscale.de/pbsync.html';
|
|
12
12
|
|
|
13
|
-
const isSecureWindow = () => getWindowSelf().location.protocol === 'https:';
|
|
14
|
-
const isMainPageAccessible = () => getMostAccessibleTopWindow() === getWindowTop();
|
|
15
|
-
|
|
16
|
-
function getMostAccessibleTopWindow() {
|
|
17
|
-
let res = getWindowSelf();
|
|
18
|
-
|
|
19
|
-
try {
|
|
20
|
-
while (getWindowTop().top !== res && res.parent.location.href.length) {
|
|
21
|
-
res = res.parent;
|
|
22
|
-
}
|
|
23
|
-
} catch (ignore) {
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
return res;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function elementInView(elementId) {
|
|
30
|
-
const resolveElement = (elId) => {
|
|
31
|
-
const win = getWindowSelf();
|
|
32
|
-
|
|
33
|
-
return win.document.getElementById(elId);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
const visibleInWindow = (el, win) => {
|
|
37
|
-
const rect = el.getBoundingClientRect();
|
|
38
|
-
const inView = (rect.top + rect.height >= 0) && (rect.top <= win.innerHeight);
|
|
39
|
-
|
|
40
|
-
if (win !== win.parent) {
|
|
41
|
-
return inView && visibleInWindow(win.frameElement, win.parent);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return inView;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
try {
|
|
48
|
-
return visibleInWindow(resolveElement(elementId), getWindowSelf());
|
|
49
|
-
} catch (e) {
|
|
50
|
-
// old browser, element not found, cross-origin etc.
|
|
51
|
-
}
|
|
52
|
-
return undefined;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function _buildUrl({host: hostname = DEFAULT_HOST, port = DEFAULT_PORT, securePort, path: pathname = DEFAULT_PATH}) {
|
|
56
|
-
if (securePort) {
|
|
57
|
-
port = securePort;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
return buildUrl({protocol: 'https', hostname, port, pathname});
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
function getGdprParams(gdprConsent) {
|
|
64
|
-
if (gdprConsent) {
|
|
65
|
-
const consentString = encodeURIComponent(gdprConsent.consentString || '')
|
|
66
|
-
const isGdpr = gdprConsent.gdprApplies ? 1 : 0;
|
|
67
|
-
|
|
68
|
-
return `?gdpr=${isGdpr}&gdpr_consent=${consentString}`
|
|
69
|
-
} else {
|
|
70
|
-
return '';
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
13
|
export const spec = {
|
|
75
14
|
code: BIDDER_CODE,
|
|
76
15
|
gvlid: GVL_ID,
|
|
77
|
-
supportedMediaTypes: [BANNER],
|
|
16
|
+
supportedMediaTypes: [BANNER, VIDEO],
|
|
78
17
|
|
|
79
18
|
isBidRequestValid: (function () {
|
|
80
19
|
const validators = [];
|
|
81
20
|
|
|
82
|
-
const createValidator = (checkFn,
|
|
21
|
+
const createValidator = (checkFn, msg) => {
|
|
83
22
|
return (bidRequest) => {
|
|
84
23
|
if (checkFn(bidRequest)) {
|
|
85
24
|
return true;
|
|
86
25
|
} else {
|
|
87
|
-
|
|
26
|
+
logWarn(`${BIDDER_CODE}: Bid setup for ${bidRequest.adUnitCode} is invalid: ${msg}`);
|
|
88
27
|
return false;
|
|
89
28
|
}
|
|
90
29
|
}
|
|
91
30
|
};
|
|
92
31
|
|
|
93
|
-
|
|
94
|
-
return (!bidReq.mediaTypes && !bidReq.mediaType) ||
|
|
95
|
-
(bidReq.mediaTypes && bidReq.mediaTypes.banner) ||
|
|
96
|
-
bidReq.mediaType === BANNER;
|
|
97
|
-
}
|
|
32
|
+
const hasValidMediaType = bidReq => hasBanner(bidReq) || hasVideo(bidReq);
|
|
98
33
|
|
|
99
|
-
validators.push(createValidator((bidReq) =>
|
|
100
|
-
|
|
34
|
+
validators.push(createValidator((bidReq) => hasValidMediaType(bidReq),
|
|
35
|
+
'the media type is invalid'));
|
|
101
36
|
validators.push(createValidator((bidReq) => typeof bidReq.params === 'object',
|
|
102
|
-
|
|
37
|
+
'the custom params does not exist'));
|
|
103
38
|
validators.push(createValidator((bidReq) => isStr(bidReq.params.sid),
|
|
104
|
-
|
|
39
|
+
'the sid field must be a string'));
|
|
105
40
|
|
|
106
41
|
return function (bidRequest) {
|
|
107
42
|
return validators.every(f => f(bidRequest));
|
|
@@ -113,9 +48,8 @@ export const spec = {
|
|
|
113
48
|
|
|
114
49
|
const refererInfo = bidderRequest.refererInfo;
|
|
115
50
|
|
|
116
|
-
const
|
|
51
|
+
const basePayload = {
|
|
117
52
|
id: bidderRequest.auctionId,
|
|
118
|
-
bids: [],
|
|
119
53
|
ref: refererInfo.ref,
|
|
120
54
|
ssl: isSecureWindow(),
|
|
121
55
|
mpa: isMainPageAccessible(),
|
|
@@ -127,7 +61,7 @@ export const spec = {
|
|
|
127
61
|
const userIds = anyBid.userId;
|
|
128
62
|
|
|
129
63
|
if (!isEmpty(userIds)) {
|
|
130
|
-
|
|
64
|
+
basePayload.user = {
|
|
131
65
|
euids: userIds
|
|
132
66
|
};
|
|
133
67
|
}
|
|
@@ -135,24 +69,24 @@ export const spec = {
|
|
|
135
69
|
const gdprConsent = bidderRequest.gdprConsent;
|
|
136
70
|
|
|
137
71
|
if (gdprConsent && gdprConsent.consentString != null && gdprConsent.gdprApplies != null) {
|
|
138
|
-
|
|
72
|
+
basePayload.gdpr = {
|
|
139
73
|
consent: bidderRequest.gdprConsent.consentString, applies: bidderRequest.gdprConsent.gdprApplies
|
|
140
74
|
};
|
|
141
75
|
}
|
|
142
76
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
77
|
+
const bannerBids = validBidRequests
|
|
78
|
+
.filter(hasBanner)
|
|
79
|
+
.map(mapToPayloadBannerBid);
|
|
146
80
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
});
|
|
151
|
-
});
|
|
81
|
+
const videoBids = validBidRequests
|
|
82
|
+
.filter(hasVideo)
|
|
83
|
+
.map(mapToPayloadVideoBid);
|
|
152
84
|
|
|
153
85
|
return {
|
|
154
|
-
method: 'POST',
|
|
155
|
-
|
|
86
|
+
method: 'POST',
|
|
87
|
+
url: buildEndpointUrl(anyBid.params),
|
|
88
|
+
data: {...basePayload, bids: [...bannerBids, ...videoBids]}
|
|
89
|
+
};
|
|
156
90
|
},
|
|
157
91
|
|
|
158
92
|
interpretResponse: function (serverResponse) {
|
|
@@ -160,12 +94,13 @@ export const spec = {
|
|
|
160
94
|
|
|
161
95
|
if (serverResponse.body && typeof serverResponse.body === 'object') {
|
|
162
96
|
serverResponse.body.bids.forEach(bidResponse => {
|
|
163
|
-
|
|
97
|
+
const mediaType = bidResponse.vastXml != null ? VIDEO : BANNER;
|
|
98
|
+
|
|
99
|
+
const bid = {
|
|
164
100
|
requestId: bidResponse.bidId,
|
|
165
101
|
cpm: bidResponse.cpm || 0,
|
|
166
102
|
width: bidResponse.width || 0,
|
|
167
103
|
height: bidResponse.height || 0,
|
|
168
|
-
ad: bidResponse.ad,
|
|
169
104
|
ttl: FIVE_MINUTES_IN_SECONDS,
|
|
170
105
|
currency: 'EUR',
|
|
171
106
|
netRevenue: true,
|
|
@@ -173,7 +108,16 @@ export const spec = {
|
|
|
173
108
|
meta: {
|
|
174
109
|
advertiserDomains: bidResponse.adomain
|
|
175
110
|
},
|
|
176
|
-
|
|
111
|
+
mediaType,
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
if (mediaType === VIDEO) {
|
|
115
|
+
bid.vastXml = bidResponse.vastXml;
|
|
116
|
+
} else {
|
|
117
|
+
bid.ad = bidResponse.ad;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
bids.push(bid);
|
|
177
121
|
});
|
|
178
122
|
}
|
|
179
123
|
|
|
@@ -192,4 +136,97 @@ export const spec = {
|
|
|
192
136
|
}
|
|
193
137
|
};
|
|
194
138
|
|
|
139
|
+
const isSecureWindow = () => getWindowSelf().location.protocol === 'https:';
|
|
140
|
+
|
|
141
|
+
const isMainPageAccessible = () => {
|
|
142
|
+
try {
|
|
143
|
+
return !!getWindowTop().location.href;
|
|
144
|
+
} catch (ignore) {
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
const elementInView = (elementId) => {
|
|
150
|
+
const resolveElement = (elId) => {
|
|
151
|
+
const win = getWindowSelf();
|
|
152
|
+
|
|
153
|
+
return win.document.getElementById(elId);
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
const visibleInWindow = (el, win) => {
|
|
157
|
+
const rect = el.getBoundingClientRect();
|
|
158
|
+
const inView = (rect.top + rect.height >= 0) && (rect.top <= win.innerHeight);
|
|
159
|
+
|
|
160
|
+
if (win !== win.parent) {
|
|
161
|
+
return inView && visibleInWindow(win.frameElement, win.parent);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return inView;
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
try {
|
|
168
|
+
return visibleInWindow(resolveElement(elementId), getWindowSelf());
|
|
169
|
+
} catch (e) {
|
|
170
|
+
// old browser, element not found, cross-origin etc.
|
|
171
|
+
}
|
|
172
|
+
return undefined;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
const buildEndpointUrl = ({host: hostname = DEFAULT_HOST, port = DEFAULT_PORT, securePort, path: pathname = DEFAULT_PATH}) => {
|
|
176
|
+
if (securePort) {
|
|
177
|
+
port = securePort;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
return buildUrl({protocol: 'https', hostname, port, pathname});
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
const getGdprParams = gdprConsent => {
|
|
184
|
+
if (gdprConsent) {
|
|
185
|
+
const consentString = encodeURIComponent(gdprConsent.consentString || '')
|
|
186
|
+
const isGdpr = gdprConsent.gdprApplies ? 1 : 0;
|
|
187
|
+
|
|
188
|
+
return `?gdpr=${isGdpr}&gdpr_consent=${consentString}`
|
|
189
|
+
} else {
|
|
190
|
+
return '';
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
const hasBanner = bidReq => {
|
|
195
|
+
return (!bidReq.mediaTypes && !bidReq.mediaType) ||
|
|
196
|
+
(bidReq.mediaTypes && bidReq.mediaTypes.banner) ||
|
|
197
|
+
bidReq.mediaType === BANNER;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const hasVideo = bidReq => {
|
|
201
|
+
const mediaTypes = bidReq.mediaTypes;
|
|
202
|
+
return mediaTypes &&
|
|
203
|
+
mediaTypes.video &&
|
|
204
|
+
['instream', 'outstream'].indexOf(mediaTypes.video.context) > -1;
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
const mapToPayloadBaseBid = (bidRequest) => ({
|
|
208
|
+
bid: bidRequest.bidId,
|
|
209
|
+
sid: bidRequest.params.sid,
|
|
210
|
+
viz: elementInView(bidRequest.adUnitCode),
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
const mapToPayloadBannerBid = (bidRequest) => ({
|
|
214
|
+
ban: {
|
|
215
|
+
siz: deepAccess(bidRequest, 'mediaTypes.banner.sizes') || [],
|
|
216
|
+
},
|
|
217
|
+
...mapToPayloadBaseBid(bidRequest)
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
const mapToPayloadVideoBid = (bidRequest) => {
|
|
221
|
+
const video = deepAccess(bidRequest, 'mediaTypes.video') || {};
|
|
222
|
+
return {
|
|
223
|
+
vid: {
|
|
224
|
+
ctx: video.context,
|
|
225
|
+
siz: video.playerSize,
|
|
226
|
+
mim: video.mimes,
|
|
227
|
+
},
|
|
228
|
+
...mapToPayloadBaseBid(bidRequest)
|
|
229
|
+
};
|
|
230
|
+
};
|
|
231
|
+
|
|
195
232
|
registerBidder(spec);
|
|
@@ -6,26 +6,64 @@ Module Type: Bidder Adapter
|
|
|
6
6
|
Maintainer: help@cz.stroeer-labs.com
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
+
### Bid Params
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
| Name | Scope | Description | Example | Type |
|
|
12
|
+
|---------------|----------|--------------------|-----------------------------------------|----------|
|
|
13
|
+
| `sid` | required | Slot ID | `'06b782cc-091b-4f53-9cd2-0291679aa1ac'`| `string` |
|
|
14
|
+
|
|
15
|
+
### Ad Unit Configuration
|
|
16
|
+
|
|
17
|
+
#### Banner
|
|
18
|
+
|
|
19
|
+
* The server will ignore sizes that are not supported by the slot or by the platform (such as 987x123).
|
|
20
|
+
|
|
21
|
+
##### Example
|
|
11
22
|
|
|
12
23
|
```javascript
|
|
13
|
-
|
|
14
|
-
|
|
24
|
+
var adUnits = [
|
|
25
|
+
{
|
|
26
|
+
code: 'your-banner-adunit-code',
|
|
15
27
|
mediaTypes: {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
28
|
+
banner: {
|
|
29
|
+
sizes: [[300, 250]],
|
|
30
|
+
}
|
|
19
31
|
},
|
|
20
32
|
bids: [{
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
33
|
+
bidder: 'stroeerCore',
|
|
34
|
+
params: {
|
|
35
|
+
sid: '06b782cc-091b-4f53-9cd2-0291679aa1ac'
|
|
36
|
+
}
|
|
25
37
|
}]
|
|
26
|
-
}
|
|
38
|
+
}
|
|
39
|
+
];
|
|
27
40
|
```
|
|
28
|
-
### Config Notes
|
|
29
41
|
|
|
30
|
-
|
|
31
|
-
|
|
42
|
+
#### Video
|
|
43
|
+
|
|
44
|
+
* Both instream and outstream contexts are supported.
|
|
45
|
+
* We do not provide an outstream renderer. You will need to set up your own. See [Show Outstream Video Ads](https://docs.prebid.org/dev-docs/show-outstream-video-ads.html) for more information.
|
|
46
|
+
* On `mediaTypes.video`, the fields `context` and `mediaTypes` are required.
|
|
47
|
+
|
|
48
|
+
##### Example
|
|
49
|
+
|
|
50
|
+
```javascript
|
|
51
|
+
var adUnits = [
|
|
52
|
+
{
|
|
53
|
+
code: 'your-video-adunit-code',
|
|
54
|
+
mediaTypes: {
|
|
55
|
+
video: {
|
|
56
|
+
context: 'instream',
|
|
57
|
+
playerSize: [640, 480],
|
|
58
|
+
mimes: ['video/mp4', 'video/quicktime', 'video/x-ms-wmv']
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
bids: [{
|
|
62
|
+
bidder: 'stroeerCore',
|
|
63
|
+
params: {
|
|
64
|
+
sid: '35d4225e-f8e3-4f45-b1ea-77913afd00d1'
|
|
65
|
+
}
|
|
66
|
+
}]
|
|
67
|
+
}
|
|
68
|
+
];
|
|
69
|
+
```
|
|
@@ -54,7 +54,7 @@ export const spec = {
|
|
|
54
54
|
data: bids,
|
|
55
55
|
deviceWidth: screen.width,
|
|
56
56
|
hb_version: '$prebid.version$',
|
|
57
|
-
...
|
|
57
|
+
...getSharedViewerIdParameters(validBidRequests),
|
|
58
58
|
...getFirstPartyTeadsIdParameter()
|
|
59
59
|
};
|
|
60
60
|
|
|
@@ -124,6 +124,37 @@ export const spec = {
|
|
|
124
124
|
}
|
|
125
125
|
};
|
|
126
126
|
|
|
127
|
+
/**
|
|
128
|
+
*
|
|
129
|
+
* @param validBidRequests an array of bids
|
|
130
|
+
* @returns {{sharedViewerIdKey : 'sharedViewerIdValue'}} object with all sharedviewerids
|
|
131
|
+
*/
|
|
132
|
+
function getSharedViewerIdParameters(validBidRequests) {
|
|
133
|
+
const sharedViewerIdMapping = {
|
|
134
|
+
unifiedId2: 'uid2.id', // uid2IdSystem
|
|
135
|
+
liveRampId: 'idl_env', // identityLinkIdSystem
|
|
136
|
+
lotamePanoramaId: 'lotamePanoramaId', // lotamePanoramaIdSystem
|
|
137
|
+
id5Id: 'id5id.uid', // id5IdSystem
|
|
138
|
+
criteoId: 'criteoId', // criteoIdSystem
|
|
139
|
+
yahooConnectId: 'connectId', // connectIdSystem
|
|
140
|
+
quantcastId: 'quantcastId', // quantcastIdSystem
|
|
141
|
+
epsilonPublisherLinkId: 'publinkId', // publinkIdSystem
|
|
142
|
+
publisherFirstPartyViewerId: 'pubcid', // sharedIdSystem
|
|
143
|
+
merkleId: 'merkleId.id', // merkleIdSystem
|
|
144
|
+
kinessoId: 'kpuid' // kinessoIdSystem
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
let sharedViewerIdObject = {};
|
|
148
|
+
for (const sharedViewerId in sharedViewerIdMapping) {
|
|
149
|
+
const key = sharedViewerIdMapping[sharedViewerId];
|
|
150
|
+
const value = deepAccess(validBidRequests, `0.userId.${key}`);
|
|
151
|
+
if (value) {
|
|
152
|
+
sharedViewerIdObject[sharedViewerId] = value;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return sharedViewerIdObject;
|
|
156
|
+
}
|
|
157
|
+
|
|
127
158
|
function getReferrerInfo(bidderRequest) {
|
|
128
159
|
let ref = '';
|
|
129
160
|
if (bidderRequest && bidderRequest.refererInfo && bidderRequest.refererInfo.page) {
|
|
@@ -228,15 +259,6 @@ function _validateId(id) {
|
|
|
228
259
|
return (parseInt(id) > 0);
|
|
229
260
|
}
|
|
230
261
|
|
|
231
|
-
/**
|
|
232
|
-
* Get unified ID v2 parameter to be sent in bid request.
|
|
233
|
-
* @param `{id: string} | undefined` optionalUid2 uid2 user ID object available if "uid2IdSystem" module is enabled.
|
|
234
|
-
* @returns `{} | {unifiedId2: string}`
|
|
235
|
-
*/
|
|
236
|
-
function getUnifiedId2Parameter(optionalUid2) {
|
|
237
|
-
return optionalUid2 ? { unifiedId2: optionalUid2.id } : {};
|
|
238
|
-
}
|
|
239
|
-
|
|
240
262
|
/**
|
|
241
263
|
* Get the first-party cookie Teads ID parameter to be sent in bid request.
|
|
242
264
|
* @returns `{} | {firstPartyCookieTeadsId: string}`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { generateUUID, _each } from '../src/utils.js';
|
|
1
|
+
import { generateUUID, _each, deepAccess } from '../src/utils.js';
|
|
2
2
|
import {registerBidder} from '../src/adapters/bidderFactory.js';
|
|
3
3
|
import {BANNER, VIDEO, NATIVE} from '../src/mediaTypes.js';
|
|
4
4
|
import { getStorageManager } from '../src/storageManager.js';
|
|
@@ -251,6 +251,7 @@ function getRequestData(bid, bidderRequest) {
|
|
|
251
251
|
const userIdTdid = (bid.userId && bid.userId.tdid) ? bid.userId.tdid : '';
|
|
252
252
|
const supplyChain = getSupplyChain(bid.schain);
|
|
253
253
|
const bidFloor = getFloor(bid, size, bid.mediaTypes);
|
|
254
|
+
const gpid = deepAccess(bid, 'ortb2Imp.ext.gpid');
|
|
254
255
|
// general bid data
|
|
255
256
|
let bidData = {
|
|
256
257
|
ver: VER,
|
|
@@ -267,17 +268,15 @@ function getRequestData(bid, bidderRequest) {
|
|
|
267
268
|
bidData.fp = bidFloor;
|
|
268
269
|
}
|
|
269
270
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
bidData.u = bidderRequest?.refererInfo?.page || bidderRequest?.refererInfo?.topmostLocation;
|
|
273
|
-
try {
|
|
274
|
-
bidData.host = window.top.location.hostname;
|
|
275
|
-
bidData.xr = 0;
|
|
276
|
-
} catch (e) {
|
|
277
|
-
bidData.host = window.location.hostname;
|
|
278
|
-
bidData.xr = 1;
|
|
271
|
+
if (gpid) {
|
|
272
|
+
bidData.gpid = gpid;
|
|
279
273
|
}
|
|
280
274
|
|
|
275
|
+
addUserId(bidData, bid.userId);
|
|
276
|
+
|
|
277
|
+
bidData.u = bidderRequest.refererInfo.page || bidderRequest.refererInfo.topmostLocation;
|
|
278
|
+
bidData.host = bidderRequest.refererInfo.domain;
|
|
279
|
+
|
|
281
280
|
if (window.location.ancestorOrigins && window.location.ancestorOrigins.length > 0) {
|
|
282
281
|
bidData.ao = window.location.ancestorOrigins[window.location.ancestorOrigins.length - 1];
|
|
283
282
|
}
|