prebid.js 7.4.0 → 7.5.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/33acrossBidAdapter.js +1 -1
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/adotBidAdapter.js +1 -1
- package/dist/adrelevantisBidAdapter.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/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/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/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/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/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/not-for-prod/prebid.js +111 -111
- 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/pubCommonId.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/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/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/karma.conf.maker.js +3 -1
- package/modules/adotBidAdapter.js +3 -3
- package/modules/appnexusBidAdapter.js +3 -3
- package/modules/criteoBidAdapter.js +7 -1
- package/modules/cwireBidAdapter.md +1 -1
- package/modules/gdprEnforcement.js +8 -14
- 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/ixBidAdapter.js +69 -10
- package/modules/kargoAnalyticsAdapter.js +88 -6
- package/modules/kargoAnalyticsAdapter.md +33 -0
- package/modules/pubCommonId.js +1 -2
- package/modules/seedtagBidAdapter.js +33 -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/package.json +1 -1
- package/src/storageManager.js +4 -5
- package/test/spec/modules/appnexusBidAdapter_spec.js +165 -156
- package/test/spec/modules/criteoBidAdapter_spec.js +15 -5
- package/test/spec/modules/gdprEnforcement_spec.js +53 -100
- package/test/spec/modules/hadronIdSystem_spec.js +2 -2
- package/test/spec/modules/ixBidAdapter_spec.js +96 -5
- package/test/spec/modules/kargoAnalyticsAdapter_spec.js +42 -0
- package/test/spec/modules/seedtagBidAdapter_spec.js +4 -0
- package/test/spec/modules/sharethroughBidAdapter_spec.js +4 -4
- package/test/spec/modules/taboolaBidAdapter_spec.js +1 -1
|
@@ -44,8 +44,9 @@ pbjs.setConfig(
|
|
|
44
44
|
params: {
|
|
45
45
|
segmentCache: false,
|
|
46
46
|
requestParams: {
|
|
47
|
-
publisherId: 1234
|
|
48
|
-
}
|
|
47
|
+
publisherId: 1234 // deprecated, use partnerId instead
|
|
48
|
+
},
|
|
49
|
+
partnerId: 1234
|
|
49
50
|
}
|
|
50
51
|
}
|
|
51
52
|
]
|
|
@@ -56,15 +57,17 @@ pbjs.setConfig(
|
|
|
56
57
|
|
|
57
58
|
### Parameter Descriptions for the Hadron Configuration Section
|
|
58
59
|
|
|
59
|
-
| Name
|
|
60
|
-
|
|
61
|
-
| name
|
|
62
|
-
| waitForIt
|
|
63
|
-
| params
|
|
64
|
-
| params.
|
|
65
|
-
| params.
|
|
66
|
-
| params.
|
|
67
|
-
| params.
|
|
60
|
+
| Name | Type | Description | Notes |
|
|
61
|
+
|:---------------------------------|:---------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------------------|
|
|
62
|
+
| name | String | Real time data module name | Always 'hadron' |
|
|
63
|
+
| waitForIt | Boolean | Required to ensure that the auction is delayed until prefetch is complete | Optional. Defaults to false |
|
|
64
|
+
| params | Object | | |
|
|
65
|
+
| params.partnerId | Number | This is the Audigent Partner ID obtained from Audigent. | `1234` |
|
|
66
|
+
| params.handleRtd | Function | A passable RTD handler that allows custom adunit and ortb2 logic to be configured. The function signature is (bidConfig, rtd, rtdConfig, pbConfig) => {}. | Optional |
|
|
67
|
+
| params.segmentCache | Boolean | This parameter tells the Hadron RTD module to attempt reading segments from a local storage cache instead of always requesting them from the Audigent server. | Optional. Defaults to false. |
|
|
68
|
+
| params.requestParams | Object | Publisher partner specific configuration options, such as optional publisher id and other segment query related metadata to be submitted to Audigent's backend with each request. Contact prebid@audigent.com for more information. | Optional |
|
|
69
|
+
| params.requestParams.publisherId | Object | (deprecated) Publisher id and other segment query related metadata to be submitted to Audigent's backend with each request. Contact prebid@audigent.com for more information. | Optional |
|
|
70
|
+
| params.hadronIdUrl | String | Parameter to specify alternate hadronid endpoint url. | Optional |
|
|
68
71
|
|
|
69
72
|
### Publisher Customized RTD Handling
|
|
70
73
|
As indicated above, it is possible to provide your own bid augmentation
|
|
@@ -100,8 +103,9 @@ pbjs.setConfig(
|
|
|
100
103
|
},
|
|
101
104
|
segmentCache: false,
|
|
102
105
|
requestParams: {
|
|
103
|
-
publisherId: 1234
|
|
104
|
-
}
|
|
106
|
+
publisherId: 1234 // deprecated, use partnerId instead
|
|
107
|
+
},
|
|
108
|
+
partnerId: 1234
|
|
105
109
|
}
|
|
106
110
|
}
|
|
107
111
|
]
|
package/modules/ixBidAdapter.js
CHANGED
|
@@ -30,7 +30,6 @@ import {Renderer} from '../src/Renderer.js';
|
|
|
30
30
|
const BIDDER_CODE = 'ix';
|
|
31
31
|
const ALIAS_BIDDER_CODE = 'roundel';
|
|
32
32
|
const GLOBAL_VENDOR_ID = 10;
|
|
33
|
-
const MODULE_TYPE = 'bid-adapter';
|
|
34
33
|
const SECURE_BID_URL = 'https://htlb.casalemedia.com/openrtb/pbjs';
|
|
35
34
|
const SUPPORTED_AD_TYPES = [BANNER, VIDEO, NATIVE];
|
|
36
35
|
const BANNER_ENDPOINT_VERSION = 7.2;
|
|
@@ -46,9 +45,9 @@ const OUTSTREAM_MINIMUM_PLAYER_SIZE = [144, 144];
|
|
|
46
45
|
const PRICE_TO_DOLLAR_FACTOR = {
|
|
47
46
|
JPY: 1
|
|
48
47
|
};
|
|
49
|
-
const
|
|
50
|
-
|
|
48
|
+
const IFRAME_USER_SYNC_URL = 'https://js-sec.indexww.com/um/ixmatch.html';
|
|
51
49
|
const FLOOR_SOURCE = { PBJS: 'p', IX: 'x' };
|
|
50
|
+
const IMG_USER_SYNC_URL = 'https://dsum.casalemedia.com/pbusermatch?origin=prebid'
|
|
52
51
|
export const ERROR_CODES = {
|
|
53
52
|
BID_SIZE_INVALID_FORMAT: 1,
|
|
54
53
|
BID_SIZE_NOT_INCLUDED: 2,
|
|
@@ -191,6 +190,9 @@ const NATIVE_EVENT_TRACKING_METHOD = {
|
|
|
191
190
|
const LOCAL_STORAGE_KEY = 'ixdiag';
|
|
192
191
|
let hasRegisteredHandler = false;
|
|
193
192
|
export const storage = getStorageManager({gvlid: GLOBAL_VENDOR_ID, bidderCode: BIDDER_CODE});
|
|
193
|
+
let siteID = 0;
|
|
194
|
+
let gdprConsent = '';
|
|
195
|
+
let usPrivacy = '';
|
|
194
196
|
|
|
195
197
|
// Possible values for bidResponse.seatBid[].bid[].mtype which indicates the type of the creative markup so that it can properly be associated with the right sub-object of the BidRequest.Imp.
|
|
196
198
|
const MEDIA_TYPES = {
|
|
@@ -882,6 +884,11 @@ function buildRequest(validBidRequests, bidderRequest, impressions, version) {
|
|
|
882
884
|
if (tmax) {
|
|
883
885
|
r.ext.ixdiag.tmax = tmax
|
|
884
886
|
}
|
|
887
|
+
|
|
888
|
+
if (config.getConfig('userSync')) {
|
|
889
|
+
r.ext.ixdiag.syncsPerBidder = config.getConfig('userSync').syncsPerBidder;
|
|
890
|
+
}
|
|
891
|
+
|
|
885
892
|
// Get cached errors stored in LocalStorage
|
|
886
893
|
const cachedErrors = getCachedErrors();
|
|
887
894
|
|
|
@@ -910,7 +917,7 @@ function buildRequest(validBidRequests, bidderRequest, impressions, version) {
|
|
|
910
917
|
// Apply GDPR information to the request if GDPR is enabled.
|
|
911
918
|
if (bidderRequest) {
|
|
912
919
|
if (bidderRequest.gdprConsent) {
|
|
913
|
-
|
|
920
|
+
gdprConsent = bidderRequest.gdprConsent;
|
|
914
921
|
|
|
915
922
|
if (gdprConsent.hasOwnProperty('gdprApplies')) {
|
|
916
923
|
r.regs = {
|
|
@@ -936,6 +943,7 @@ function buildRequest(validBidRequests, bidderRequest, impressions, version) {
|
|
|
936
943
|
|
|
937
944
|
if (bidderRequest.uspConsent) {
|
|
938
945
|
deepSetValue(r, 'regs.ext.us_privacy', bidderRequest.uspConsent);
|
|
946
|
+
usPrivacy = bidderRequest.uspConsent;
|
|
939
947
|
}
|
|
940
948
|
|
|
941
949
|
if (pageUrl) {
|
|
@@ -949,7 +957,9 @@ function buildRequest(validBidRequests, bidderRequest, impressions, version) {
|
|
|
949
957
|
|
|
950
958
|
const payload = {};
|
|
951
959
|
// Use the siteId in the first bid request as the main siteId.
|
|
952
|
-
|
|
960
|
+
siteID = validBidRequests[0].params.siteId;
|
|
961
|
+
payload.s = siteID;
|
|
962
|
+
payload.v = version;
|
|
953
963
|
if (version) {
|
|
954
964
|
payload.v = version;
|
|
955
965
|
}
|
|
@@ -1414,7 +1424,7 @@ function localStorageHandler(data) {
|
|
|
1414
1424
|
hasEnforcementHook: false,
|
|
1415
1425
|
valid: hasDeviceAccess()
|
|
1416
1426
|
};
|
|
1417
|
-
validateStorageEnforcement(GLOBAL_VENDOR_ID, BIDDER_CODE,
|
|
1427
|
+
validateStorageEnforcement(GLOBAL_VENDOR_ID, BIDDER_CODE, DEFAULT_ENFORCEMENT_SETTINGS, (permissions) => {
|
|
1418
1428
|
if (permissions.valid) {
|
|
1419
1429
|
storeErrorEventData(data);
|
|
1420
1430
|
}
|
|
@@ -1763,11 +1773,60 @@ export const spec = {
|
|
|
1763
1773
|
* @returns {array} User sync pixels
|
|
1764
1774
|
*/
|
|
1765
1775
|
getUserSyncs: function (syncOptions, serverResponses) {
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1776
|
+
const syncs = [];
|
|
1777
|
+
let publisherSyncsPerBidderOverride = null;
|
|
1778
|
+
if (serverResponses.length > 0) {
|
|
1779
|
+
publisherSyncsPerBidderOverride = deepAccess(serverResponses[0], 'body.ext.publishersyncsperbidderoverride');
|
|
1780
|
+
}
|
|
1781
|
+
if (publisherSyncsPerBidderOverride !== undefined && publisherSyncsPerBidderOverride == 0) {
|
|
1782
|
+
return [];
|
|
1783
|
+
}
|
|
1784
|
+
if (syncOptions.iframeEnabled) {
|
|
1785
|
+
syncs.push({
|
|
1786
|
+
type: 'iframe',
|
|
1787
|
+
url: IFRAME_USER_SYNC_URL
|
|
1788
|
+
})
|
|
1789
|
+
} else {
|
|
1790
|
+
let publisherSyncsPerBidder = null;
|
|
1791
|
+
if (config.getConfig('userSync')) {
|
|
1792
|
+
publisherSyncsPerBidder = config.getConfig('userSync').syncsPerBidder
|
|
1793
|
+
}
|
|
1794
|
+
if (publisherSyncsPerBidder === 0) {
|
|
1795
|
+
publisherSyncsPerBidder = publisherSyncsPerBidderOverride
|
|
1796
|
+
}
|
|
1797
|
+
if (publisherSyncsPerBidderOverride && (publisherSyncsPerBidder === 0 || publisherSyncsPerBidder)) {
|
|
1798
|
+
publisherSyncsPerBidder = publisherSyncsPerBidderOverride > publisherSyncsPerBidder ? publisherSyncsPerBidder : publisherSyncsPerBidderOverride
|
|
1799
|
+
} else {
|
|
1800
|
+
publisherSyncsPerBidder = 1
|
|
1801
|
+
}
|
|
1802
|
+
for (let i = 0; i < publisherSyncsPerBidder; i++) {
|
|
1803
|
+
syncs.push({
|
|
1804
|
+
type: 'image',
|
|
1805
|
+
url: buildImgSyncUrl(publisherSyncsPerBidder, i)
|
|
1806
|
+
})
|
|
1807
|
+
}
|
|
1808
|
+
}
|
|
1809
|
+
return syncs;
|
|
1770
1810
|
}
|
|
1771
1811
|
};
|
|
1772
1812
|
|
|
1813
|
+
/**
|
|
1814
|
+
* Build img user sync url
|
|
1815
|
+
* @param {int} syncsPerBidder number of syncs Per Bidder
|
|
1816
|
+
* @param {int} index index to pass
|
|
1817
|
+
* @returns {string} img user sync url
|
|
1818
|
+
*/
|
|
1819
|
+
function buildImgSyncUrl(syncsPerBidder, index) {
|
|
1820
|
+
let consentString = '';
|
|
1821
|
+
let gdprApplies = '0';
|
|
1822
|
+
if (gdprConsent && gdprConsent.hasOwnProperty('gdprApplies')) {
|
|
1823
|
+
gdprApplies = gdprConsent.gdprApplies ? '1' : '0';
|
|
1824
|
+
}
|
|
1825
|
+
if (gdprConsent && gdprConsent.hasOwnProperty('consentString')) {
|
|
1826
|
+
consentString = gdprConsent.consentString || '';
|
|
1827
|
+
}
|
|
1828
|
+
|
|
1829
|
+
return IMG_USER_SYNC_URL + '&site_id=' + siteID.toString() + '&p=' + syncsPerBidder.toString() + '&i=' + index.toString() + '&gdpr=' + gdprApplies + '&gdpr_consent=' + consentString + '&us_privacy=' + (usPrivacy || '');
|
|
1830
|
+
}
|
|
1831
|
+
|
|
1773
1832
|
registerBidder(spec);
|
|
@@ -1,14 +1,96 @@
|
|
|
1
|
+
import { logError } from '../src/utils.js';
|
|
2
|
+
import { ajax } from '../src/ajax.js';
|
|
1
3
|
import adapter from '../src/AnalyticsAdapter.js';
|
|
2
4
|
import adapterManager from '../src/adapterManager.js';
|
|
5
|
+
import CONSTANTS from '../src/constants.json';
|
|
3
6
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
const EVENT_URL = 'https://krk.kargo.com/api/v1/event';
|
|
8
|
+
const KARGO_BIDDER_CODE = 'kargo';
|
|
9
|
+
|
|
10
|
+
const analyticsType = 'endpoint';
|
|
11
|
+
|
|
12
|
+
let _initOptions = {};
|
|
13
|
+
|
|
14
|
+
let _logBidResponseData = {
|
|
15
|
+
auctionId: '',
|
|
16
|
+
auctionTimeout: 0,
|
|
17
|
+
responseTime: 0,
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
let _bidResponseDataLogged = [];
|
|
21
|
+
|
|
22
|
+
var kargoAnalyticsAdapter = Object.assign(
|
|
23
|
+
adapter({ analyticsType }), {
|
|
24
|
+
track({ eventType, args }) {
|
|
25
|
+
switch (eventType) {
|
|
26
|
+
case CONSTANTS.EVENTS.AUCTION_INIT: {
|
|
27
|
+
_logBidResponseData.auctionTimeout = args.timeout;
|
|
28
|
+
break;
|
|
29
|
+
}
|
|
30
|
+
case CONSTANTS.EVENTS.BID_RESPONSE: {
|
|
31
|
+
handleBidResponseData(args);
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
// handleBidResponseData: Get auction data for Kargo bids and send to server
|
|
40
|
+
function handleBidResponseData (bidResponse) {
|
|
41
|
+
// Verify this is Kargo and we haven't seen this auction data yet
|
|
42
|
+
if (bidResponse.bidder !== KARGO_BIDDER_CODE || _bidResponseDataLogged.includes(bidResponse.auctionId) !== false) {
|
|
43
|
+
return
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
_logBidResponseData.auctionId = bidResponse.auctionId;
|
|
47
|
+
_logBidResponseData.responseTime = bidResponse.timeToRespond;
|
|
48
|
+
sendAuctionData(_logBidResponseData);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// sendAuctionData: Send auction data to the server
|
|
52
|
+
function sendAuctionData (data) {
|
|
53
|
+
try {
|
|
54
|
+
_bidResponseDataLogged.push(data.auctionId);
|
|
55
|
+
|
|
56
|
+
if (!shouldFireEventRequest()) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
ajax(
|
|
61
|
+
`${EVENT_URL}/auction-data`,
|
|
62
|
+
null,
|
|
63
|
+
{
|
|
64
|
+
aid: data.auctionId,
|
|
65
|
+
ato: data.auctionTimeout,
|
|
66
|
+
rt: data.responseTime,
|
|
67
|
+
it: 0,
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
method: 'GET',
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
} catch (err) {
|
|
74
|
+
logError('Error sending auction data: ', err);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Sampling rate out of 100
|
|
79
|
+
function shouldFireEventRequest () {
|
|
80
|
+
const samplingRate = (_initOptions && _initOptions.sampling) || 100;
|
|
81
|
+
return ((Math.floor(Math.random() * 100) + 1) <= parseInt(samplingRate));
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
kargoAnalyticsAdapter.originEnableAnalytics = kargoAnalyticsAdapter.enableAnalytics;
|
|
85
|
+
|
|
86
|
+
kargoAnalyticsAdapter.enableAnalytics = function (config) {
|
|
87
|
+
_initOptions = config.options;
|
|
88
|
+
kargoAnalyticsAdapter.originEnableAnalytics(config);
|
|
89
|
+
};
|
|
8
90
|
|
|
9
91
|
adapterManager.registerAnalyticsAdapter({
|
|
10
|
-
adapter:
|
|
92
|
+
adapter: kargoAnalyticsAdapter,
|
|
11
93
|
code: 'kargo'
|
|
12
94
|
});
|
|
13
95
|
|
|
14
|
-
export default
|
|
96
|
+
export default kargoAnalyticsAdapter;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Overview
|
|
2
|
+
|
|
3
|
+
Module Name: Kargo Analytics Adapter
|
|
4
|
+
Module Type: Analytics Adapter
|
|
5
|
+
Maintainer: support@kargo.com
|
|
6
|
+
|
|
7
|
+
# Description
|
|
8
|
+
|
|
9
|
+
Analytics adapter for Kargo. Contact support@kargo.com for information.
|
|
10
|
+
|
|
11
|
+
# Usage
|
|
12
|
+
|
|
13
|
+
The simplest way to enable the analytics adapter is this
|
|
14
|
+
|
|
15
|
+
```javascript
|
|
16
|
+
pbjs.enableAnalytics([{
|
|
17
|
+
provider: 'kargo',
|
|
18
|
+
options: {
|
|
19
|
+
sampling: 100 // value out of 100
|
|
20
|
+
}
|
|
21
|
+
}]);
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
# Test Parameters
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
{
|
|
28
|
+
provider: 'kargo',
|
|
29
|
+
options: {
|
|
30
|
+
sampling: 100
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
```
|
package/modules/pubCommonId.js
CHANGED
|
@@ -9,8 +9,7 @@ import * as events from '../src/events.js';
|
|
|
9
9
|
import CONSTANTS from '../src/constants.json';
|
|
10
10
|
import { getStorageManager } from '../src/storageManager.js';
|
|
11
11
|
|
|
12
|
-
const
|
|
13
|
-
const storage = getStorageManager({moduleType: MODULE_TYPE});
|
|
12
|
+
const storage = getStorageManager();
|
|
14
13
|
|
|
15
14
|
const ID_NAME = '_pubcid';
|
|
16
15
|
const OPTOUT_NAME = '_pubcid_optout';
|
|
@@ -147,6 +147,36 @@ function buildBidResponse(seedtagBid) {
|
|
|
147
147
|
return bid;
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
+
/**
|
|
151
|
+
*
|
|
152
|
+
* @returns Measure time to first byte implementation
|
|
153
|
+
* @see https://web.dev/ttfb/
|
|
154
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/Navigation_timing_API
|
|
155
|
+
*/
|
|
156
|
+
function ttfb() {
|
|
157
|
+
const ttfb = (() => {
|
|
158
|
+
// Timing API V2
|
|
159
|
+
try {
|
|
160
|
+
const entry = performance.getEntriesByType('navigation')[0];
|
|
161
|
+
return Math.round(entry.responseStart - entry.startTime);
|
|
162
|
+
} catch (e) {
|
|
163
|
+
// Timing API V1
|
|
164
|
+
try {
|
|
165
|
+
const entry = performance.timing;
|
|
166
|
+
return Math.round(entry.responseStart - entry.fetchStart);
|
|
167
|
+
} catch (e) {
|
|
168
|
+
// Timing API not available
|
|
169
|
+
return 0;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
})();
|
|
173
|
+
|
|
174
|
+
// prevent negative or excessive value
|
|
175
|
+
// @see https://github.com/googleChrome/web-vitals/issues/162
|
|
176
|
+
// https://github.com/googleChrome/web-vitals/issues/137
|
|
177
|
+
return ttfb >= 0 && ttfb <= performance.now() ? ttfb : 0;
|
|
178
|
+
}
|
|
179
|
+
|
|
150
180
|
export function getTimeoutUrl (data) {
|
|
151
181
|
let queryParams = '';
|
|
152
182
|
if (
|
|
@@ -195,7 +225,9 @@ export const spec = {
|
|
|
195
225
|
timeout: bidderRequest.timeout,
|
|
196
226
|
version: '$prebid.version$',
|
|
197
227
|
connectionType: getConnectionType(),
|
|
198
|
-
|
|
228
|
+
auctionStart: bidderRequest.auctionStart || Date.now(),
|
|
229
|
+
ttfb: ttfb(),
|
|
230
|
+
bidRequests: _map(validBidRequests, buildBidRequest),
|
|
199
231
|
};
|
|
200
232
|
|
|
201
233
|
if (payload.cmp) {
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
* @requires module:modules/userId
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { parseUrl, buildUrl, triggerPixel, logInfo, hasDeviceAccess, generateUUID } from '../src/utils.js';
|
|
9
9
|
import {submodule} from '../src/hook.js';
|
|
10
|
-
import {coppaDataHandler} from '../src/adapterManager.js';
|
|
10
|
+
import { coppaDataHandler } from '../src/adapterManager.js';
|
|
11
11
|
import {getStorageManager} from '../src/storageManager.js';
|
|
12
12
|
|
|
13
|
-
const
|
|
14
|
-
export const storage = getStorageManager({moduleName: 'pubCommonId'
|
|
13
|
+
const GVLID = 887;
|
|
14
|
+
export const storage = getStorageManager({gvlid: GVLID, moduleName: 'pubCommonId'});
|
|
15
15
|
const COOKIE = 'cookie';
|
|
16
16
|
const LOCAL_STORAGE = 'html5';
|
|
17
17
|
const OPTOUT_NAME = '_pubcid_optout';
|
|
@@ -74,6 +74,11 @@ export const sharedIdSystemSubmodule = {
|
|
|
74
74
|
*/
|
|
75
75
|
name: 'sharedId',
|
|
76
76
|
aliasName: 'pubCommonId',
|
|
77
|
+
/**
|
|
78
|
+
* Vendor id of prebid
|
|
79
|
+
* @type {Number}
|
|
80
|
+
*/
|
|
81
|
+
gvlid: GVLID,
|
|
77
82
|
|
|
78
83
|
/**
|
|
79
84
|
* decode the stored id value for passing to bid requests
|
|
@@ -88,7 +93,8 @@ export const sharedIdSystemSubmodule = {
|
|
|
88
93
|
return undefined;
|
|
89
94
|
}
|
|
90
95
|
logInfo(' Decoded value PubCommonId ' + value);
|
|
91
|
-
|
|
96
|
+
const idObj = {'pubcid': value};
|
|
97
|
+
return idObj;
|
|
92
98
|
},
|
|
93
99
|
/**
|
|
94
100
|
* performs action to obtain id
|
|
@@ -4,7 +4,7 @@ import { config } from '../src/config.js';
|
|
|
4
4
|
import { BANNER, VIDEO } from '../src/mediaTypes.js';
|
|
5
5
|
import { createEidsArray } from './userId/eids.js';
|
|
6
6
|
|
|
7
|
-
const VERSION = '4.1.
|
|
7
|
+
const VERSION = '4.1.1';
|
|
8
8
|
const BIDDER_CODE = 'sharethrough';
|
|
9
9
|
const SUPPLY_ID = 'WYu2BXv1';
|
|
10
10
|
|
|
@@ -34,9 +34,8 @@ export const sharethroughAdapterSpec = {
|
|
|
34
34
|
cur: ['USD'],
|
|
35
35
|
tmax: timeout,
|
|
36
36
|
site: {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
page: deepAccess(bidderRequest, 'refererInfo.page') || window.location.href,
|
|
37
|
+
domain: deepAccess(bidderRequest, 'refererInfo.domain', window.location.hostname),
|
|
38
|
+
page: deepAccess(bidderRequest, 'refererInfo.page', window.location.href),
|
|
40
39
|
ref: deepAccess(bidderRequest, 'refererInfo.ref'),
|
|
41
40
|
...firstPartyData.site,
|
|
42
41
|
},
|
|
@@ -66,7 +65,7 @@ export const sharethroughAdapterSpec = {
|
|
|
66
65
|
|
|
67
66
|
req.user = nullish(firstPartyData.user, {});
|
|
68
67
|
if (!req.user.ext) req.user.ext = {};
|
|
69
|
-
req.user.ext.eids =
|
|
68
|
+
req.user.ext.eids = createEidsArray(deepAccess(bidRequests[0], 'userId')) || [];
|
|
70
69
|
|
|
71
70
|
if (bidderRequest.gdprConsent) {
|
|
72
71
|
const gdprApplies = bidderRequest.gdprConsent.gdprApplies === true;
|
|
@@ -181,21 +180,12 @@ export const sharethroughAdapterSpec = {
|
|
|
181
180
|
});
|
|
182
181
|
},
|
|
183
182
|
|
|
184
|
-
getUserSyncs: (syncOptions, serverResponses
|
|
185
|
-
const
|
|
186
|
-
const syncs = [];
|
|
187
|
-
const shouldCookieSync = syncOptions.pixelEnabled &&
|
|
188
|
-
serverResponses.length > 0 &&
|
|
189
|
-
serverResponses[0].body &&
|
|
190
|
-
serverResponses[0].body.cookieSyncUrls;
|
|
191
|
-
|
|
192
|
-
if (shouldCookieSync) {
|
|
193
|
-
serverResponses[0].body.cookieSyncUrls.forEach(url => {
|
|
194
|
-
syncs.push({ type: 'image', url: url + syncParams });
|
|
195
|
-
});
|
|
196
|
-
}
|
|
183
|
+
getUserSyncs: (syncOptions, serverResponses) => {
|
|
184
|
+
const shouldCookieSync = syncOptions.pixelEnabled && deepAccess(serverResponses, '0.body.cookieSyncUrls') !== undefined;
|
|
197
185
|
|
|
198
|
-
return
|
|
186
|
+
return shouldCookieSync
|
|
187
|
+
? serverResponses[0].body.cookieSyncUrls.map(url => ({ type: 'image', url: url }))
|
|
188
|
+
: [];
|
|
199
189
|
},
|
|
200
190
|
|
|
201
191
|
// Empty implementation for prebid core to be able to find it
|
|
@@ -244,11 +234,6 @@ function getBidRequestFloor(bid) {
|
|
|
244
234
|
return floor !== null ? floor : bid.params.floor;
|
|
245
235
|
}
|
|
246
236
|
|
|
247
|
-
function userIdAsEids(bidRequest) {
|
|
248
|
-
const eids = createEidsArray(deepAccess(bidRequest, 'userId')) || [];
|
|
249
|
-
return eids;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
237
|
function getProtocol() {
|
|
253
238
|
return window.location.protocol;
|
|
254
239
|
}
|
|
@@ -40,10 +40,10 @@ The Taboola Bidding adapter requires setup before beginning. Please contact us o
|
|
|
40
40
|
|
|
41
41
|
| Name | Scope | Description | Example | Type |
|
|
42
42
|
|----------------|----------|---------------------------------------------------------|----------------------------|--------------|
|
|
43
|
-
| `tagId` | required | Tag ID / Placement Name <br>
|
|
44
|
-
| `publisherId` | required |
|
|
43
|
+
| `tagId` | required | Tag ID / Placement Name <br> | `'Below The Article'` | `String` |
|
|
44
|
+
| `publisherId` | required | Numeric Publisher ID <br>(as provided by Taboola) | `'1234567'` | `String` |
|
|
45
45
|
| `bcat` | optional | List of blocked advertiser categories (IAB) | `['IAB1-1']` | `Array` |
|
|
46
46
|
| `badv` | optional | Blocked Advertiser Domains | `'example.com'` | `String Url` |
|
|
47
|
-
| `bidfloor` | optional | CPM bid floor | `0.25` | `
|
|
47
|
+
| `bidfloor` | optional | CPM bid floor | `0.25` | `Float` |
|
|
48
48
|
|
|
49
49
|
|
package/package.json
CHANGED
package/src/storageManager.js
CHANGED
|
@@ -48,7 +48,7 @@ export function newStorageManager({gvlid, moduleName, bidderCode, moduleType} =
|
|
|
48
48
|
let hookDetails = {
|
|
49
49
|
hasEnforcementHook: false
|
|
50
50
|
}
|
|
51
|
-
validateStorageEnforcement(gvlid, bidderCode || moduleName,
|
|
51
|
+
validateStorageEnforcement(gvlid, bidderCode || moduleName, hookDetails, function(result) {
|
|
52
52
|
if (result && result.hasEnforcementHook) {
|
|
53
53
|
value = cb(result);
|
|
54
54
|
} else {
|
|
@@ -303,7 +303,7 @@ export function newStorageManager({gvlid, moduleName, bidderCode, moduleType} =
|
|
|
303
303
|
/**
|
|
304
304
|
* This hook validates the storage enforcement if gdprEnforcement module is included
|
|
305
305
|
*/
|
|
306
|
-
export const validateStorageEnforcement = hook('async', function(gvlid, moduleName,
|
|
306
|
+
export const validateStorageEnforcement = hook('async', function(gvlid, moduleName, hookDetails, callback) {
|
|
307
307
|
callback(hookDetails);
|
|
308
308
|
}, 'validateStorageEnforcement');
|
|
309
309
|
|
|
@@ -322,13 +322,12 @@ export function getCoreStorageManager(moduleName) {
|
|
|
322
322
|
* @param {Number=} gvlid? Vendor id - required for proper GDPR integration
|
|
323
323
|
* @param {string=} bidderCode? - required for bid adapters
|
|
324
324
|
* @param {string=} moduleName? module name
|
|
325
|
-
* @param {string=} moduleType? module type
|
|
326
325
|
*/
|
|
327
|
-
export function getStorageManager({gvlid, moduleName, bidderCode
|
|
326
|
+
export function getStorageManager({gvlid, moduleName, bidderCode} = {}) {
|
|
328
327
|
if (arguments.length > 1 || (arguments.length > 0 && !isPlainObject(arguments[0]))) {
|
|
329
328
|
throw new Error('Invalid invocation for getStorageManager')
|
|
330
329
|
}
|
|
331
|
-
return newStorageManager({gvlid, moduleName, bidderCode
|
|
330
|
+
return newStorageManager({gvlid, moduleName, bidderCode});
|
|
332
331
|
}
|
|
333
332
|
|
|
334
333
|
export function resetData() {
|