Skip to content

Commit

Permalink
EMX Digital Bid Adapter: add GPID support (prebid#7720)
Browse files Browse the repository at this point in the history
* adding ccpa support for emx_digital adapter

* emx_digital ccpa compliance: lint fix

* emx 3.0 compliance update

* fix outstream renderer issue, update test spec

* refactor formatVideoResponse function to use core-js/find

* Add support for schain forwarding

* Resolved issue with Schain object location

* prebid 5.0 floor module and advertiserDomain support

* liveramp idl and uid2.0 support for prebid

* gpid support

* remove utils ext

* remove empty line

* remove trailing spaces

* move gpid test module

* move gpid test module

* removing trailing spaces from unit test

* remove comments from unit test

Co-authored-by: Nick Colletti <nick.colletti@emxdigital.com>
Co-authored-by: Nick Colletti <gnomish@gmail.com>
Co-authored-by: Kiyoshi Hara <Kiyoshi.Hara@emxdigital.com>
Co-authored-by: Dan Bogdan <daniel.bogdan@emxdigital.com>
Co-authored-by: Jherez Taylor <jherez.taylor@emxdigital.com>
Co-authored-by: EMXDigital <emxdigital@emxdigital.com>
Co-authored-by: Rakesh Balakrishnan <Rakesh.Balakrishnan@emxdigital.com>
Co-authored-by: EMX Digital <43830380+EMXDigital@users.noreply.github.com>
Co-authored-by: Kevin <kevin.hagens@brealtime.com>
  • Loading branch information
10 people authored and Chris Pabst committed Jan 10, 2022
1 parent fd84a05 commit 17dfd00
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
10 changes: 9 additions & 1 deletion modules/emx_digitalBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,18 @@ export const spec = {
tagid,
secure
};

// adding gpid support
let gpid = deepAccess(bid, 'ortb2Imp.ext.data.adserver.adslot');
if (!gpid) {
gpid = deepAccess(bid, 'ortb2Imp.ext.data.pbadslot');
}
if (gpid) {
data.ext = {gpid: gpid.toString()};
}
let typeSpecifics = isVideo ? { video: emxAdapter.buildVideo(bid) } : { banner: emxAdapter.buildBanner(bid) };
let bidfloorObj = bidfloor > 0 ? { bidfloor, bidfloorcur: DEFAULT_CUR } : {};
let emxBid = Object.assign(data, typeSpecifics, bidfloorObj);

emxImps.push(emxBid);
});

Expand Down
10 changes: 10 additions & 0 deletions test/spec/modules/emx_digitalBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,16 @@ describe('emx_digital Adapter', function () {
});
});

it('should add gpid to request if present', () => {
const gpid = '/12345/my-gpt-tag-0';
let bid = utils.deepClone(bidderRequest.bids[0]);
bid.ortb2Imp = { ext: { data: { adserver: { adslot: gpid } } } };
bid.ortb2Imp = { ext: { data: { pbadslot: gpid } } };
let requestWithGPID = spec.buildRequests([bid], bidderRequest);
requestWithGPID = JSON.parse(requestWithGPID.data);
expect(requestWithGPID.imp[0].ext.gpid).to.exist.and.equal(gpid);
});

it('should add UID 2.0 to request', () => {
const uid2 = { id: '456' };
const bidRequestWithUID = utils.deepClone(bidderRequest);
Expand Down

0 comments on commit 17dfd00

Please sign in to comment.