Skip to content

Commit

Permalink
AdYouLike bidder adapter support us privacy (prebid#4708)
Browse files Browse the repository at this point in the history
* Remove useless bidderCode in bid response

* send all the available sizes in the bid request

* Use the banner sizes if given

* avoid compatibility issue with old bid format

* add uspConsent management with associated unit test
  • Loading branch information
guiann authored and audiencerun committed Jan 20, 2020
1 parent 3535c23 commit e2f1de9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
4 changes: 4 additions & 0 deletions modules/adyoulikeBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ export const spec = {
};
}

if (bidderRequest && bidderRequest.uspConsent) {
payload.uspConsent = bidderRequest.uspConsent;
}

const data = JSON.stringify(payload);
const options = {
withCredentials: true
Expand Down
16 changes: 15 additions & 1 deletion test/spec/modules/adyoulikeBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,20 @@ describe('Adyoulike Adapter', function () {
canonicalQuery.restore();
});

it('should add gdpr consent information to the request', function () {
it('should add gdpr/usp consent information to the request', function () {
let consentString = 'BOJ8RZsOJ8RZsABAB8AAAAAZ+A==';
let uspConsentData = '1YCC';
let bidderRequest = {
'auctionId': '1d1a030790a475',
'bidderRequestId': '22edbae2733bf6',
'timeout': 3000,
'gdprConsent': {
consentString: consentString,
gdprApplies: true
},
'uspConsent': uspConsentData
};

bidderRequest.bids = bidRequestWithSinglePlacement;

const request = spec.buildRequests(bidRequestWithSinglePlacement, bidderRequest);
Expand All @@ -260,6 +273,7 @@ describe('Adyoulike Adapter', function () {
expect(payload.gdprConsent).to.exist;
expect(payload.gdprConsent.consentString).to.exist.and.to.equal(consentString);
expect(payload.gdprConsent.consentRequired).to.exist.and.to.be.true;
expect(payload.uspConsent).to.exist.and.to.equal(uspConsentData);
});

it('sends bid request to endpoint with single placement', function () {
Expand Down

0 comments on commit e2f1de9

Please sign in to comment.