Skip to content

Commit

Permalink
ucfunnel adapter support CCPA
Browse files Browse the repository at this point in the history
  • Loading branch information
jackhsiehucf committed Dec 12, 2019
1 parent 30e79c5 commit fee3803
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions modules/ucfunnelBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,12 @@ function getRequestData(bid, bidderRequest) {
fp: utils.getBidIdParameter('bidfloor', bid.params)
};

if (bidderRequest && bidderRequest.uspConsent) {
Object.assign(bidData, {
usprivacy: bidderRequest.uspConsent
});
}

if (bid.mediaType === 'video' || videoMediaType) {
switch (videoContext) {
case 'outstream':
Expand Down
8 changes: 7 additions & 1 deletion test/spec/modules/ucfunnelBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ import {BANNER, VIDEO, NATIVE} from 'src/mediaTypes';

const URL = '//hb.aralego.com/header';
const BIDDER_CODE = 'ucfunnel';

const bidderRequest = {
uspConsent: '1YNN'
};

const validBannerBidReq = {
bidder: BIDDER_CODE,
params: {
Expand Down Expand Up @@ -116,7 +121,7 @@ describe('ucfunnel Adapter', function () {
});
});
describe('build request', function () {
const request = spec.buildRequests([validBannerBidReq]);
const request = spec.buildRequests([validBannerBidReq], bidderRequest);
it('should create a POST request for every bid', function () {
expect(request[0].method).to.equal('GET');
expect(request[0].url).to.equal(location.protocol + spec.ENDPOINT);
Expand All @@ -129,6 +134,7 @@ describe('ucfunnel Adapter', function () {
it('should attach request data', function () {
const data = request[0].data;
const [ width, height ] = validBannerBidReq.sizes[0];
expect(data.usprivacy).to.equal('1YNN');
expect(data.w).to.equal(width);
expect(data.h).to.equal(height);
expect(data.schain).to.equal('1.0,1!exchange1.com,1234,1,bid-request-1,publisher,publisher.com');
Expand Down

0 comments on commit fee3803

Please sign in to comment.