Skip to content

Commit

Permalink
[synacormedia] Update adapter to support Consent Management Module (#…
Browse files Browse the repository at this point in the history
…5506)

* CAP-1614 - updated docs to show correct size for banner and some other small fixes

* CAP-1636 support schain object in prebid

* CAP-1636 updated the review comments

* CAP-1849 - split up banner and video impressions to use format

* CAP-1879 - added adapter support for consent management module

* CAP-1879 - updates for pr

* CAP-1879 - remove unneeded checks

Co-authored-by: Corey Kress <[email protected]>
Co-authored-by: Rajkumar Natarajan <[email protected]>
  • Loading branch information
3 people authored Jul 22, 2020
1 parent 3a8f5cd commit 3b7cb37
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
7 changes: 6 additions & 1 deletion modules/synacormediaBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

import { getAdUnitSizes, logWarn } from '../src/utils.js';
import { getAdUnitSizes, logWarn, deepSetValue } from '../src/utils.js';
import { registerBidder } from '../src/adapters/bidderFactory.js';
import { BANNER, VIDEO } from '../src/mediaTypes.js';
import includes from 'core-js-pure/features/array/includes.js';
Expand Down Expand Up @@ -85,6 +85,11 @@ export const spec = {
}
});

// CCPA
if (bidderRequest && bidderRequest.uspConsent) {
deepSetValue(openRtbBidRequest, 'regs.ext.us_privacy', bidderRequest.uspConsent);
}

if (openRtbBidRequest.imp.length && seatId) {
return {
method: 'POST',
Expand Down
20 changes: 20 additions & 0 deletions test/spec/modules/synacormediaBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,14 @@ describe('synacormediaBidAdapter ', function () {
}
};

let bidderRequestWithCCPA = {
auctionId: 'xyz123',
refererInfo: {
referer: 'https://test.com/foo/bar'
},
uspConsent: '1YYY'
};

let expectedDataImp1 = {
banner: {
format: [
Expand Down Expand Up @@ -560,6 +568,18 @@ describe('synacormediaBidAdapter ', function () {
}
]);
});
it('should contain the CCPA privacy string when UspConsent is in bidder request', function() {
// banner test
let req = spec.buildRequests([validBidRequest], bidderRequestWithCCPA);
expect(req).be.an('object');
expect(req).to.have.property('method', 'POST');
expect(req).to.have.property('url');
expect(req.url).to.contain('https://prebid.technoratimedia.com/openrtb/bids/prebid?');
expect(req.data).to.exist.and.to.be.an('object');
expect(req.data.id).to.equal('xyz123');
expect(req.data.regs.ext.us_privacy).to.equal('1YYY');
expect(req.data.imp).to.eql([expectedDataImp1]);
})
});

describe('Bid Requests with schain object ', function() {
Expand Down

0 comments on commit 3b7cb37

Please sign in to comment.