Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
189 commits
Select commit Hold shift + click to select a range
5621e3a
Initial Implementation
pm-nitin-shirsat Oct 10, 2024
dce9e5d
GPP phase 02- small code changes
pm-nitin-shirsat Oct 11, 2024
3164c74
gpp phase 02: Setting respective config
pm-nitin-shirsat Oct 11, 2024
87cdd17
gpp phase 02: Get away from multiple functions and move it to one
pm-nitin-shirsat Oct 12, 2024
901b642
gpp phase 02: Improvise flow added some params for analysis purpose.
pm-nitin-shirsat Oct 21, 2024
f2c2438
GPP phase 02: Pause the PWT execution and opnce identified or timeout…
pm-nitin-shirsat Oct 23, 2024
65740f3
GPP phase 02: Add support to IH
pm-nitin-shirsat Nov 18, 2024
51a4bf4
resolving conflicts
pm-nitin-shirsat Nov 18, 2024
cd41214
Merge pull request #564 from PubMatic/nightly
pm-nitin-shirsat Nov 18, 2024
ea7722f
gpp phase 02: If consent management is not enabled then do not proceed
pm-nitin-shirsat Nov 18, 2024
24ab41b
GPP Phase 02: Use NameSpace with global object
pm-nitin-shirsat Nov 19, 2024
9d6a22d
Add comments
pm-nitin-shirsat Nov 19, 2024
b9cfaeb
Add stats for the better logging
pm-nitin-shirsat Nov 21, 2024
b5f5815
Updated code for GPP phase 02
pm-nitin-shirsat Dec 6, 2024
b85a5bc
Merge pull request #567 from PubMatic/nightly
pm-nitin-shirsat Dec 6, 2024
2932e97
Gpp Phase 02: Added time metrics module
pm-nitin-shirsat Dec 12, 2024
40249fe
Import only that is required
pm-nitin-shirsat Dec 12, 2024
c58b469
Merge pull request #569 from PubMatic/UOE-11010
pm-priyanka-deshmane Dec 17, 2024
097a004
Update timeMetrics.js
pm-nitin-shirsat Dec 19, 2024
edf0b80
Merge pull request #577 from PubMatic/UOE-11674
pm-nitin-shirsat Jan 13, 2025
edca8e0
Checking for schain object before setting schain in prebid
Jan 22, 2025
b70454a
Merge branch 'standard_consent_management' into nightly_sync
Feb 3, 2025
fcfbb96
Merge pull request #580 from PubMatic/nightly_sync
pm-nitin-shirsat Feb 3, 2025
095b399
Sync with phase 02 changes
Feb 3, 2025
4fd0077
my commit message
pm-pramod-pisal Feb 5, 2025
2599c6c
Phase 02 changes
pm-nitin-shirsat Feb 5, 2025
08f7892
Improvements
pm-nitin-shirsat Feb 6, 2025
796a5a3
Remove usage of util and move to common-util.js
pm-nitin-shirsat Feb 6, 2025
2851be9
Handled empty object case and added test cases
Feb 7, 2025
d8c21da
If consent is not enabled even local config should be available
pm-nitin-shirsat Feb 10, 2025
c70a287
Added case for logger mechanism
pm-nitin-shirsat Feb 10, 2025
4558a29
Reading and passing pos from configs
pm-priyanka-deshmane Feb 10, 2025
c5fd7a6
Rename some fields
pm-nitin-shirsat Feb 11, 2025
26aab61
Update function & variable names. handle some cases
pm-nitin-shirsat Feb 11, 2025
23a8d6b
Change location, as reading data from LS before initialising bidder s…
pm-nitin-shirsat Feb 11, 2025
c1458e6
handled callback instead of setinterval for custom
Feb 12, 2025
a0238a9
Added logic for the logging fields in analytics
pm-nitin-shirsat Feb 12, 2025
c10deed
Set consent management config resolver
pm-nitin-shirsat Feb 12, 2025
2eaf607
Merge pull request #581 from PubMatic/custom-callback
pm-priyanka-deshmane Feb 13, 2025
139d71d
Make cmp fields private which is not accessible outside of code
pm-nitin-shirsat Feb 13, 2025
83a16f4
Shift logged by data to analytics adapter
pm-nitin-shirsat Feb 14, 2025
b6d28c4
reformat
pm-nitin-shirsat Feb 14, 2025
ca2f233
Fix bugs while development testing
pm-nitin-shirsat Feb 14, 2025
da9fcb8
Add test cases for Cosnent Config resolver
pm-nitin-shirsat Feb 16, 2025
a86afb4
Fix test cases
pm-nitin-shirsat Feb 16, 2025
6f1d2b0
Merge pull request #583 from PubMatic/custom-callback
pm-kapil-tuptewar Feb 17, 2025
9cfee89
Code review changes
pm-nitin-shirsat Feb 19, 2025
a2cd955
Added console logs review comments
pm-nitin-shirsat Feb 20, 2025
4845030
Merge branch 'UOE-11946-9_27' into standard-consent-management
pm-nitin-shirsat Feb 20, 2025
341c083
Missed callback param
pm-nitin-shirsat Feb 20, 2025
832228a
Added comma
pm-nitin-shirsat Feb 20, 2025
c70eaf9
Resolve test cases
pm-nitin-shirsat Feb 20, 2025
b73ee1c
Fix issue when bidMap is not set but the GAM call is happening before…
pm-nitin-shirsat Feb 24, 2025
a234436
Handle DFP Interval case.
pm-nitin-shirsat Feb 25, 2025
6444054
Remove es6 code syntax
pm-nitin-shirsat Feb 25, 2025
a93ce39
resolve test cases issue
pm-nitin-shirsat Feb 25, 2025
24e54f4
Fixed log message
pm-nitin-shirsat Feb 25, 2025
77d9352
26th feb release
pm-priyanka-deshmane Feb 25, 2025
a929533
Something fails at runtime, this will pause execution of PWT
pm-nitin-shirsat Feb 26, 2025
e6fea70
Add reason of removing for try-catch block
pm-nitin-shirsat Feb 26, 2025
ecf5aa2
Change name of checkTImeout to LookUpTimeout
pm-nitin-shirsat Feb 26, 2025
2101c8c
Make CMP look up timeout to 1000 ms
pm-nitin-shirsat Feb 27, 2025
c25b404
Handle OW + IH cases for initializing IH modules after config confirm…
pm-nitin-shirsat Mar 4, 2025
120916b
bidder sequence test cases fix.
pm-nitin-shirsat Mar 4, 2025
2fa792b
Locally working but checking on docker
pm-nitin-shirsat Mar 4, 2025
73e9434
Fixed test cases of bidder sequence
pm-nitin-shirsat Mar 4, 2025
505c497
Cmp timeout was not setting correctly
pm-nitin-shirsat Mar 6, 2025
2434686
Instead sending string to logger & tracker we are sending it as integ…
pm-nitin-shirsat Mar 7, 2025
b513db5
Update comment for clarity
pm-nitin-shirsat Mar 7, 2025
fcbc11d
Added PubMatic ID module params to constants
pm-nitin-shirsat Apr 1, 2025
19c915c
Merge pull request #588 from PubMatic/nightly
pm-nitin-shirsat Apr 2, 2025
95e061a
Initial commit
pm-abhinav-deshpande Apr 11, 2025
336023b
Merge pull request #589 from PubMatic/UOE-12138
pm-nitin-shirsat Apr 14, 2025
6502825
Merge pull request #587 from PubMatic/UOE-12138
pm-nitin-shirsat Apr 14, 2025
4c93135
Added functionality of lazy loading in CUSTOM adserver
Apr 18, 2025
e9d8f7e
Updated to es5
Apr 22, 2025
51aa228
Handled case for mobile scaling
Apr 24, 2025
9c320a5
Added support for updated browser mapping and country level floors
pm-asit-sahoo Apr 21, 2025
7a1974b
Converting the mobile scaling to float before passing
Apr 29, 2025
c9a59d2
Checked for scroll up using absolute value
Apr 30, 2025
a1c6947
Refactored the code
Apr 30, 2025
f709540
Updated codacy changes
Apr 30, 2025
bd89d05
Merge pull request #591 from PubMatic/UOE-12295
pm-kapil-tuptewar May 13, 2025
ffb3dfd
Merge pull request #594 from PubMatic/nightly
pm-nitin-shirsat May 26, 2025
f3b3d34
Merge branch 'UOE-9148' of https://github.com/PubMatic/OpenWrap into …
pm-nitin-shirsat May 28, 2025
4c88855
Merge remote-tracking branch 'origin/UOE-9148' into consent_gzip_tid
pm-nitin-shirsat May 28, 2025
00fdc8f
Merge remote-tracking branch 'origin/UOE-12318' into consent_gzip_tid
pm-nitin-shirsat May 28, 2025
f439ab3
my commit message
pm-pramod-pisal Jun 2, 2025
ad50f30
Consent Management : Publisher running A/B test with liveIntent fails…
pm-nitin-shirsat Jun 6, 2025
50ac84e
Merge pull request #600 from PubMatic/standard-consent-management
pm-nitin-shirsat Jun 6, 2025
32688a8
Merge branch 'consent_gzip_tid_custom_lazy_load' into openwrap_9_41_0…
Jun 6, 2025
9727353
Fix test cases issues
pm-nitin-shirsat Jun 6, 2025
bcf8844
Merge branch 'consent_gzip_tid_custom_lazy_load' into openwrap_9_41_0…
Jun 6, 2025
98130de
Merge pull request #601 from PubMatic/consent_gzip_tid_custom_lazy_load
pm-nitin-shirsat Jun 11, 2025
e77efd9
Phase 03 - initial commit
pm-nitin-shirsat Jun 17, 2025
a75a894
For OW implemented the CMP load time issue functionality
pm-nitin-shirsat Jun 18, 2025
6c648d4
SetCMPTime move to up
pm-nitin-shirsat Jun 20, 2025
5d63b1d
Implement continuous check in consent config resolver for OW
pm-nitin-shirsat Jun 23, 2025
0abeb0c
Handle IH case refresh IDs
pm-nitin-shirsat Jun 24, 2025
c6b0c39
Improve consent Config resolver and IH case handle
pm-nitin-shirsat Jun 25, 2025
92d45f4
Merge pull request #602 from PubMatic/openwrap_9_41_0_20250528152329
pm-kapil-tuptewar Jun 30, 2025
f6709f5
bug fix : do not clear identity partners when test had no identity pa…
pm-shivam-soni Jul 2, 2025
256e87c
Update config.js
pm-shivam-soni Jul 2, 2025
baddc01
Update config.js
pm-shivam-soni Jul 2, 2025
574988e
update identitypartner config only when testGroupDetails.testType = "…
pm-shivam-soni Jul 2, 2025
2845f66
Update config.spec.js
pm-shivam-soni Jul 2, 2025
63a0aaa
Improvement and working for continuous cmp check
pm-nitin-shirsat Jul 4, 2025
1966f22
Adding changes for lazy load in display ads
Jun 4, 2025
0f908f7
Fixing review comments
Jun 9, 2025
8f8e4e6
Commiting changes for lazy load refresh
Jun 18, 2025
124835b
commiting test cases for lazy load displayfunction
Jun 18, 2025
18cb905
changes in refresh functionality
Jun 18, 2025
01eb816
changes in refresh functionality
Jun 18, 2025
10df6fb
changes in refresh functionality
Jun 18, 2025
6d74542
changes in refresh functionality
Jun 18, 2025
a9b32c5
changes in code for refresh
Jun 18, 2025
47f05cb
changing refresh according to code review
Jun 18, 2025
4be88ba
changing refresh according to code review-1
Jun 18, 2025
781bc99
changing refresh according to code review-2
Jun 18, 2025
c18001b
changing refresh according to code review-3
Jun 18, 2025
5e86778
changing refresh according to code review-4
Jun 18, 2025
87361ff
changing refresh according to code review-4
Jun 18, 2025
df435de
fixing existing functionality
Jun 19, 2025
68d6fca
removing unnecessary code
Jun 19, 2025
8909104
removing test cases
Jun 20, 2025
654e195
Fixing breaking test cases
Jun 20, 2025
cefaafa
Added refresh functionality to lazy load in DFP adServer
Jun 24, 2025
86be9b9
Adding code for refresh
Jun 26, 2025
2c2f166
Fixing edge case for refresh functionality
Jun 26, 2025
ec31fcb
Fixing issue for display and refresh functionality
Jun 26, 2025
e6cd1c2
test case added
pm-shivam-soni Jul 7, 2025
8b3507b
UOE-12343: fixing corner cases for lazy load refresh
Jul 8, 2025
5be93a1
Adding changes to handle the scroll event for all slots
Jul 9, 2025
01e377f
removing log statement
Jul 9, 2025
6a67be9
my commit message
pm-pramod-pisal Jul 14, 2025
857d5d0
Add test cases for Consent Config resolver
pm-nitin-shirsat Jul 14, 2025
67880b8
Test cases for continuous cmp check
pm-nitin-shirsat Jul 14, 2025
1cb64ef
Merge pull request #604 from PubMatic/nightly
pm-nitin-shirsat Jul 14, 2025
48336a1
remove unnecessary code
pm-nitin-shirsat Jul 14, 2025
8dac04b
Remove cases
pm-nitin-shirsat Jul 14, 2025
b9a7f2b
Add logs for the consent config resolver
pm-nitin-shirsat Jul 16, 2025
14d3c5d
intermediate commit when the code is working
Jul 16, 2025
225d6a6
working refresh and display
Jul 18, 2025
fe68c1b
fixing test cases for lazy load gpt
Jul 18, 2025
948e344
Fixing multiple translator calls when not lazy loaded
Jul 18, 2025
85b5f44
my commit message
pm-pramod-pisal Jul 21, 2025
ab38c4b
my commit message
pm-pramod-pisal Jul 21, 2025
f976ab3
RTD in OW initial changes
pm-priyanka-deshmane Jul 22, 2025
790f337
ADDING CODE FOR LAZYLOAD DISPLAY
Jul 22, 2025
2db663c
Merge pull request #603 from PubMatic/UOE-12612
pm-shivam-soni Jul 23, 2025
b23e11b
reverting code for refresh
Jul 25, 2025
bcdd4dc
reverting code for refresh
Jul 25, 2025
d7557ae
Merge pull request #606 from PubMatic/UOE-12342-display
pm-azhar-mulla Jul 28, 2025
0a76898
Merge branch 'nightly' into openwrap_10_0_0_20250707143436
Aug 2, 2025
0b12504
Merge branch 'nightly' into openwrap_9_53_1_20250716121852
pm-abhinav-deshpande Aug 4, 2025
05c5e4a
my commit message
pm-pramod-pisal Aug 5, 2025
60e23eb
Merge branch 'openwrap_9_53_1_20250716121852' into prebid_10_6_9_53
Aug 19, 2025
7e2bfa0
Merge pull request #607 from PubMatic/openwrap_9_53_1_20250716121852
pm-abhinav-deshpande Aug 20, 2025
0a684a2
Merge branch 'nightly' into phase03-consent-management
pm-nitin-shirsat Aug 21, 2025
9cf7088
Merge pull request #608 from PubMatic/nightly
pm-nitin-shirsat Aug 21, 2025
4319833
Consent management reset : enabled:false
pm-nitin-shirsat Aug 21, 2025
391a4d5
updated dfp with gam as per prebid10
Aug 21, 2025
7b5cf3f
Adding support for floors
pm-priyanka-deshmane Sep 5, 2025
e9eb601
Merging Nightly
pm-priyanka-deshmane Sep 10, 2025
c915288
Updated constants.js to change the yieldOptiEnabled key
pm-priyanka-deshmane Sep 10, 2025
8ad2c7d
Commenting test-case exec to trigger nightly
pm-priyanka-deshmane Sep 10, 2025
2275681
my commit message
pm-pramod-pisal Sep 10, 2025
b5b6ded
Updated init-build.sh to change version
pm-priyanka-deshmane Sep 11, 2025
7efede4
Merge pull request #611 from PubMatic/nightly_hotfix_9_53_2_issue
pm-kapil-tuptewar Sep 11, 2025
adfc109
Merge pull request #610 from PubMatic/nightly_16_sept_release
pm-kapil-tuptewar Sep 15, 2025
5874b55
Passing versionid
pm-priyanka-deshmane Sep 22, 2025
834c959
Merge pull request #612 from PubMatic/nightly
pm-nitin-shirsat Oct 1, 2025
7b5d35a
Updated constant as per changes from API
pm-priyanka-deshmane Oct 1, 2025
06a4ecd
Test cases added
pm-priyanka-deshmane Oct 1, 2025
b6c26aa
Added code to read auction delay from code snippet, if provided
pm-priyanka-deshmane Oct 3, 2025
222c268
Moved code to set RTD just before setConfig
pm-priyanka-deshmane Oct 7, 2025
fd9b5a0
UOE-13243
pm-priyanka-deshmane Oct 27, 2025
4816f93
my commit message
pm-pramod-pisal Nov 4, 2025
9d3e9e0
Merging nightly
pm-priyanka-deshmane Nov 5, 2025
7fa341d
Merge pull request #616 from PubMatic/UOE-12755-1
pm-priyanka-deshmane Nov 5, 2025
00fc2f5
Merge pull request #618 from PubMatic/UOE-12755
pm-priyanka-deshmane Nov 10, 2025
4908245
Support for both code snippets
pm-priyanka-deshmane Nov 12, 2025
10b1d40
Merge branch 'UOE-12755' of https://github.com/PubMatic/OpenWrap into…
pm-priyanka-deshmane Nov 12, 2025
0555b35
Adding support only through hooks
pm-priyanka-deshmane Nov 14, 2025
2191fb9
Merge pull request #619 from PubMatic/phase03-consent-management
pm-nitin-shirsat Nov 17, 2025
f75f5f6
Merge pull request #621 from PubMatic/nightly_24nov
pm-priyanka-deshmane Nov 19, 2025
d0ba37d
Merge pull request #620 from PubMatic/nightly_24nov
pm-kapil-tuptewar Nov 24, 2025
ec536f9
Update gulpfile.js
pm-priyanka-deshmane Nov 28, 2025
8fe8075
Merge pull request #622 from PubMatic/openwrap_10_15_0_20251104145654
pm-priyanka-deshmane Jan 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,8 @@ gulp.task('bundle-pwt-keys', function() {
"UUID": "pwtuuid",
"CACHE_ID": "pwtcid",
"CACHE_HOST": "pwtcurl",
"ADOMAIN" : "pwtadomain"
"ADOMAIN" : "pwtadomain",
"VERSION": 'pwtver'
}
}
]
Expand All @@ -303,7 +304,8 @@ gulp.task('bundle-pwt-keys', function() {
"ADOMAIN": "hb_adomain",
"ACAT": "hb_acat",
"CRID": "hb_crid",
"DSP": "hb_dsp"
"DSP": "hb_dsp",
"VERSION": 'hb_ver'
}
}
]
Expand Down
4 changes: 2 additions & 2 deletions init-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ then
exit 1
fi

OpenWrapNodeModules="${GLOBAL_OPENWRAP_PKG_JSON_DIR_V9_21_0}/node_modules/"
OpenWrapNodeModules="${GLOBAL_OPENWRAP_PKG_JSON_DIR_V10_15_0}/node_modules/"

function prebidNpmInstall() {
echo "This is SymLinking Start"
cd $1


PrebidJSNodeModules="${GLOBAL_PREBID_PKG_JSON_DIR_V9_21_0}/node_modules/"
PrebidJSNodeModules="${GLOBAL_PREBID_PKG_JSON_DIR_V10_15_0}/node_modules/"

symLinkForPrebidNodeModules=node_modules
if [ -L $symLinkForPrebidNodeModules ]; then
Expand Down
199 changes: 118 additions & 81 deletions src_new/adapters/prebid.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ var BID = require("../bid.js");
var util = require("../util.js");
var bidManager = require("../bidManager.js");
var CONF = require("../conf.js");
var consentConfigResolver = require("../modules/consentConfigResolver.js");
var commonUtil = require("../common.util.js");

var COMMON_CONFIG = require("../common.config.js");

Expand Down Expand Up @@ -832,48 +834,48 @@ function assignUserSyncConfig(prebidConfig){

exports.assignUserSyncConfig = assignUserSyncConfig;

function assignGdprConfigIfRequired(prebidConfig){
if (CONFIG.getGdpr()) {
if(!prebidConfig["consentManagement"]){
prebidConfig["consentManagement"] = {};
}
prebidConfig["consentManagement"]['gdpr'] = {
cmpApi: CONFIG.getCmpApi(),
timeout: CONFIG.getGdprTimeout(),
allowAuctionWithoutConsent: CONFIG.getAwc(), // Auction without consent
defaultGdprScope: true
};
var gdprActionTimeout = COMMON_CONFIG.getGdprActionTimeout()
if (gdprActionTimeout) {
util.log("GDPR IS ENABLED, TIMEOUT: " + prebidConfig["consentManagement"]['gdpr']['timeout'] +", ACTION TIMEOUT: "+ gdprActionTimeout);
prebidConfig["consentManagement"]['gdpr']['actionTimeout'] = gdprActionTimeout;
}
}
}

exports.assignGdprConfigIfRequired = assignGdprConfigIfRequired;

function assignCcpaConfigIfRequired(prebidConfig){
if (CONFIG.getCCPA()) {
if(!prebidConfig["consentManagement"]){
prebidConfig["consentManagement"] = {};
}
prebidConfig["consentManagement"]["usp"] = {
cmpApi: CONFIG.getCCPACmpApi(),
timeout: CONFIG.getCCPATimeout(),
};
}
}

exports.assignCcpaConfigIfRequired = assignCcpaConfigIfRequired;

function assignGppConfigIfRequired(prebidConfig) {
if (CONFIG.getGppConsent()) {
prebidConfig = COMMON_CONFIG.setConsentConfig(prebidConfig, "gpp", CONFIG.getGppCmpApi(), CONFIG.getGppTimeout());
}
}

exports.assignGppConfigIfRequired = assignGppConfigIfRequired;
// function assignGdprConfigIfRequired(prebidConfig){
// if (CONFIG.getGdpr()) {
// if(!prebidConfig["consentManagement"]){
// prebidConfig["consentManagement"] = {};
// }
// prebidConfig["consentManagement"]['gdpr'] = {
// cmpApi: CONFIG.getCmpApi(),
// timeout: CONFIG.getGdprTimeout(),
// allowAuctionWithoutConsent: CONFIG.getAwc(), // Auction without consent
// defaultGdprScope: true
// };
// var gdprActionTimeout = COMMON_CONFIG.getGdprActionTimeout()
// if (gdprActionTimeout) {
// util.log("GDPR IS ENABLED, TIMEOUT: " + prebidConfig["consentManagement"]['gdpr']['timeout'] +", ACTION TIMEOUT: "+ gdprActionTimeout);
// prebidConfig["consentManagement"]['gdpr']['actionTimeout'] = gdprActionTimeout;
// }
// }
// }

// exports.assignGdprConfigIfRequired = assignGdprConfigIfRequired;

// function assignCcpaConfigIfRequired(prebidConfig){
// if (CONFIG.getCCPA()) {
// if(!prebidConfig["consentManagement"]){
// prebidConfig["consentManagement"] = {};
// }
// prebidConfig["consentManagement"]["usp"] = {
// cmpApi: CONFIG.getCCPACmpApi(),
// timeout: CONFIG.getCCPATimeout(),
// };
// }
// }

// exports.assignCcpaConfigIfRequired = assignCcpaConfigIfRequired;

// function assignGppConfigIfRequired(prebidConfig) {
// if (CONFIG.getGppConsent()) {
// prebidConfig = COMMON_CONFIG.setConsentConfig(prebidConfig, "gpp", CONFIG.getGppCmpApi(), CONFIG.getGppTimeout());
// }
// }

// exports.assignGppConfigIfRequired = assignGppConfigIfRequired;

function assignCurrencyConfigIfRequired(prebidConfig){
if(CONFIG.getAdServerCurrency()){
Expand All @@ -890,7 +892,7 @@ function assignCurrencyConfigIfRequired(prebidConfig){
exports.assignCurrencyConfigIfRequired = assignCurrencyConfigIfRequired;

function assignSchainConfigIfRequired(prebidConfig){
if(CONFIG.isSchainEnabled()){
if(CONFIG.isSchainEnabled() && CONFIG.getSchainObject()){
prebidConfig["schain"] = CONFIG.getSchainObject();
}
}
Expand Down Expand Up @@ -1027,7 +1029,7 @@ function addOnBidRequestHandler(){
exports.addOnBidRequestHandler = addOnBidRequestHandler;
// endRemoveIf(removeLegacyAnalyticsRelatedCode)

function setPrebidConfig(){
function setPrebidConfig() {
if(util.isFunction(window[pbNameSpace].setConfig) || typeof window[pbNameSpace].setConfig == "function") {
var prebidConfig = {
debug: util.isDebugLogEnabled(),
Expand All @@ -1038,6 +1040,7 @@ function setPrebidConfig(){
bidderSequence: CONF.pwt.bidderOrderingEnabled === "1" ? "fixed" : "random",
disableAjaxTimeout: CONFIG.getDisableAjaxTimeout(),
enableSendAllBids: CONFIG.getSendAllBidsStatus(),
enableTIDs: !!CONFIG.getTransactionIdStatus(),
targetingControls: {
alwaysIncludeDeals: true
},
Expand All @@ -1063,12 +1066,12 @@ function setPrebidConfig(){

window.PWT.ssoEnabled = CONFIG.isSSOEnabled() || false;

refThis.getFloorsConfiguration(prebidConfig);
refThis.getYieldOptimizerConfiguration(prebidConfig);
refThis.checkConfigLevelFloor(prebidConfig);
refThis.assignUserSyncConfig(prebidConfig);
refThis.assignGdprConfigIfRequired(prebidConfig);
refThis.assignCcpaConfigIfRequired(prebidConfig);
refThis.assignGppConfigIfRequired(prebidConfig);
//refThis.assignGdprConfigIfRequired(prebidConfig);
//refThis.assignCcpaConfigIfRequired(prebidConfig);
//refThis.assignGppConfigIfRequired(prebidConfig);
refThis.assignCurrencyConfigIfRequired(prebidConfig);
refThis.assignSchainConfigIfRequired(prebidConfig);
refThis.assignSingleRequestConfigForBidders(prebidConfig);
Expand All @@ -1083,8 +1086,18 @@ function setPrebidConfig(){
util.handleHook(CONSTANTS.HOOKS.PREBID_SET_CONFIG, [ prebidConfig ]);
//todo: stop supporting this hook let pubs use pbjs.requestBids hook
// do not set any config below this line as we are executing the hook above

window[pbNameSpace].setConfig(prebidConfig);
// Some OW+ IH or IH pubs use this hook to add/remove identityPartner.

consentConfigResolver.getConsentManagementConfig(function (cmConfig) {
if(cmConfig && !util.isEmptyObject(cmConfig)) {
prebidConfig.consentManagement = cmConfig;
}

// Setting complete config to prebid after consent management config is set.
// As UserSync config required to be set with consent due to userSync modules do required the consent
window[pbNameSpace].setConfig(prebidConfig);
});

} else {
util.logWarning("PreBidJS setConfig method is not available");
}
Expand Down Expand Up @@ -1167,25 +1180,24 @@ function checkConfigLevelFloor(prebidConfig){
}
exports.checkConfigLevelFloor = checkConfigLevelFloor;

function getFloorsConfiguration(prebidConfig){
if(CONFIG.isFloorPriceModuleEnabled() == true && CONFIG.getFloorSource() !== CONSTANTS.COMMON.EXTERNAL_FLOOR_WO_CONFIG){
prebidConfig["floors"]={
enforcement: {
enforceJS: CONFIG.getFloorType()
},
auctionDelay: CONFIG.getFloorAuctionDelay(),
endpoint:{
url: CONFIG.getFloorJsonUrl()
},
additionalSchemaFields : {
browser : util.getBrowserDetails,
platform_id : util.getPltForFloor
}
}
function getYieldOptimizerConfiguration(prebidConfig){
if(CONFIG.isYieldOptimizerEnabled()) {
prebidConfig.realTimeData = {
auctionDelay: 300,
dataProviders: [{
name: "pubmatic",
waitForIt: true,
params: {
publisherId: CONFIG.getPublisherId(),
profileId: CONFIG.getProfileID(),
versionId: CONFIG.getProfileDisplayVersionID()
}
}]
};
}
}

exports.getFloorsConfiguration = getFloorsConfiguration;
exports.getYieldOptimizerConfiguration = getYieldOptimizerConfiguration;

function checkForYahooSSPBidder(prebidConfig){
var isYahooAlias = false;
Expand Down Expand Up @@ -1432,15 +1444,51 @@ function initPbjsConfig(){
return;
}
window[pbNameSpace].logging = util.isDebugLogEnabled();
refThis.setPbjsBidderSettingsIfRequired();
refThis.setPrebidConfig();
refThis.configureBidderAliasesIfAvailable();
refThis.enablePrebidPubMaticAnalyticIfRequired();
refThis.setPbjsBidderSettingsIfRequired();
// util.getGeoInfo();


// If consent Management is enabled then do not fetch the geo info from consentConfigResolver.js(here) module will do the same.
if(!COMMON_CONFIG.consentManagementEnabled()){
commonUtil.getGeoInfo();
}
}

exports.initPbjsConfig = initPbjsConfig;

function fetchBids(activeSlots){
function fetchBids(activeSlots, callback) {
function requestBidsPostConsentProcess() {
// Halt execution till we found if consentManagement Config is set or not, once this flag found we will proceed with below execution
if(!COMMON_CONFIG.consentManagementEnabled()){
proceedToRequestBids();
return;
}

function proceedToRequestBids() {
executeRequestBids();
}

consentConfigResolver.getInstance().getProcessCompleted(proceedToRequestBids);
}

function executeRequestBids() {
window[pbNameSpace].removeAdUnit();
window[pbNameSpace].addAdUnits(adUnitsArray);
window[pbNameSpace].requestBids({
bidsBackHandler: function (bidResponses) {
if (util.isFunction(window[pbNameSpace].setPAAPIConfigForGPT) && typeof window[pbNameSpace].setPAAPIConfigForGPT == "function") {
window[pbNameSpace].setPAAPIConfigForGPT();
};
refThis.pbjsBidsBackHandler(bidResponses, activeSlots);
if (util.isFunction(callback)) {
callback(bidResponses);
}
},
timeout: CONFIG.getTimeout() - CONSTANTS.CONFIG.TIMEOUT_ADJUSTMENT
});
}

var impressionID = util.generateUUID();
// todo:
Expand Down Expand Up @@ -1489,18 +1537,7 @@ function fetchBids(activeSlots){
refThis.addOnAuctionEndHandler();
}
// endRemoveIf(removeLegacyAnalyticsRelatedCode)

window[pbNameSpace].removeAdUnit();
window[pbNameSpace].addAdUnits(adUnitsArray);
window[pbNameSpace].requestBids({
bidsBackHandler: function(bidResponses){
if(util.isFunction(window[pbNameSpace].setPAAPIConfigForGPT) && typeof window[pbNameSpace].setPAAPIConfigForGPT == "function"){
window[pbNameSpace].setPAAPIConfigForGPT();
};
refThis.pbjsBidsBackHandler(bidResponses, activeSlots);
},
timeout: CONFIG.getTimeout() - CONSTANTS.CONFIG.TIMEOUT_ADJUSTMENT
});
requestBidsPostConsentProcess();
} else {
util.log("PreBid js requestBids function is not available");
return;
Expand Down
39 changes: 27 additions & 12 deletions src_new/bidManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -888,20 +888,35 @@ exports.setStandardKeys = function(winningBid, keyValuePairs){
// endRemoveIf(removeLegacyAnalyticsRelatedCode)

// removeIf(removeLegacyAnalyticsRelatedCode)
exports.getBrowser = function() {
exports.getBrowser = (function() {
var regExBrowsers = CONSTANTS.REGEX_BROWSERS;
var browserMapping = CONSTANTS.BROWSER_MAPPING;

var userAgent = navigator.userAgent;
var browserName = userAgent == null ? -1 : 0;
if(userAgent) {
for(var i = 0; i < regExBrowsers.length; i++) {
if(userAgent.match(regExBrowsers[i])) {
browserName = browserMapping[i];
break;

function matchBrowserPatterns(str) {
if (!str) {
return 0;
}
for (var i = 0; i < regExBrowsers.length; i++) {
if (regExBrowsers[i].regex.test(str)) {
return regExBrowsers[i].id;
}
}
return 0;
}
return browserName;
}

return function getBrowser() {
var nav = (typeof window !== 'undefined' && window.navigator) || {};
var brands = nav.userAgentData && nav.userAgentData.brands;

if (brands && brands.length) {
var brandString = brands.reduce(function(a, b) {
return a + (b.brand || '').toLowerCase() + ' ';
}, '').trim();
var result = matchBrowserPatterns(brandString);
if (result) return result;
}

var result = matchBrowserPatterns(nav.userAgent);
return result;
};
}());
// endRemoveIf(removeLegacyAnalyticsRelatedCode)
Loading