You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* This function handles interacting with an IAB compliant CMP to obtain the consent information of the user.
47
45
* Given the async nature of the CMP's API, we pass in acting success/error callback functions to exit this function
48
46
* based on the appropriate result.
49
-
* @param {function(string)} cmpSuccess acts as a success callback when CMP returns a value; pass along consentObject (string) from CMP
50
-
* @param {function(string)} cmpError acts as an error callback while interacting with CMP; pass along an error message (string)
51
-
* @param {object} hookConfig contains module related variables (see comment in requestBidsHook function)
47
+
* @param {function({})} onSuccess acts as a success callback when CMP returns a value; pass along consentObjectfrom CMP
48
+
* @param {function(string, ...{}?)} cmpError acts as an error callback while interacting with CMP; pass along an error message (string) and any extra error arguments (purely for logging)
49
+
* @param width
50
+
* @param height size info passed to the SafeFrame API (used only for TCFv1 when Prebid is running within a safeframe)
* This function contains the controlled steps to perform when there's a problem with CMP.
384
-
* @param {string} errMsg required; should be a short descriptive message for why the failure/issue happened.
385
-
* @param {object} hookConfig contains module related variables (see comment in requestBidsHook function)
386
-
* @param {object} extraArgs contains additional data that's passed along in the error/warning messages for easier debugging
387
-
*/
388
-
functioncmpFailed(errMsg,hookConfig,extraArgs){
389
-
clearTimeout(hookConfig.timer);
390
-
391
-
// still set the consentData to undefined when there is a problem as per config options
392
-
if(allowAuction.value&&cmpVersion===1){
393
-
storeConsentData(undefined);
394
-
}
395
-
exitModule(errMsg,hookConfig,extraArgs);
396
-
}
397
-
398
-
/**
399
-
* Stores CMP data locally in module and then invokes gdprDataHandler.setConsentData() to make information available in adaptermanager.js for later in the auction
425
+
* Stores CMP data locally in module to make information available in adaptermanager.js for later in the auction
400
426
* @param {object} cmpConsentObject required; an object representing user's consent choices (can be undefined in certain use-cases for this function only)
401
427
*/
402
428
functionstoreConsentData(cmpConsentObject){
@@ -417,51 +443,7 @@ function storeConsentData(cmpConsentObject) {
417
443
};
418
444
}
419
445
consentData.apiVersion=cmpVersion;
420
-
gdprDataHandler.setConsentData(consentData);
421
-
}
422
-
423
-
/**
424
-
* This function handles the exit logic for the module.
425
-
* While there are several paths in the module's logic to call this function, we only allow 1 of the 3 potential exits to happen before suppressing others.
426
-
*
427
-
* We prevent multiple exits to avoid conflicting messages in the console depending on certain scenarios.
428
-
* One scenario could be auction was canceled due to timeout with CMP being reached.
429
-
* While the timeout is the accepted exit and runs first, the CMP's callback still tries to process the user's data (which normally leads to a good exit).
430
-
* In this case, the good exit will be suppressed since we already decided to cancel the auction.
431
-
*
432
-
* Three exit paths are:
433
-
* 1. good exit where auction runs (CMP data is processed normally).
434
-
* 2. bad exit but auction still continues (warning message is logged, CMP data is undefined and still passed along).
435
-
* 3. bad exit with auction canceled (error message is logged).
436
-
* @param {string} errMsg optional; only to be used when there was a 'bad' exit. String is a descriptive message for the failure/issue encountered.
437
-
* @param {object} hookConfig contains module related variables (see comment in requestBidsHook function)
438
-
* @param {object} extraArgs contains additional data that's passed along in the error/warning messages for easier debugging
0 commit comments