Skip to content

Commit

Permalink
GDPR support (prebid#2602)
Browse files Browse the repository at this point in the history
  • Loading branch information
nissSK authored and jaiminpanchal27 committed May 23, 2018
1 parent 7da68ee commit 3e4d700
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/sekindoUMBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ export const spec = {
queryString = utils.tryAppendQueryString(queryString, 'protocol', protocol);
queryString = utils.tryAppendQueryString(queryString, 'x', bidRequest.params.width);
queryString = utils.tryAppendQueryString(queryString, 'y', bidRequest.params.height);
if (bidderRequest && bidderRequest.gdprConsent) {
queryString = utils.tryAppendQueryString(queryString, 'gdprConsentString', bidderRequest.gdprConsent.consentString);
queryString = utils.tryAppendQueryString(queryString, 'gdprApplies', (bidderRequest.gdprConsent.gdprApplies) ? '1' : '0');
}
if (bidRequest.mediaType === 'video' || (typeof bidRequest.mediaTypes == 'object' && typeof bidRequest.mediaTypes.video == 'object')) {
queryString = utils.tryAppendQueryString(queryString, 'x', bidRequest.params.playerWidth);
queryString = utils.tryAppendQueryString(queryString, 'y', bidRequest.params.playerHeight);
Expand Down
8 changes: 8 additions & 0 deletions test/spec/modules/sekindoUMBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ describe('sekindoUMAdapter', () => {
expect(request[0].method).to.equal('GET');
});

it('with gdprConsent, banner data should be a query string and method = GET', () => {
bidRequests.mediaType = 'banner';
bidRequests.params = bannerParams;
const request = spec.buildRequests([bidRequests], {'gdprConsent': {'consentString': 'BOJ/P2HOJ/P2HABABMAAAAAZ+A==', 'vendorData': {}, 'gdprApplies': true}});
expect(request[0].data).to.be.a('string');
expect(request[0].method).to.equal('GET');
});

it('video data should be a query string and method = GET', () => {
bidRequests.mediaType = 'video';
bidRequests.params = videoParams;
Expand Down

0 comments on commit 3e4d700

Please sign in to comment.