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

Gumgum Bid Adapter: add adUnitCode to requests #7704

Merged
merged 3 commits into from
Nov 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 5 additions & 1 deletion modules/gumgumBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,8 @@ function buildRequests(validBidRequests, bidderRequest) {
schain,
transactionId,
userId = {},
ortb2Imp
ortb2Imp,
adUnitCode = ''
} = bidRequest;
const { currency, floor } = _getFloor(mediaTypes, params.bidfloor, bidRequest);
const eids = getEids(userId);
Expand All @@ -302,6 +303,9 @@ function buildRequests(validBidRequests, bidderRequest) {
data.to = to;
}

// ADTS-169 add adUnitCode to requests
if (adUnitCode) data.aun = adUnitCode

// ADTS-134 Retrieve ID envelopes
for (const eid in eids) data[eid] = eids[eid];

Expand Down
6 changes: 6 additions & 0 deletions test/spec/modules/gumgumBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@ describe('gumgumAdapter', function () {
const zoneParam = { 'zone': '123a' };
const pubIdParam = { 'pubId': 123 };

it('should set aun if the adUnitCode is available', function () {
const request = { ...bidRequests[0] };
const bidRequest = spec.buildRequests([request])[0];
expect(bidRequest.data.aun).to.equal(bidRequests[0].adUnitCode);
});

it('should set pubId param if found', function () {
const request = { ...bidRequests[0], params: pubIdParam };
const bidRequest = spec.buildRequests([request])[0];
Expand Down