Skip to content

Commit

Permalink
TheMediaGrid Bid Adapter: added support of PBAdSlot module (prebid#6609)
Browse files Browse the repository at this point in the history
* Added TheMediaGridNM Bid Adapter

* Updated required params for TheMediaGridNM Bid Adapter

* Update TheMediGridNM Bid Adapter

* Fix tests for TheMediaGridNM Bid Adapter

* Fixes after review for TheMediaGridNM Bid Adapter

* Add support of multi-format in TheMediaGrid Bid Adapter

* Update sync url for grid and gridNM Bid Adapters

* TheMediaGrid Bid Adapter: added keywords adUnit parameter

* Update TheMediaGrid Bid Adapter to support keywords from config

* Implement new request format for TheMediaGrid Bid Adapter

* Fix jwpseg params for TheMediaGrid Bid Adapter

* Update unit tests for The Media Grid Bid Adapter

* Fix typo in TheMediaGrid Bid Adapter

* Added test for jwTargeting in TheMediaGrid Bid Adapter

* The new request format was made by default in TheMediaGrid Bid Adapter

* Update userId format in ad request for TheMediaGrid Bid Adapter

* Added bidFloor parameter for TheMediaGrid Bid Adapter

* Fix for review TheMediaGrid Bid Adapter

* Support floorModule in TheMediaGrid Bid Adapter

* Fix empty bidfloor for TheMediaGrid Bid Adapter

* Some change to restart autotests

* Fix userIds format for TheMediaGrid Bid Adapter

* Remove digitrust userId from TheMediaGrid Bid Adapter

* Protocols was added in video section in ad request for TheMediaGrid Bid Adapter

* TheMediaGrid: fix trouble with alias using

* TheMediaGridNM: fix trouble with alias

* TheMediaGrid Bid Adapter: added support of PBAdSlot module

* TheMediaGrid Bid Adapter: fix typo
  • Loading branch information
TheMediaGrid authored and umakajan committed May 6, 2021
1 parent fa958d9 commit 209452c
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
8 changes: 7 additions & 1 deletion modules/gridBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const spec = {
if (!userIdAsEids) {
userIdAsEids = bid.userIdAsEids;
}
const {params: {uid, keywords}, mediaTypes, bidId, adUnitCode, rtd} = bid;
const {params: {uid, keywords}, mediaTypes, bidId, adUnitCode, rtd, ortb2Imp} = bid;
bidsMap[bidId] = bid;
if (!pageKeywords && !utils.isEmpty(keywords)) {
pageKeywords = utils.transformBidderParamKeywords(keywords);
Expand All @@ -98,6 +98,12 @@ export const spec = {
divid: adUnitCode
}
};
if (ortb2Imp && ortb2Imp.ext && ortb2Imp.ext.data) {
impObj.ext.data = ortb2Imp.ext.data;
if (impObj.ext.data.adserver && impObj.ext.data.adserver.adslot) {
impObj.ext.gpid = impObj.ext.data.adserver.adslot;
}
}

if (bidFloor) {
impObj.bidfloor = bidFloor;
Expand Down
42 changes: 42 additions & 0 deletions test/spec/modules/gridBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,48 @@ describe('TheMediaGrid Adapter', function () {
expect(payload.tmax).to.equal(3000);
getConfigStub.restore();
});
it('should contain imp[].ext.data.adserver if available', function() {
const ortb2Imp = [{
ext: {
data: {
adserver: {
name: 'ad_server_name',
adslot: '/111111/slot'
},
pbadslot: '/111111/slot'
}
}
}, {
ext: {
data: {
adserver: {
name: 'ad_server_name',
adslot: '/222222/slot'
},
pbadslot: '/222222/slot'
}
}
}];
const bidRequestsWithOrtb2Imp = bidRequests.slice(0, 3).map((bid, ind) => {
return Object.assign(ortb2Imp[ind] ? { ortb2Imp: ortb2Imp[ind] } : {}, bid);
});
const request = spec.buildRequests(bidRequestsWithOrtb2Imp, bidderRequest);
expect(request.data).to.be.an('string');
const payload = parseRequest(request.data);
expect(payload.imp[0].ext).to.deep.equal({
divid: bidRequests[0].adUnitCode,
data: ortb2Imp[0].ext.data,
gpid: ortb2Imp[0].ext.data.adserver.adslot
});
expect(payload.imp[1].ext).to.deep.equal({
divid: bidRequests[1].adUnitCode,
data: ortb2Imp[1].ext.data,
gpid: ortb2Imp[1].ext.data.adserver.adslot
});
expect(payload.imp[2].ext).to.deep.equal({
divid: bidRequests[2].adUnitCode
});
});
describe('floorModule', function () {
const floorTestData = {
'currency': 'USD',
Expand Down

0 comments on commit 209452c

Please sign in to comment.