Skip to content

Commit

Permalink
GDPR support added to the vuble bidder (prebid#4804)
Browse files Browse the repository at this point in the history
* Add: gdpr consent

* Del: comma

* Mod: properties names

* Check if gdpr applies is a boolean
  • Loading branch information
Roffray authored Feb 5, 2020
1 parent 563e166 commit 50d2a29
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
7 changes: 7 additions & 0 deletions modules/vubleBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,13 @@ export const spec = {
adUnitCode: bidRequest.adUnitCode
};

if (bidderRequest && bidderRequest.gdprConsent) {
data.gdpr_consent = {
consent_string: bidderRequest.gdprConsent.consentString,
gdpr_applies: (typeof bidderRequest.gdprConsent.gdprApplies === 'boolean') ? bidderRequest.gdprConsent.gdprApplies : true
}
}

return {
method: 'POST',
url: url,
Expand Down
31 changes: 29 additions & 2 deletions test/spec/modules/vubleBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,27 @@ describe('VubleAdapter', function () {
adUnitCode: ''
}
};
let bidderRequest = {
let request4 = {
method: 'POST',
url: 'https://player.mediabong.net/prebid/request',
data: {
width: '640',
height: '360',
pub_id: '3',
zone_id: '3579',
context: 'instream',
floor_price: 0,
url: '',
env: 'net',
bid_id: 'ijkl',
adUnitCode: '',
gdpr_consent: {
consent_string: 'test',
gdpr_applies: true
}
}
};
let bidderRequest1 = {
refererInfo: {
referer: 'https://www.vuble.tv/',
reachedTop: true,
Expand All @@ -214,10 +234,17 @@ describe('VubleAdapter', function () {
]
}
};
let bidderRequest2 = {
'gdprConsent': {
consentString: 'test',
gdprApplies: true
}
};

it('must return the right formatted requests', function () {
expect(adapter.buildRequests([bid1, bid2])).to.deep.equal([request1, request2]);
expect(adapter.buildRequests([bid3], bidderRequest)).to.deep.equal([request3]);
expect(adapter.buildRequests([bid3], bidderRequest1)).to.deep.equal([request3]);
expect(adapter.buildRequests([bid3], bidderRequest2)).to.deep.equal([request4]);
});
});

Expand Down

0 comments on commit 50d2a29

Please sign in to comment.