Skip to content

Commit

Permalink
Merge pull request #10 from gumgum/ADSS-1756-pass-gpid-to-video-requests
Browse files Browse the repository at this point in the history
GumGum Bid Adapter: Added gpid to video requests
  • Loading branch information
john-ivan committed Dec 7, 2023
2 parents 7f815d2 + 6e21116 commit 823c450
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/gumgumBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,16 +345,16 @@ function buildRequests(validBidRequests, bidderRequest) {
// ADTS-134 Retrieve ID envelopes
for (const eid in eids) data[eid] = eids[eid];

// ADJS-1024 & ADSS-1297 & ADTS-175
gpid && (data.gpid = gpid);

if (mediaTypes.banner) {
sizes = mediaTypes.banner.sizes;
} else if (mediaTypes.video) {
sizes = mediaTypes.video.playerSize;
data = _getVidParams(mediaTypes.video);
}

// ADJS-1024 & ADSS-1297 & ADTS-175
gpid && (data.gpid = gpid);

if (pageViewId) {
data.pv = pageViewId;
}
Expand Down
8 changes: 8 additions & 0 deletions test/spec/modules/gumgumBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,14 @@ describe('gumgumAdapter', function () {
expect(bidRequest.data.gpid).to.equal(pbadslot);
});

it('should set the global placement id (gpid) if media type is video', function () {
const pbadslot = 'cde456'
const req = { ...bidRequests[0], ortb2Imp: { ext: { data: { pbadslot } } }, params: zoneParam, mediaTypes: vidMediaTypes }
const bidRequest = spec.buildRequests([req])[0];
expect(bidRequest.data).to.have.property('gpid');
expect(bidRequest.data.gpid).to.equal(pbadslot);
});

it('should set the bid floor if getFloor module is not present but static bid floor is defined', function () {
const req = { ...bidRequests[0], params: { bidfloor: 42 } }
const bidRequest = spec.buildRequests([req])[0];
Expand Down

0 comments on commit 823c450

Please sign in to comment.