Skip to content

Commit

Permalink
Fallback to utilize ad unit code if dmx id is not provide and increas…
Browse files Browse the repository at this point in the history
…ed TTL value (#6178)

* allow users to be sent to dmx even when gdpr is configured in prebid

* Change default ttl value

Change default ttl value for banner and video

* optional dmxid - fallback to use ad unit code

Co-authored-by: steve-a-districtm <[email protected]>
  • Loading branch information
1 parent e33c62d commit 884b814
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions modules/districtmDMXBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const spec = {
supportedFormat: [BANNER, VIDEO],
supportedMediaTypes: [VIDEO, BANNER],
isBidRequestValid(bid) {
return !!(bid.params.dmxid && bid.params.memberid);
return !!(bid.params.memberid);
},
interpretResponse(response, bidRequest) {
response = response.body || {};
Expand Down Expand Up @@ -152,7 +152,7 @@ export const spec = {
let tosendtags = bidRequest.map(dmx => {
var obj = {};
obj.id = dmx.bidId;
obj.tagid = String(dmx.params.dmxid);
obj.tagid = String(dmx.params.dmxid || dmx.adUnitCode);
obj.secure = 1;
obj.bidfloor = getFloor(dmx);
if (dmx.mediaTypes && dmx.mediaTypes.video) {
Expand Down
7 changes: 3 additions & 4 deletions test/spec/modules/districtmDmxBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -687,17 +687,16 @@ describe('DistrictM Adaptor', function () {

describe(`isBidRequestValid test response`, function () {
let params = {
dmxid: 10001,
dmxid: 10001, // optional
memberid: 10003,
};
it(`function should return true`, function () {
expect(districtm.isBidRequestValid({ params })).to.be.equal(true);
});
it(`function should return false`, function () {
expect(districtm.isBidRequestValid({ params: { memberid: 12345 } })).to.be.equal(false);
expect(districtm.isBidRequestValid({ params: {} })).to.be.equal(false);
});
it(`expect to have two property available dmxid and memberid`, function () {
expect(params).to.have.property('dmxid');
it(`expect to have memberid`, function () {
expect(params).to.have.property('memberid');
});
});
Expand Down

0 comments on commit 884b814

Please sign in to comment.