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 GPID for TTD #6841

Merged
merged 3 commits into from
Jun 4, 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
10 changes: 9 additions & 1 deletion modules/gumgumBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,18 @@ function buildRequests (validBidRequests, bidderRequest) {
params = {},
schain,
transactionId,
userId = {}
userId = {},
ortb2Imp
} = bidRequest;
const { currency, floor } = _getFloor(mediaTypes, params.bidfloor, bidRequest);
let sizes = [1, 1];
let data = {};
let gpid = '';

// ADJS-1024
if (utils.deepAccess(ortb2Imp, 'ext.data.adserver.name')) {
gpid = ortb2Imp.ext.data.adserver.adslot
}

if (mediaTypes.banner) {
sizes = mediaTypes.banner.sizes;
Expand Down Expand Up @@ -318,6 +325,7 @@ function buildRequests (validBidRequests, bidderRequest) {
sizes,
url: BID_ENDPOINT,
method: 'GET',
gpid: gpid,
Copy link
Collaborator

Choose a reason for hiding this comment

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

unless you put something in data., as you have data.pi above, or data.fp, it doesn't appear to flow through to your endpoint

data: Object.assign(data, _getBrowserParams(topWindowUrl), _getDigiTrustQueryParams(userId), _getTradeDeskIDParam(userId))
})
});
Expand Down
7 changes: 7 additions & 0 deletions test/spec/modules/gumgumBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,13 @@ describe('gumgumAdapter', function () {
expect(bidRequest.data).to.not.have.property('irisid');
});

it('should set the global placement id (gpid)', function () {
const req = { ...bidRequests[0], ortb2Imp: { ext: { data: { adserver: { name: 'test', adslot: 123456 } } } } }
const bidRequest = spec.buildRequests([req])[0];
expect(bidRequest).to.have.property('gpid');
expect(bidRequest.gpid).to.equal(123456);
Copy link
Collaborator

Choose a reason for hiding this comment

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

this will always be a string

});

describe('product id', function () {
it('should set the correct pi param if native param is found', function () {
const request = { ...bidRequests[0], params: { ...zoneParam, native: 2 } };
Expand Down