PS bid adapter update to copy site object from config#5083
PS bid adapter update to copy site object from config#5083robertrmartinez merged 3 commits intoprebid:masterfrom
Conversation
… prebid configuration. If exists, this will be copied over into the request and publisher/page will either be created properties or will overwrite existing config defined values. This will allow other OpenRTB fields within the site object to be passed to Prebid Server, i.e. site.content
|
@mmoschovas Please check the lint errors in the circleci test report link and fix them. |
| } | ||
| request.site = (typeof config.getConfig('site') === 'object') ? config.getConfig('site') : {}; | ||
| request.site.publisher = { id: _s2sConfig.accountId }, | ||
| request.site.page = pageUrl; |
There was a problem hiding this comment.
So if someone sets site in setConfig, we want to use it.
But we want to overwrite publisher and page no matter what?
Here is what the publisher object specifies in openRTB protocol:
So if we did:
pbjs.setConfig({
site: {
...
publisher: {
id: 'some id'
domain: 'prebid.org'
...
}
});
Then we would basically not include the other keys in the user defined publisher object.
Maybe it makes more sense to use utils.deepSet in order to set the id of publisher, so that if publisher already exists we do not overwrite the entire thing but just the id key?
There was a problem hiding this comment.
Please add a test for this as well
… as opposed to overwritting entire publisher object
|
Changed pull request text formatting to better match Prebid.js pull request conventions. |
|
LGTM |
robertrmartinez
left a comment
There was a problem hiding this comment.
Nice Looks good!
* Updated Prebid Server bid adapter to check for the site object in the prebid configuration. If exists, this will be copied over into the request and publisher/page will either be created properties or will overwrite existing config defined values. This will allow other OpenRTB fields within the site object to be passed to Prebid Server, i.e. site.content * Update to fix lint error and set site.publisher.id using deepSet util as opposed to overwritting entire publisher object * Updated prebid bid adapter spec to include test for site object update Co-authored-by: Michael Moschovas <mmoschovas@NY-Moschovas.local>

Type of change
Description of change
Updated Prebid Server bid adapter to check for the site object in the prebid configuration. If exists, this will be copied over into the request and publisher/page will either be created properties or will overwrite existing config defined values. This will allow other OpenRTB fields within the site object to be passed to Prebid Server, i.e. site.content
Other information
#3783