Skip to content

Commit

Permalink
Smaato: Do not overwrite site.publisher.id (#8112)
Browse files Browse the repository at this point in the history
Co-authored-by: Bernhard Pickenbrock <bernhard.pickenbrock@smaato.com>
  • Loading branch information
el-chuck and el-chuck committed Feb 23, 2022
1 parent eda8e84 commit c13ed67
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 2 additions & 3 deletions modules/smaatoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ const buildOpenRtbBidRequest = (bidRequest, bidderRequest) => {
tmax: bidderRequest.timeout,
site: {
id: window.location.hostname,
publisher: {
id: deepAccess(bidRequest, 'params.publisherId')
},
domain: window.location.hostname,
page: window.location.href,
ref: bidderRequest.refererInfo.referer
Expand Down Expand Up @@ -51,6 +48,8 @@ const buildOpenRtbBidRequest = (bidRequest, bidderRequest) => {
Object.assign(requestTemplate.user, ortb2.user);
Object.assign(requestTemplate.site, ortb2.site);

deepSetValue(requestTemplate, 'site.publisher.id', deepAccess(bidRequest, 'params.publisherId'));

if (bidderRequest.gdprConsent && bidderRequest.gdprConsent.gdprApplies === true) {
deepSetValue(requestTemplate, 'regs.ext.gdpr', bidderRequest.gdprConsent.gdprApplies ? 1 : 0);
deepSetValue(requestTemplate, 'user.ext.consent', bidderRequest.gdprConsent.consentString);
Expand Down
6 changes: 5 additions & 1 deletion test/spec/modules/smaatoBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,11 @@ describe('smaatoBidAdapterTest', () => {
const config = {
ortb2: {
site: {
keywords: 'power tools,drills'
keywords: 'power tools,drills',
publisher: {
id: 'otherpublisherid',
name: 'publishername'
}
},
user: {
keywords: 'a,b',
Expand Down

0 comments on commit c13ed67

Please sign in to comment.