prebid.js 7.4.0 → 7.7.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 +11 -6
- package/dist/1plusXRtdProvider.js +1 -0
- package/dist/33acrossBidAdapter.js +1 -1
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/adnuntiusBidAdapter.js +1 -1
- package/dist/adoceanBidAdapter.js +1 -1
- package/dist/adotBidAdapter.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adrinoBidAdapter.js +1 -1
- package/dist/adtelligentBidAdapter.js +1 -1
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/ajaBidAdapter.js +1 -1
- package/dist/amxBidAdapter.js +1 -1
- package/dist/amxIdSystem.js +1 -1
- package/dist/appierAnalyticsAdapter.js +1 -1
- package/dist/appnexusBidAdapter.js +1 -1
- package/dist/asoBidAdapter.js +1 -1
- package/dist/atsAnalyticsAdapter.js +1 -1
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bliinkBidAdapter.js +1 -1
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/byDataAnalyticsAdapter.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/currency.js +1 -1
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/gdprEnforcement.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/hadronIdSystem.js +1 -1
- package/dist/hadronRtdProvider.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/jixieBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/kargoAnalyticsAdapter.js +1 -1
- package/dist/konduitAnalyticsAdapter.js +1 -1
- package/dist/kueezBidAdapter.js +1 -1
- package/dist/lassoBidAdapter.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/marsmediaBidAdapter.js +1 -1
- package/dist/mediafuseBidAdapter.js +1 -1
- package/dist/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/naveggIdSystem.js +1 -1
- package/dist/newspassidBidAdapter.js +1 -0
- package/dist/nextMillenniumBidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +131 -128
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.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 +1 -1
- package/dist/prebidServerBidAdapter.js +1 -1
- package/dist/priceFloors.js +1 -1
- package/dist/pubCommonId.js +1 -1
- package/dist/publinkIdSystem.js +1 -1
- package/dist/pubmaticBidAdapter.js +1 -1
- package/dist/pubwiseAnalyticsAdapter.js +1 -1
- package/dist/pubxaiAnalyticsAdapter.js +1 -1
- package/dist/pxyzBidAdapter.js +1 -1
- package/dist/quantcastBidAdapter.js +1 -1
- package/dist/rasBidAdapter.js +1 -0
- 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/sharedIdSystem.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/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/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/integrationExamples/gpt/1plusXRtdProviderExample.html +112 -0
- package/karma.conf.maker.js +3 -1
- package/modules/.submodules.json +2 -1
- package/modules/1plusXRtdProvider.js +251 -0
- package/modules/1plusXRtdProvider.md +65 -0
- package/modules/adgenerationBidAdapter.js +24 -1
- package/modules/adnuntiusBidAdapter.js +26 -8
- package/modules/adoceanBidAdapter.js +10 -3
- package/modules/adotBidAdapter.js +13 -4
- package/modules/adrinoBidAdapter.js +10 -2
- package/modules/adrinoBidAdapter.md +6 -0
- package/modules/adtelligentBidAdapter.js +2 -1
- package/modules/appnexusBidAdapter.js +3 -3
- package/modules/atsAnalyticsAdapter.js +4 -5
- package/modules/big-richmediaBidAdapter.js +3 -3
- package/modules/bliinkBidAdapter.js +120 -193
- package/modules/bliinkBidAdapter.md +2 -5
- package/modules/byDataAnalyticsAdapter.js +172 -74
- package/modules/byDataAnalyticsAdapter.md +5 -6
- package/modules/consumableBidAdapter.js +21 -1
- package/modules/criteoBidAdapter.js +7 -1
- package/modules/currency.js +2 -2
- package/modules/cwireBidAdapter.md +1 -1
- package/modules/eplanningBidAdapter.js +82 -97
- package/modules/gdprEnforcement.js +8 -14
- package/modules/gridNMBidAdapter.js +45 -4
- package/modules/hadronAnalyticsAdapter.md +5 -5
- package/modules/hadronIdSystem.js +18 -5
- package/modules/hadronIdSystem.md +15 -11
- package/modules/hadronRtdProvider.js +14 -1
- package/modules/hadronRtdProvider.md +17 -13
- package/modules/imRtdProvider.js +0 -8
- package/modules/impactifyBidAdapter.js +6 -2
- package/modules/ixBidAdapter.js +133 -23
- package/modules/ixBidAdapter.md +2 -5
- package/modules/jixieBidAdapter.js +10 -10
- package/modules/kargoAnalyticsAdapter.js +88 -6
- package/modules/kargoAnalyticsAdapter.md +33 -0
- package/modules/minutemediaBidAdapter.js +1 -0
- package/modules/naveggIdSystem.js +1 -12
- package/modules/newspassidBidAdapter.js +649 -0
- package/modules/nextMillenniumBidAdapter.js +17 -1
- package/modules/nextMillenniumBidAdapter.md +1 -1
- package/modules/oguryBidAdapter.js +2 -0
- package/modules/onetagBidAdapter.js +44 -7
- package/modules/prebidServerBidAdapter/index.js +7 -0
- package/modules/priceFloors.js +1 -1
- package/modules/pubCommonId.js +1 -2
- package/modules/pubxaiAnalyticsAdapter.js +6 -1
- package/modules/rasBidAdapter.js +149 -0
- package/modules/rasBidAdapter.md +50 -0
- package/modules/rubiconBidAdapter.js +5 -0
- package/modules/seedingAllianceBidAdapter.js +3 -0
- package/modules/seedtagBidAdapter.js +37 -1
- package/modules/sharedIdSystem.js +11 -5
- package/modules/sharethroughBidAdapter.js +9 -24
- package/modules/taboolaBidAdapter.js +1 -1
- package/modules/taboolaBidAdapter.md +3 -3
- package/modules/targetVideoBidAdapter.js +18 -0
- package/modules/userId/index.js +39 -21
- package/package.json +1 -1
- package/src/auction.js +6 -5
- package/src/consentHandler.js +11 -11
- package/src/debugging.js +5 -3
- package/src/hook.js +2 -2
- package/src/storageManager.js +4 -5
- package/src/utils/promise.js +96 -21
- package/src/utils.js +3 -2
- package/test/helpers/consentData.js +2 -1
- package/test/spec/auctionmanager_spec.js +1 -6
- package/test/spec/debugging_spec.js +2 -2
- package/test/spec/modules/1plusXRtdProvider_spec.js +430 -0
- package/test/spec/modules/adgenerationBidAdapter_spec.js +52 -4
- package/test/spec/modules/adnuntiusBidAdapter_spec.js +126 -14
- package/test/spec/modules/adoceanBidAdapter_spec.js +4 -1
- package/test/spec/modules/adotBidAdapter_spec.js +12 -9
- package/test/spec/modules/adrinoBidAdapter_spec.js +22 -0
- package/test/spec/modules/appnexusBidAdapter_spec.js +165 -156
- package/test/spec/modules/bliinkBidAdapter_spec.js +323 -136
- package/test/spec/modules/byDataAnalyticsAdapter_spec.js +74 -24
- package/test/spec/modules/consumableBidAdapter_spec.js +122 -1
- package/test/spec/modules/criteoBidAdapter_spec.js +15 -5
- package/test/spec/modules/eplanningBidAdapter_spec.js +58 -18
- package/test/spec/modules/gdprEnforcement_spec.js +53 -100
- package/test/spec/modules/gridNMBidAdapter_spec.js +32 -0
- package/test/spec/modules/hadronIdSystem_spec.js +2 -2
- package/test/spec/modules/idxIdSystem_spec.js +1 -1
- package/test/spec/modules/imRtdProvider_spec.js +0 -1
- package/test/spec/modules/ixBidAdapter_spec.js +212 -5
- package/test/spec/modules/jixieBidAdapter_spec.js +8 -8
- package/test/spec/modules/kargoAnalyticsAdapter_spec.js +42 -0
- package/test/spec/modules/minutemediaBidAdapter_spec.js +3 -0
- package/test/spec/modules/newspassidBidAdapter_spec.js +1793 -0
- package/test/spec/modules/nextMillenniumBidAdapter_spec.js +20 -0
- package/test/spec/modules/onetagBidAdapter_spec.js +53 -4
- package/test/spec/modules/parrableIdSystem_spec.js +2 -1
- package/test/spec/modules/prebidServerBidAdapter_spec.js +20 -0
- package/test/spec/modules/pubxaiAnalyticsAdapter_spec.js +5 -0
- package/test/spec/modules/rasBidAdapter_spec.js +190 -0
- package/test/spec/modules/rubiconBidAdapter_spec.js +27 -0
- package/test/spec/modules/seedtagBidAdapter_spec.js +29 -0
- package/test/spec/modules/sharethroughBidAdapter_spec.js +4 -4
- package/test/spec/modules/taboolaBidAdapter_spec.js +1 -1
- package/test/spec/modules/targetVideoBidAdapter_spec.js +43 -0
- package/test/spec/modules/userId_spec.js +15 -2
- package/test/spec/unit/pbjs_api_spec.js +1 -5
- package/test/spec/unit/utils/promise_spec.js +283 -38
- package/test/helpers/syncPromise.js +0 -71
|
@@ -5,38 +5,80 @@ import enc from 'crypto-js/enc-utf8';
|
|
|
5
5
|
import adapter from '../src/AnalyticsAdapter.js';
|
|
6
6
|
import CONSTANTS from '../src/constants.json';
|
|
7
7
|
import adapterManager from '../src/adapterManager.js';
|
|
8
|
+
import { getStorageManager } from '../src/storageManager.js';
|
|
9
|
+
import { auctionManager } from '../src/auctionManager.js';
|
|
8
10
|
import { ajax } from '../src/ajax.js';
|
|
9
11
|
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
const versionCode = '4.4.1'
|
|
13
|
+
const secretKey = 'bydata@123456'
|
|
14
|
+
const { EVENTS: { NO_BID, BID_TIMEOUT, AUCTION_END, AUCTION_INIT, BID_WON } } = CONSTANTS
|
|
15
|
+
const DEFAULT_EVENT_URL = 'https://pbjs-stream.bydata.com/topics/prebid'
|
|
16
|
+
const analyticsType = 'endpoint'
|
|
17
|
+
const isBydata = isKeyInUrl('bydata_debug')
|
|
18
|
+
const adunitsMap = {}
|
|
19
|
+
const storage = getStorageManager();
|
|
20
|
+
let initOptions = {}
|
|
21
|
+
var payload = {}
|
|
22
|
+
var winPayload = {}
|
|
23
|
+
var isDataSend = window.asc_data || false
|
|
24
|
+
var bdNbTo = { 'to': [], 'nb': [] }
|
|
17
25
|
|
|
26
|
+
/* method used for testing parameters */
|
|
27
|
+
function isKeyInUrl(name) {
|
|
28
|
+
const queryString = window.location.search;
|
|
29
|
+
const urlParams = new URLSearchParams(queryString);
|
|
30
|
+
const param = urlParams.get(name)
|
|
31
|
+
return param
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* return ad unit full path wrt custom ad unit code */
|
|
35
|
+
function getAdunitName(code) {
|
|
36
|
+
var name = code;
|
|
37
|
+
for (const [key, value] of Object.entries(adunitsMap)) {
|
|
38
|
+
if (key === code) { name = value; }
|
|
39
|
+
}
|
|
40
|
+
return name;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* EVENT: auction init */
|
|
44
|
+
function onAuctionStart(t) {
|
|
45
|
+
/* map of ad unit code - ad unit full path */
|
|
46
|
+
t.adUnits && t.adUnits.length && t.adUnits.forEach((adu) => {
|
|
47
|
+
const { code, adunit } = adu
|
|
48
|
+
adunitsMap[code] = adunit
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/* EVENT: bid timeout */
|
|
18
53
|
function onBidTimeout(t) {
|
|
19
54
|
if (payload['visitor_data'] && t && t.length > 0) {
|
|
20
|
-
bdNbTo['to'] = t
|
|
55
|
+
bdNbTo['to'] = t
|
|
21
56
|
}
|
|
22
57
|
}
|
|
23
58
|
|
|
59
|
+
/* EVENT: no bid */
|
|
24
60
|
function onNoBidData(t) {
|
|
25
61
|
if (payload['visitor_data'] && t) {
|
|
26
|
-
bdNbTo['nb'].push(t)
|
|
62
|
+
bdNbTo['nb'].push(t)
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* EVENT: bid won */
|
|
67
|
+
function onBidWon(t) {
|
|
68
|
+
const { isCorrectOption } = initOptions
|
|
69
|
+
if (isCorrectOption && (isDataSend || isBydata)) {
|
|
70
|
+
ascAdapter.getBidWonData(t)
|
|
71
|
+
ascAdapter.sendPayload(winPayload)
|
|
27
72
|
}
|
|
28
73
|
}
|
|
29
74
|
|
|
75
|
+
/* EVENT: auction end */
|
|
30
76
|
function onAuctionEnd(t) {
|
|
31
|
-
|
|
32
|
-
const {isCorrectOption, logFrequency} = initOptions;
|
|
33
|
-
var value = Math.floor(Math.random() * 10000 + 1);
|
|
34
|
-
_logInfo(' value - frequency ', (value + '-' + logFrequency));
|
|
77
|
+
const { isCorrectOption } = initOptions;
|
|
35
78
|
setTimeout(() => {
|
|
36
|
-
if (isCorrectOption &&
|
|
79
|
+
if (isCorrectOption && (isDataSend || isBydata)) {
|
|
37
80
|
ascAdapter.dataProcess(t);
|
|
38
|
-
|
|
39
|
-
ascAdapter.sendPayload();
|
|
81
|
+
ascAdapter.sendPayload(payload);
|
|
40
82
|
}
|
|
41
83
|
}, 500);
|
|
42
84
|
}
|
|
@@ -44,6 +86,9 @@ function onAuctionEnd(t) {
|
|
|
44
86
|
const ascAdapter = Object.assign(adapter({ url: DEFAULT_EVENT_URL, analyticsType: analyticsType }), {
|
|
45
87
|
track({ eventType, args }) {
|
|
46
88
|
switch (eventType) {
|
|
89
|
+
case AUCTION_INIT:
|
|
90
|
+
onAuctionStart(args);
|
|
91
|
+
break;
|
|
47
92
|
case NO_BID:
|
|
48
93
|
onNoBidData(args);
|
|
49
94
|
break;
|
|
@@ -53,6 +98,9 @@ const ascAdapter = Object.assign(adapter({ url: DEFAULT_EVENT_URL, analyticsType
|
|
|
53
98
|
case AUCTION_END:
|
|
54
99
|
onAuctionEnd(args);
|
|
55
100
|
break;
|
|
101
|
+
case BID_WON:
|
|
102
|
+
onBidWon(args);
|
|
103
|
+
break;
|
|
56
104
|
default:
|
|
57
105
|
break;
|
|
58
106
|
}
|
|
@@ -62,9 +110,8 @@ const ascAdapter = Object.assign(adapter({ url: DEFAULT_EVENT_URL, analyticsType
|
|
|
62
110
|
// save the base class function
|
|
63
111
|
ascAdapter.originEnableAnalytics = ascAdapter.enableAnalytics;
|
|
64
112
|
// override enableAnalytics so we can get access to the config passed in from the page
|
|
65
|
-
ascAdapter.enableAnalytics = function(config) {
|
|
113
|
+
ascAdapter.enableAnalytics = function (config) {
|
|
66
114
|
if (this.initConfig(config)) {
|
|
67
|
-
_logInfo('initiated:', initOptions);
|
|
68
115
|
initOptions.isCorrectOption && ascAdapter.getVisitorData();
|
|
69
116
|
ascAdapter.originEnableAnalytics(config);
|
|
70
117
|
}
|
|
@@ -73,7 +120,7 @@ ascAdapter.enableAnalytics = function(config) {
|
|
|
73
120
|
ascAdapter.initConfig = function (config) {
|
|
74
121
|
let isCorrectOption = true;
|
|
75
122
|
initOptions = {};
|
|
76
|
-
|
|
123
|
+
var rndNum = Math.floor(Math.random() * 10000 + 1);
|
|
77
124
|
initOptions.options = deepClone(config.options);
|
|
78
125
|
initOptions.clientId = initOptions.options.clientId || null;
|
|
79
126
|
initOptions.logFrequency = initOptions.options.logFrequency;
|
|
@@ -81,13 +128,41 @@ ascAdapter.initConfig = function (config) {
|
|
|
81
128
|
_logError('"options.clientId" should not empty!!');
|
|
82
129
|
isCorrectOption = false;
|
|
83
130
|
}
|
|
131
|
+
if (rndNum <= initOptions.logFrequency) { window.asc_data = isDataSend = true; }
|
|
84
132
|
initOptions.isCorrectOption = isCorrectOption;
|
|
85
133
|
this.initOptions = initOptions;
|
|
86
134
|
return isCorrectOption;
|
|
87
135
|
};
|
|
88
136
|
|
|
89
|
-
ascAdapter.
|
|
90
|
-
|
|
137
|
+
ascAdapter.getBidWonData = function(t) {
|
|
138
|
+
const { auctionId, adUnitCode, size, requestId, bidder, timeToRespond, currency, mediaType, cpm } = t
|
|
139
|
+
const aun = getAdunitName(adUnitCode)
|
|
140
|
+
winPayload['aid'] = auctionId
|
|
141
|
+
winPayload['as'] = '';
|
|
142
|
+
winPayload['auctionData'] = [];
|
|
143
|
+
var data = {}
|
|
144
|
+
data['au'] = aun
|
|
145
|
+
data['auc'] = adUnitCode
|
|
146
|
+
data['aus'] = size
|
|
147
|
+
data['bid'] = requestId
|
|
148
|
+
data['bidadv'] = bidder
|
|
149
|
+
data['br_pb_mg'] = cpm
|
|
150
|
+
data['br_tr'] = timeToRespond
|
|
151
|
+
data['bradv'] = bidder
|
|
152
|
+
data['brid'] = requestId
|
|
153
|
+
data['brs'] = size
|
|
154
|
+
data['cur'] = currency
|
|
155
|
+
data['inb'] = 0
|
|
156
|
+
data['ito'] = 0
|
|
157
|
+
data['ipwb'] = 1
|
|
158
|
+
data['iwb'] = 1
|
|
159
|
+
data['mt'] = mediaType
|
|
160
|
+
winPayload['auctionData'].push(data)
|
|
161
|
+
return winPayload
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
ascAdapter.getVisitorData = function (data = {}) {
|
|
165
|
+
var ua = data.uid ? data : {};
|
|
91
166
|
var module = {
|
|
92
167
|
options: [],
|
|
93
168
|
header: [window.navigator.platform, window.navigator.userAgent, window.navigator.appVersion, window.navigator.vendor, window.opera],
|
|
@@ -152,7 +227,7 @@ ascAdapter.getVisitorData = function(data = {}) {
|
|
|
152
227
|
crypto.getRandomValues(buffer);
|
|
153
228
|
buffer[6] = (buffer[6] & ~176) | 64;
|
|
154
229
|
buffer[8] = (buffer[8] & ~64) | 128;
|
|
155
|
-
var hex = Array.prototype.map.call(new Uint8Array(buffer), function(x) {
|
|
230
|
+
var hex = Array.prototype.map.call(new Uint8Array(buffer), function (x) {
|
|
156
231
|
return ('00' + x.toString(16)).slice(-2);
|
|
157
232
|
}).join('');
|
|
158
233
|
return hex.slice(0, 5) + '-' + hex.slice(5, 9) + '-' + hex.slice(9, 13) + '-' + hex.slice(13, 18);
|
|
@@ -182,34 +257,46 @@ ascAdapter.getVisitorData = function(data = {}) {
|
|
|
182
257
|
var signedToken = token + '.' + signature;
|
|
183
258
|
return signedToken;
|
|
184
259
|
}
|
|
185
|
-
|
|
186
|
-
|
|
260
|
+
function detectWidth() {
|
|
261
|
+
return window.screen.width || (window.innerWidth && document.documentElement.clientWidth) ? Math.min(window.innerWidth, document.documentElement.clientWidth) : window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth;
|
|
262
|
+
}
|
|
263
|
+
function giveDeviceTypeOnScreenSize() {
|
|
264
|
+
var _dWidth = detectWidth();
|
|
265
|
+
return _dWidth > 1024 ? 'Desktop' : (_dWidth <= 1024 && _dWidth >= 768) ? 'Tablet' : 'Mobile';
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
const { clientId } = initOptions;
|
|
269
|
+
var userId = storage.getDataFromLocalStorage('userId')
|
|
187
270
|
if (!userId) {
|
|
188
271
|
userId = generateUid();
|
|
189
|
-
|
|
272
|
+
storage.setDataInLocalStorage('userId', userId);
|
|
190
273
|
}
|
|
191
|
-
var screenSize = {width: window.screen.width, height: window.screen.height};
|
|
192
|
-
var deviceType =
|
|
274
|
+
var screenSize = { width: window.screen.width, height: window.screen.height };
|
|
275
|
+
var deviceType = giveDeviceTypeOnScreenSize();
|
|
193
276
|
var e = module.init();
|
|
194
|
-
if (!ua['
|
|
195
|
-
ua['
|
|
196
|
-
ua['
|
|
197
|
-
ua['
|
|
198
|
-
ua['
|
|
199
|
-
ua['
|
|
200
|
-
ua['
|
|
201
|
-
ua['
|
|
202
|
-
ua['
|
|
203
|
-
ua['
|
|
277
|
+
if (!ua['uid']) {
|
|
278
|
+
ua['uid'] = userId;
|
|
279
|
+
ua['cid'] = clientId;
|
|
280
|
+
ua['pid'] = window.location.hostname;
|
|
281
|
+
ua['os'] = e.os.name;
|
|
282
|
+
ua['osv'] = e.os.version;
|
|
283
|
+
ua['br'] = e.browser.name;
|
|
284
|
+
ua['brv'] = e.browser.version;
|
|
285
|
+
ua['ss'] = screenSize;
|
|
286
|
+
ua['de'] = deviceType;
|
|
287
|
+
ua['tz'] = window.Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
204
288
|
}
|
|
205
289
|
var signedToken = getJWToken(ua);
|
|
206
290
|
payload['visitor_data'] = signedToken;
|
|
291
|
+
winPayload['visitor_data'] = signedToken;
|
|
207
292
|
return signedToken;
|
|
208
293
|
}
|
|
209
294
|
|
|
210
|
-
ascAdapter.dataProcess = function(t) {
|
|
211
|
-
payload['
|
|
212
|
-
|
|
295
|
+
ascAdapter.dataProcess = function (t) {
|
|
296
|
+
if (isBydata) { payload['bydata_debug'] = 'true'; }
|
|
297
|
+
_logInfo('fulldata - ', t);
|
|
298
|
+
payload['aid'] = t.auctionId;
|
|
299
|
+
payload['as'] = t.timestamp;
|
|
213
300
|
payload['auctionData'] = [];
|
|
214
301
|
var bidderRequestsData = []; var bidsReceivedData = [];
|
|
215
302
|
t.bidderRequests && t.bidderRequests.forEach(bidReq => {
|
|
@@ -228,69 +315,80 @@ ascAdapter.dataProcess = function(t) {
|
|
|
228
315
|
bidderRequestsData.push(pObj);
|
|
229
316
|
});
|
|
230
317
|
t.bidsReceived && t.bidsReceived.forEach(bid => {
|
|
231
|
-
const {requestId, bidder, width, height, cpm, currency, timeToRespond, adUnitCode} = bid;
|
|
232
|
-
bidsReceivedData.push({requestId, bidder, width, height, cpm, currency, timeToRespond, adUnitCode});
|
|
318
|
+
const { requestId, bidder, width, height, cpm, currency, timeToRespond, adUnitCode } = bid;
|
|
319
|
+
bidsReceivedData.push({ requestId, bidder, width, height, cpm, currency, timeToRespond, adUnitCode });
|
|
233
320
|
});
|
|
234
321
|
bidderRequestsData.length > 0 && bidderRequestsData.forEach(bdObj => {
|
|
235
322
|
var bdsArray = bdObj['bids'];
|
|
236
323
|
bdsArray.forEach(bid => {
|
|
237
|
-
const {adUnitCode, sizes, bidder, bidId, mediaTypes} = bid;
|
|
324
|
+
const { adUnitCode, sizes, bidder, bidId, mediaTypes } = bid;
|
|
238
325
|
sizes.forEach(size => {
|
|
239
326
|
var sstr = size[0] + 'x' + size[1]
|
|
240
|
-
payload['auctionData'].push({
|
|
327
|
+
payload['auctionData'].push({ au: getAdunitName(adUnitCode), auc: adUnitCode, aus: sstr, mt: mediaTypes[0], bidadv: bidder, bid: bidId, inb: 0, ito: 0, ipwb: 0, iwb: 0 });
|
|
241
328
|
});
|
|
242
329
|
});
|
|
243
330
|
});
|
|
331
|
+
|
|
244
332
|
bidsReceivedData.length > 0 && bidsReceivedData.forEach(bdRecived => {
|
|
245
|
-
const {requestId, bidder, width, height, cpm, currency, timeToRespond} = bdRecived;
|
|
333
|
+
const { requestId, bidder, width, height, cpm, currency, timeToRespond } = bdRecived;
|
|
246
334
|
payload['auctionData'].forEach(rwData => {
|
|
247
|
-
if (rwData['
|
|
248
|
-
rwData['
|
|
249
|
-
rwData['
|
|
335
|
+
if (rwData['bid'] === requestId && rwData['aus'] === width + 'x' + height) {
|
|
336
|
+
rwData['brid'] = requestId; rwData['bradv'] = bidder; rwData['br_pb_mg'] = cpm;
|
|
337
|
+
rwData['cur'] = currency; rwData['br_tr'] = timeToRespond; rwData['brs'] = width + 'x' + height;
|
|
250
338
|
}
|
|
251
339
|
})
|
|
252
340
|
});
|
|
341
|
+
|
|
342
|
+
var prebidWinningBids = auctionManager.getBidsReceived().filter(bid => bid.status === CONSTANTS.BID_STATUS.BID_TARGETING_SET);
|
|
343
|
+
prebidWinningBids && prebidWinningBids.length > 0 && prebidWinningBids.forEach(pbbid => {
|
|
344
|
+
payload['auctionData'] && payload['auctionData'].forEach(rwData => {
|
|
345
|
+
if (rwData['bid'] === pbbid.requestId && rwData['brs'] === pbbid.size) {
|
|
346
|
+
rwData['ipwb'] = 1;
|
|
347
|
+
}
|
|
348
|
+
});
|
|
349
|
+
})
|
|
350
|
+
|
|
351
|
+
var winningBids = auctionManager.getAllWinningBids();
|
|
352
|
+
winningBids && winningBids.length > 0 && winningBids.forEach(wBid => {
|
|
353
|
+
payload['auctionData'] && payload['auctionData'].forEach(rwData => {
|
|
354
|
+
if (rwData['bid'] === wBid.requestId && rwData['brs'] === wBid.size) {
|
|
355
|
+
rwData['iwb'] = 1;
|
|
356
|
+
}
|
|
357
|
+
});
|
|
358
|
+
})
|
|
359
|
+
|
|
253
360
|
payload['auctionData'] && payload['auctionData'].length > 0 && payload['auctionData'].forEach(u => {
|
|
254
361
|
bdNbTo['to'].forEach(i => {
|
|
255
|
-
if (u.
|
|
362
|
+
if (u.bid === i.bidId) u.ito = 1;
|
|
256
363
|
});
|
|
257
364
|
bdNbTo['nb'].forEach(i => {
|
|
258
|
-
if (u.
|
|
365
|
+
if (u.bidadv === i.bidder && u.bid === i.bidId) { u.inb = 1; }
|
|
259
366
|
})
|
|
260
367
|
});
|
|
261
368
|
return payload;
|
|
262
369
|
}
|
|
263
370
|
|
|
264
|
-
ascAdapter.sendPayload = function () {
|
|
265
|
-
var obj = { 'records': [
|
|
371
|
+
ascAdapter.sendPayload = function (data) {
|
|
372
|
+
var obj = { 'records': [{ 'value': data }] };
|
|
266
373
|
let strJSON = JSON.stringify(obj);
|
|
267
|
-
|
|
268
|
-
|
|
374
|
+
sendDataOnKf(strJSON);
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
function sendDataOnKf(dataObj) {
|
|
378
|
+
ajax(DEFAULT_EVENT_URL, {
|
|
379
|
+
success: function () {
|
|
380
|
+
_logInfo('send data success');
|
|
381
|
+
},
|
|
382
|
+
error: function (e) {
|
|
383
|
+
_logInfo('send data error', e);
|
|
384
|
+
}
|
|
385
|
+
}, dataObj, {
|
|
269
386
|
contentType: 'application/vnd.kafka.json.v2+json',
|
|
270
387
|
method: 'POST',
|
|
271
388
|
withCredentials: true
|
|
272
389
|
});
|
|
273
390
|
}
|
|
274
391
|
|
|
275
|
-
function addKeyForPrebidWinningAndWinningsBids() {
|
|
276
|
-
var prebidWinningBids = $$PREBID_GLOBAL$$.getAllPrebidWinningBids();
|
|
277
|
-
var winningBids = $$PREBID_GLOBAL$$.getAllWinningBids();
|
|
278
|
-
prebidWinningBids && prebidWinningBids.length > 0 && prebidWinningBids.forEach(pbbid => {
|
|
279
|
-
payload['auctionData'] && payload['auctionData'].forEach(rwData => {
|
|
280
|
-
if (rwData['bids_bid_id'] === pbbid.requestId && rwData['br_size'] === pbbid.size) {
|
|
281
|
-
rwData['is_prebid_winning_bid'] = 1;
|
|
282
|
-
}
|
|
283
|
-
});
|
|
284
|
-
})
|
|
285
|
-
winningBids && winningBids.length > 0 && winningBids.forEach(wBid => {
|
|
286
|
-
payload['auctionData'] && payload['auctionData'].forEach(rwData => {
|
|
287
|
-
if (rwData['bids_bid_id'] === wBid.requestId && rwData['br_size'] === wBid.size) {
|
|
288
|
-
rwData['is_winning_bid'] = 1;
|
|
289
|
-
}
|
|
290
|
-
});
|
|
291
|
-
})
|
|
292
|
-
}
|
|
293
|
-
|
|
294
392
|
adapterManager.registerAnalyticsAdapter({
|
|
295
393
|
adapter: ascAdapter,
|
|
296
394
|
code: 'bydata'
|
|
@@ -305,7 +403,7 @@ function _logError(message) {
|
|
|
305
403
|
}
|
|
306
404
|
|
|
307
405
|
function buildLogMessage(message) {
|
|
308
|
-
return 'Bydata Prebid Analytics
|
|
406
|
+
return 'Bydata Prebid Analytics ' + versionCode + ':' + message;
|
|
309
407
|
}
|
|
310
408
|
|
|
311
409
|
export default ascAdapter;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Overview
|
|
2
2
|
|
|
3
3
|
layout: Analytics Adapter
|
|
4
|
-
title:
|
|
4
|
+
title: byData. (https://bydata.com/)
|
|
5
5
|
description: Bydata Analytics Adapter
|
|
6
6
|
modulecode: byDataAnalyticsAdapter
|
|
7
7
|
gdpr_supported: false (EU GDPR support)
|
|
@@ -13,11 +13,12 @@ enable_download: false (in case you don't want users of the website to dow
|
|
|
13
13
|
|
|
14
14
|
Module Name: Bydata Analytics Adapter
|
|
15
15
|
Module Type: Analytics Adapter
|
|
16
|
-
Maintainer:
|
|
16
|
+
Maintainer: byData
|
|
17
17
|
|
|
18
18
|
# Description
|
|
19
19
|
|
|
20
|
-
Analytics adapter for https://
|
|
20
|
+
Analytics adapter for https://bydata.com/. Contact admin@byData.com for information.
|
|
21
|
+
|
|
21
22
|
|
|
22
23
|
# Test Parameters
|
|
23
24
|
|
|
@@ -25,10 +26,8 @@ Analytics adapter for https://ascendeum.com/. Contact engineering@ascendeum.com
|
|
|
25
26
|
{
|
|
26
27
|
provider: 'bydata',
|
|
27
28
|
options : {
|
|
28
|
-
clientId: "
|
|
29
|
+
clientId: "please contact byData team to get a clientId",
|
|
29
30
|
logFrequency : 100, // Sample Rate Default - 1%
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
33
|
```
|
|
33
|
-
|
|
34
|
-
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { logWarn, createTrackPixelHtml } from '../src/utils.js';
|
|
1
|
+
import { logWarn, createTrackPixelHtml, deepAccess, isArray, deepSetValue } from '../src/utils.js';
|
|
2
|
+
import {config} from '../src/config.js';
|
|
2
3
|
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
3
4
|
|
|
4
5
|
const BIDDER_CODE = 'consumable';
|
|
@@ -66,6 +67,14 @@ export const spec = {
|
|
|
66
67
|
data.ccpa = bidderRequest.uspConsent;
|
|
67
68
|
}
|
|
68
69
|
|
|
70
|
+
if (bidderRequest && bidderRequest.schain) {
|
|
71
|
+
data.schain = bidderRequest.schain;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (config.getConfig('coppa')) {
|
|
75
|
+
data.coppa = true;
|
|
76
|
+
}
|
|
77
|
+
|
|
69
78
|
validBidRequests.map(bid => {
|
|
70
79
|
const sizes = (bid.mediaTypes && bid.mediaTypes.banner && bid.mediaTypes.banner.sizes) || bid.sizes || [];
|
|
71
80
|
const placement = Object.assign({
|
|
@@ -78,6 +87,8 @@ export const spec = {
|
|
|
78
87
|
}
|
|
79
88
|
});
|
|
80
89
|
|
|
90
|
+
handleEids(data, validBidRequests);
|
|
91
|
+
|
|
81
92
|
ret.data = JSON.stringify(data);
|
|
82
93
|
ret.bidRequest = validBidRequests;
|
|
83
94
|
ret.bidderRequest = bidderRequest;
|
|
@@ -234,4 +245,13 @@ function retrieveAd(decision, unitId, unitName) {
|
|
|
234
245
|
return ad;
|
|
235
246
|
}
|
|
236
247
|
|
|
248
|
+
function handleEids(data, validBidRequests) {
|
|
249
|
+
let bidUserIdAsEids = deepAccess(validBidRequests, '0.userIdAsEids');
|
|
250
|
+
if (isArray(bidUserIdAsEids) && bidUserIdAsEids.length > 0) {
|
|
251
|
+
deepSetValue(data, 'user.eids', bidUserIdAsEids);
|
|
252
|
+
} else {
|
|
253
|
+
deepSetValue(data, 'user.eids', undefined);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
237
257
|
registerBidder(spec);
|
|
@@ -13,7 +13,7 @@ const BIDDER_CODE = 'criteo';
|
|
|
13
13
|
const CDB_ENDPOINT = 'https://bidder.criteo.com/cdb';
|
|
14
14
|
const PROFILE_ID_INLINE = 207;
|
|
15
15
|
export const PROFILE_ID_PUBLISHERTAG = 185;
|
|
16
|
-
const storage = getStorageManager({ gvlid: GVLID, bidderCode: BIDDER_CODE });
|
|
16
|
+
export const storage = getStorageManager({ gvlid: GVLID, bidderCode: BIDDER_CODE });
|
|
17
17
|
const LOG_PREFIX = 'Criteo: ';
|
|
18
18
|
|
|
19
19
|
/*
|
|
@@ -255,6 +255,12 @@ function buildCdbUrl(context) {
|
|
|
255
255
|
url += '&wv=' + encodeURIComponent('$prebid.version$');
|
|
256
256
|
url += '&cb=' + String(Math.floor(Math.random() * 99999999999));
|
|
257
257
|
|
|
258
|
+
if (storage.localStorageIsEnabled()) {
|
|
259
|
+
url += '&lsavail=1';
|
|
260
|
+
} else {
|
|
261
|
+
url += '&lsavail=0';
|
|
262
|
+
}
|
|
263
|
+
|
|
258
264
|
if (context.amp) {
|
|
259
265
|
url += '&im=1';
|
|
260
266
|
}
|
package/modules/currency.js
CHANGED
|
@@ -5,7 +5,7 @@ import CONSTANTS from '../src/constants.json';
|
|
|
5
5
|
import { ajax } from '../src/ajax.js';
|
|
6
6
|
import { config } from '../src/config.js';
|
|
7
7
|
import { getHook } from '../src/hook.js';
|
|
8
|
-
import {
|
|
8
|
+
import {defer} from '../src/utils/promise.js';
|
|
9
9
|
|
|
10
10
|
const DEFAULT_CURRENCY_RATE_URL = 'https://cdn.jsdelivr.net/gh/prebid/currency-file@1/latest.json?date=$$TODAY$$';
|
|
11
11
|
const CURRENCY_RATE_PRECISION = 4;
|
|
@@ -24,7 +24,7 @@ var defaultRates;
|
|
|
24
24
|
export const ready = (() => {
|
|
25
25
|
let ctl;
|
|
26
26
|
function reset() {
|
|
27
|
-
ctl =
|
|
27
|
+
ctl = defer();
|
|
28
28
|
}
|
|
29
29
|
reset();
|
|
30
30
|
return {done: () => ctl.resolve(), reset, promise: () => ctl.promise}
|
|
@@ -38,7 +38,7 @@ var adUnits = [
|
|
|
38
38
|
params: {
|
|
39
39
|
pageId: 1422, // required - number
|
|
40
40
|
placementId: 2211521, // required - number
|
|
41
|
-
cwcreative: 42,
|
|
41
|
+
cwcreative: '42', // optional - id of creative to force
|
|
42
42
|
refgroups: 'test-user', // optional - name of group or coma separated list of groups to force
|
|
43
43
|
cwapikey: 'api_key_xyz', // optional - api key for integration testing
|
|
44
44
|
}
|