Skip to content

Commit c42b4ab

Browse files
Merge branch 'UOE-8815' into ns/uoe-8128-7-25
2 parents 5504571 + ef7e064 commit c42b4ab

17 files changed

+813
-187
lines changed

gulpfile.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,8 @@ gulp.task('bundle-pwt-keys', function() {
300300
"UUID": "hb_uuid",
301301
"CACHE_ID": "hb_cache_id",
302302
"CACHE_HOST": "hb_cache_host",
303-
"ADOMAIN" : "hb_adomain"
303+
"ADOMAIN" : "hb_adomain",
304+
"ACAT": "hb_acat",
304305
}
305306
}
306307
]

init-build.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ then
5252
exit 1
5353
fi
5454

55-
OpenWrapNodeModules="${GLOBAL_OPENWRAP_PKG_JSON_DIR_V7_25_0}/node_modules/"
55+
OpenWrapNodeModules="${GLOBAL_OPENWRAP_PKG_JSON_DIR_V7_39_0}/node_modules/"
5656

5757

5858
function prebidNpmInstall() {
5959
echo "This is SymLinking Start"
6060
cd $1
6161

62-
PrebidJSNodeModules="${GLOBAL_PREBID_PKG_JSON_DIR_V7_25_0}/node_modules/"
62+
PrebidJSNodeModules="${GLOBAL_PREBID_PKG_JSON_DIR_V7_39_0}/node_modules/"
6363

6464
symLinkForPrebidNodeModules=node_modules
6565
if [ -L $symLinkForPrebidNodeModules ]; then

src_new/adapters/prebid.js

+74-5
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ exports.kgpvMap = kgpvMap;
2626

2727
var refThis = this;
2828
var onEventAdded = false;
29+
var onAuctionEndEventAdded = false;
2930
var isPrebidPubMaticAnalyticsEnabled = CONFIG.isPrebidPubMaticAnalyticsEnabled();
3031
var isSingleImpressionSettingEnabled = CONFIG.isSingleImpressionSettingEnabled();
3132
var defaultAliases = CONSTANTS.DEFAULT_ALIASES;
@@ -314,13 +315,36 @@ function pbBidRequestHandler(pbBid){
314315
});
315316
}
316317
// endRemoveIf(removeLegacyAnalyticsRelatedCode)
317-
318+
318319
// removeIf(removeLegacyAnalyticsRelatedCode)
319320
/* start-test-block */
320321
exports.pbBidRequestHandler = pbBidRequestHandler;
321322
/* end-test-block */
322323
// endRemoveIf(removeLegacyAnalyticsRelatedCode)
323324

325+
// removeIf(removeLegacyAnalyticsRelatedCode)
326+
function pbAuctionEndHandler(args){
327+
window.PWT.newAdUnits = window.PWT.newAdUnits || {};
328+
args.adUnits.forEach(function(adUnit){
329+
if(!!adUnit.pubmaticAutoRefresh){
330+
if(!window.PWT.newAdUnits[window.PWT.bidMap[adUnit.code].impressionID]){
331+
window.PWT.newAdUnits[window.PWT.bidMap[adUnit.code].impressionID] = {};
332+
}
333+
if(!window.PWT.newAdUnits[window.PWT.bidMap[adUnit.code].impressionID][adUnit.code]){
334+
window.PWT.newAdUnits[window.PWT.bidMap[adUnit.code].impressionID][adUnit.code] = {}
335+
}
336+
window.PWT.newAdUnits[window.PWT.bidMap[adUnit.code].impressionID][adUnit.code].pubmaticAutoRefresh = adUnit.pubmaticAutoRefresh;
337+
}
338+
});
339+
}
340+
// endRemoveIf(removeLegacyAnalyticsRelatedCode)
341+
342+
// removeIf(removeLegacyAnalyticsRelatedCode)
343+
/* start-test-block */
344+
exports.pbAuctionEndHandler = pbAuctionEndHandler;
345+
/* end-test-block */
346+
// endRemoveIf(removeLegacyAnalyticsRelatedCode)
347+
324348
// removeIf(removeLegacyAnalyticsRelatedCode)
325349
function getPBCodeWithWidthAndHeight(divID, adapterID, width, height){
326350
return divID + "@" + adapterID + "@" + width + "X" + height;
@@ -803,7 +827,8 @@ function assignGdprConfigIfRequired(prebidConfig){
803827
prebidConfig["consentManagement"]['gdpr'] = {
804828
cmpApi: CONFIG.getCmpApi(),
805829
timeout: CONFIG.getGdprTimeout(),
806-
allowAuctionWithoutConsent: CONFIG.getAwc() // Auction without consent
830+
allowAuctionWithoutConsent: CONFIG.getAwc(), // Auction without consent
831+
defaultGdprScope: true
807832
};
808833
}
809834
}
@@ -866,7 +891,8 @@ function enablePrebidPubMaticAnalyticIfRequired(){
866891
options: {
867892
publisherId: CONFIG.getPublisherId(),
868893
profileId: CONFIG.getProfileID(),
869-
profileVersionId: CONFIG.getProfileDisplayVersionID()
894+
profileVersionId: CONFIG.getProfileDisplayVersionID(),
895+
identityOnly: (CONFIG.isUserIdModuleEnabled() ? 1 : 0)
870896
}
871897
});
872898
}
@@ -948,6 +974,21 @@ function addOnBidResponseHandler(){
948974
exports.addOnBidResponseHandler = addOnBidResponseHandler;
949975
// endRemoveIf(removeLegacyAnalyticsRelatedCode)
950976

977+
// removeIf(removeLegacyAnalyticsRelatedCode)
978+
function addOnAuctionEndHandler(){
979+
if(util.isFunction(window[pbNameSpace].onEvent)){
980+
if(!onAuctionEndEventAdded){
981+
window[pbNameSpace].onEvent('auctionEnd', refThis.pbAuctionEndHandler);
982+
onAuctionEndEventAdded = true;
983+
}
984+
} else {
985+
util.logWarning("PreBid js onEvent method is not available");
986+
return;
987+
}
988+
}
989+
exports.addOnAuctionEndHandler = addOnAuctionEndHandler;
990+
// endRemoveIf(removeLegacyAnalyticsRelatedCode)
991+
951992
// removeIf(removeLegacyAnalyticsRelatedCode)
952993
function addOnBidRequestHandler(){
953994
if(util.isFunction(window[pbNameSpace].onEvent)){
@@ -996,6 +1037,7 @@ function setPrebidConfig(){
9961037
refThis.assignCurrencyConfigIfRequired(prebidConfig);
9971038
refThis.assignSchainConfigIfRequired(prebidConfig);
9981039
refThis.assignSingleRequestConfigForBidders(prebidConfig);
1040+
refThis.assignPackagingInventoryConfig(prebidConfig);
9991041
// if usePBSAdapter is 1 then add s2sConfig
10001042
if(CONFIG.usePBSAdapter()) {
10011043
refThis.gets2sConfig(prebidConfig);
@@ -1057,12 +1099,25 @@ function gets2sConfig(prebidConfig){
10571099
macros: CONFIG.createMacros()
10581100
}
10591101
}
1102+
// adding support for marketplace
1103+
if(!!CONFIG.getMarketplaceBidders()){
1104+
prebidConfig["s2sConfig"]["allowUnknownBidderCodes"] = true;
1105+
prebidConfig["s2sConfig"]["extPrebid"]["alternatebiddercodes"] = {
1106+
enabled: true,
1107+
bidders: {
1108+
pubmatic: {
1109+
enabled: true,
1110+
allowedbiddercodes: CONFIG.getMarketplaceBidders()
1111+
}
1112+
}
1113+
}
1114+
}
10601115
}
10611116

10621117
exports.gets2sConfig = gets2sConfig;
10631118

10641119
function getFloorsConfiguration(prebidConfig){
1065-
if(CONFIG.isFloorPriceModuleEnabled() == true){
1120+
if(CONFIG.isFloorPriceModuleEnabled() == true && CONFIG.getFloorSource() !== CONSTANTS.COMMON.EXTERNAL_FLOOR_WO_CONFIG){
10661121
prebidConfig["floors"]={
10671122
enforcement: {
10681123
enforceJS: CONFIG.getFloorType()
@@ -1101,6 +1156,15 @@ function checkForYahooSSPBidder(prebidConfig){
11011156

11021157
exports.checkForYahooSSPBidder = checkForYahooSSPBidder;
11031158

1159+
1160+
function assignPackagingInventoryConfig(prebidConfig) {
1161+
prebidConfig["viewabilityScoreGeneration"] = {
1162+
enabled: true
1163+
}
1164+
}
1165+
1166+
exports.assignPackagingInventoryConfig = assignPackagingInventoryConfig;
1167+
11041168
function getPbjsAdServerTargetingConfig(){
11051169
// Todo: Handle send-all bids feature enabled case
11061170
// we will need to add bidder specific keys?? do we?
@@ -1234,7 +1298,11 @@ function setPbjsBidderSettingsIfRequired(){
12341298
CONFIG.forEachAdapter(function(adapterID){
12351299
if(window[pbNameSpace].bidderSettings.hasOwnProperty(adapterID) === false){
12361300
window[pbNameSpace].bidderSettings[adapterID] = {};
1237-
1301+
// adding marketplace params
1302+
if(adapterID === "pubmatic" && !!CONFIG.getMarketplaceBidders()){
1303+
window[pbNameSpace].bidderSettings[adapterID]['allowAlternateBidderCodes'] = true;
1304+
window[pbNameSpace].bidderSettings[adapterID]['allowedAlternateBidderCodes'] = CONFIG.getMarketplaceBidders();
1305+
}
12381306
// adding bidCpmAdjustment
12391307
window[pbNameSpace].bidderSettings[adapterID]['bidCpmAdjustment'] = function(bidCpm, bid){
12401308
return window.parseFloat((bidCpm * CONFIG.getAdapterRevShare(adapterID)).toFixed(CONSTANTS.COMMON.BID_PRECISION));
@@ -1333,6 +1401,7 @@ function fetchBids(activeSlots){
13331401
// we do not want this call when we have PrebidAnalytics enabled
13341402
refThis.addOnBidResponseHandler();
13351403
refThis.addOnBidRequestHandler();
1404+
refThis.addOnAuctionEndHandler();
13361405
}
13371406
// endRemoveIf(removeLegacyAnalyticsRelatedCode)
13381407

src_new/bidManager.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,7 @@ exports.executeAnalyticsPixel = function(){ // TDD, i/o : done
407407
outputObj[CONSTANTS.LOGGER_PIXEL_PARAMS.TIMESTAMP] = util.getCurrentTimestamp();
408408
outputObj[CONSTANTS.CONFIG.PROFILE_ID] = CONFIG.getProfileID();
409409
outputObj[CONSTANTS.CONFIG.PROFILE_VERSION_ID] = CONFIG.getProfileDisplayVersionID();
410+
outputObj['ih'] = CONFIG.isUserIdModuleEnabled() ? 1 : 0;
410411
outputObj["bm"] = refThis.getBrowser();
411412
outputObj["tgid"] = (function() {
412413
var testGroupId = parseInt(PWT.testGroupId || 0);
@@ -596,7 +597,8 @@ function analyticalPixelCallback(slotID, bmEntry, impressionIDMap) { // TDD, i/o
596597
"bs": refThis.getSlotLevelFrequencyDepth(frequencyDepth, 'bidServed', adUnitInfo.adUnitId),
597598
"is": refThis.getSlotLevelFrequencyDepth(frequencyDepth, 'impressionServed', adUnitInfo.adUnitId),
598599
"rc": refThis.getSlotLevelFrequencyDepth(frequencyDepth, 'slotCnt', adUnitInfo.adUnitId),
599-
"vw": frequencyDepth && frequencyDepth.viewedSlot && frequencyDepth.viewedSlot[adUnitInfo.adUnitId]
600+
"vw": frequencyDepth && frequencyDepth.viewedSlot && frequencyDepth.viewedSlot[adUnitInfo.adUnitId],
601+
"rf": window.PWT.newAdUnits ? (window.PWT.newAdUnits[impressionID] ? (window.PWT.newAdUnits[impressionID][slotID] ? (window.PWT.newAdUnits[impressionID][slotID]['pubmaticAutoRefresh'] ? (window.PWT.newAdUnits[impressionID][slotID]['pubmaticAutoRefresh']['isRefreshed'] ? 1: 0 ) : 0): 0 ) : 0 ): 0,
600602
};
601603
bmEntry.setExpired();
602604
impressionIDMap[impressionID] = impressionIDMap[impressionID] || [];
@@ -879,7 +881,7 @@ exports.getBrowser = function() {
879881
var browserMapping = CONSTANTS.BROWSER_MAPPING;
880882

881883
var userAgent = navigator.userAgent;
882-
var browserName = userAgent == null ? "UNKNOWN" : "unknown";
884+
var browserName = userAgent == null ? -1 : 0;
883885
if(userAgent) {
884886
for(var i = 0; i < regExBrowsers.length; i++) {
885887
if(userAgent.match(regExBrowsers[i])) {

src_new/config.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,10 @@ exports.isFloorPriceModuleEnabled = function(){
254254
return window.parseInt(config[CONSTANTS.CONFIG.COMMON][CONSTANTS.CONFIG.FLOOR_PRICE_MODULE_ENABLED]) === 1;
255255
}
256256

257+
exports.getFloorSource = function(){
258+
return config[CONSTANTS.CONFIG.COMMON][CONSTANTS.CONFIG.FLOOR_SOURCE];
259+
}
260+
257261
exports.getFloorJsonUrl = function(){
258262
return config[CONSTANTS.CONFIG.COMMON][CONSTANTS.CONFIG.FLOOR_JSON_URL];
259263
}
@@ -266,7 +270,7 @@ exports.getFloorAuctionDelay = function(){
266270

267271
// It will return the floorType specified in conf.js or else default is true
268272
exports.getFloorType = function(){
269-
return config[CONSTANTS.CONFIG.COMMON][CONSTANTS.CONFIG.FLOOR_ENFORCE_JS] != undefined ? window.parseInt(config[CONSTANTS.CONFIG.COMMON][CONSTANTS.CONFIG.FLOOR_ENFORCE_JS]) === 1 : CONSTANTS.CONFIG.DEFAULT_FLOOR_ENFORCE_JS;
273+
return config[CONSTANTS.CONFIG.COMMON][CONSTANTS.CONFIG.FLOOR_ENFORCE_JS] && (config[CONSTANTS.CONFIG.COMMON][CONSTANTS.CONFIG.FLOOR_ENFORCE_JS]).toLowerCase() === CONSTANTS.COMMON.HARD_FLOOR ? true : false;
270274
}
271275

272276
exports.isPrebidPubMaticAnalyticsEnabled = function () {
@@ -448,4 +452,8 @@ exports.createMacros = function() {
448452
"[PROFILE_ID]": refThis.getProfileID().toString(),
449453
"[PROFILE_VERSION]": refThis.getProfileDisplayVersionID().toString()
450454
}
455+
}
456+
457+
exports.getMarketplaceBidders = function(){
458+
return config.pwt.marketplaceBidders ? config.pwt.marketplaceBidders.split(',') : false;
451459
}

src_new/constants.js

+10-6
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ exports.COMMON = {
3636
"PROTOCOL": "https://",
3737
"SLOT_CONFIG": "slotConfig",
3838
"DEFAULT": "default",
39+
"MCONF_REGEX": "regex",
3940
"ADSERVER":"adserver",
4041
"OWVERSION":"owv",
4142
"PBVERSION":"pbv",
@@ -50,7 +51,9 @@ exports.COMMON = {
5051
"REDUCE_CODE_SIZE": "reduceCodeSize",
5152
"TEST_IDENTITY_PARTNER": "test_identityPartners",
5253
"IH_ANALYTICS_ADAPTER_EXPIRY": "ihAnalyticsAdapterExpiry",
53-
"IH_ANALYTICS_ADAPTER_DEFAULT_EXPIRY": 7
54+
"IH_ANALYTICS_ADAPTER_DEFAULT_EXPIRY": 7,
55+
"EXTERNAL_FLOOR_WO_CONFIG": "External Floor w/o Config",
56+
"HARD_FLOOR": "hard"
5457
};
5558

5659
exports.CONFIG = {
@@ -109,7 +112,8 @@ exports.CONFIG = {
109112
"TIMEOUT_ADJUSTMENT": 50,
110113
"SSO_ENABLED": "ssoEnabled",
111114
"PB_GLOBAL_VAR_NAMESPACE": "pbGlobalVarNamespace",
112-
"OW_GLOBAL_VAR_NAMESPACE": "owGlobalVarNamespace"
115+
"OW_GLOBAL_VAR_NAMESPACE": "owGlobalVarNamespace",
116+
"FLOOR_SOURCE": "floorSource"
113117
};
114118

115119
exports.METADATA_MACROS = {
@@ -208,6 +212,7 @@ exports.MESSAGES = {
208212
"M29": "Unable to parse Partner configuration",
209213
"M30": "AB Test Enabled With Config",
210214
"M31": "AB Test Enabled With Partner Config",
215+
"M32": "Invalid MediaConfig regex pattern : ",
211216
IDENTITY: {
212217
M1: "Unable to get User Id from OpenIdentity",
213218
M2: "Setting UserIds to EB ",
@@ -275,6 +280,9 @@ exports.SPECIAL_CASE_ID_PARTNERS = {
275280
},
276281
"merkleId": {
277282
"params.ssp_ids": "array"
283+
},
284+
"liveIntentId": {
285+
"params.requestedAttributesOverrides": "customObject"
278286
}
279287
}; //list of ID partners for whom special handling of datatype is required
280288

@@ -287,10 +295,6 @@ exports.ID_PARTNERS_CUSTOM_VALUES = {
287295
"identityLink": [{
288296
"key": "storage.refreshInSeconds",
289297
"value": "1800"
290-
}],
291-
"liveIntentId": [{
292-
"key": "params.requestedAttributesOverrides",
293-
"value": {'uid2': true}
294298
}]
295299
};
296300

0 commit comments

Comments
 (0)