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
I want to conditional enable or disable the consent module per publisher website via config but using the same prebid js file.
When including the consentModule but not setting a consentManagent config, the backward compatibility is throwing an exception:
Steps to reproduce
include consentModule in prebid build
do not include consentManagement config params
Expected results
No exception.
Actual results
consentManagement.js:454 Uncaught TypeError: Cannot read property 'gdpr' of undefined
utils.logWarn('consentManagement config not defined, exiting consent manager');
return;
}
do this:
if(!config||typeofconfig!=='object'){utils.logWarn('consentManagement config not defined, exiting consent manager');return;}// if `config.gdpr` or `config.usp` exist, assume new config format.// else for backward compatability, just use `config`config=config.gdpr||config.usp ? config.gdpr : config;
The text was updated successfully, but these errors were encountered:
I'm not able to reproduce your issue. I tried including the consentManagement module, but didn't include it in the call to pbjs.setConfig, but I didn't get the exception that you were talking about.
My configuration with consentManagement module included in the build:
@derdeka, Thanks for bringing this up, I think we should definitely swap those lines. This is a weird edge case which I think won't arise for many publishers because generally they don't include the consentManagement object itself in the config if they wanna disable consentManagement module.
Here's a page which lists cmp best practices which goes hand in hand with the usage of consentManagement module.
Type of issue
Bug
Description
I want to conditional enable or disable the consent module per publisher website via config but using the same prebid js file.
When including the consentModule but not setting a consentManagent config, the backward compatibility is throwing an exception:
Steps to reproduce
Expected results
No exception.
Actual results
consentManagement.js:454 Uncaught TypeError: Cannot read property 'gdpr' of undefined
Platform details
prebid.js 4.9.0
Suggested solution:
Swapping lines. Instead of:
Prebid.js/modules/consentManagement.js
Lines 452 to 458 in 8982e09
do this:
The text was updated successfully, but these errors were encountered: