Skip to content

Commit

Permalink
ZetaGlobalSsp adapter: merge ortb2.site and params.site (prebid#11773)
Browse files Browse the repository at this point in the history
* ZetaGlobalSsp adapter: merge params.site and ortb2.site

* fix unit test

* extract buildVideo into utils

* Revert "extract buildVideo into utils"

This reverts commit a075583.

---------

Co-authored-by: Surovenko Alexey <surovenko.alexey@gmail.com>
Co-authored-by: Alexey Surovenko <ASurovenko@vdhk6ddf9m.home>
  • Loading branch information
3 people authored and DecayConstant committed Jul 18, 2024
1 parent bbee22c commit c13fe68
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/zeta_global_sspBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ export const spec = {
id: bidderRequest.bidderRequestId,
cur: [DEFAULT_CUR],
imp: imps,
site: params.site ? params.site : {},
device: {...(bidderRequest.ortb2?.device || {}), ...params.device},
site: {...bidderRequest?.ortb2?.site, ...params?.site},
device: {...bidderRequest?.ortb2?.device, ...params?.device},
user: params.user ? params.user : {},
app: params.app ? params.app : {},
ext: {
Expand Down
11 changes: 11 additions & 0 deletions test/spec/modules/zeta_global_sspBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ describe('Zeta Ssp Bid Adapter', function () {
userIdAsEids: eids,
timeout: 500,
ortb2: {
site: {
inventorypartnerdomain: 'disqus.com'
},
device: {
sua: {
mobile: 1,
Expand Down Expand Up @@ -709,4 +712,12 @@ describe('Zeta Ssp Bid Adapter', function () {
expect(payload.ext.tags.nullTag).to.be.undefined;
expect(payload.ext.tags.complexEmptyTag).to.be.undefined;
});

it('Test that site payload param are merged from ortb2 and params', function () {
const request = spec.buildRequests(bannerRequest, bannerRequest[0]);
const payload = JSON.parse(request.data);

expect(payload.site.page).to.eql('zetaglobal.com/page');
expect(payload.site.inventorypartnerdomain).to.eql('disqus.com');
});
});

0 comments on commit c13fe68

Please sign in to comment.