Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PS bid adapter update to copy site object from config #5083

Merged
merged 3 commits into from
Apr 21, 2020
Merged
Changes from 1 commit
Commits
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
7 changes: 3 additions & 4 deletions modules/prebidServerBidAdapter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,9 @@ function _appendSiteAppDevice(request, pageUrl) {
request.app = config.getConfig('app');
request.app.publisher = {id: _s2sConfig.accountId}
} else {
request.site = {
publisher: { id: _s2sConfig.accountId },
page: pageUrl
}
request.site = (typeof config.getConfig('site') === 'object') ? config.getConfig('site') : {};
request.site.publisher = { id: _s2sConfig.accountId },
request.site.page = pageUrl;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

image

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?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a test for this as well

}
if (typeof config.getConfig('device') === 'object') {
request.device = config.getConfig('device');
Expand Down