Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Criteo bid adapter to send undefined GDPR consent fields instead of default false value when values are not defined #2630

Merged
merged 38 commits into from
May 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
b6534c4
Convert Criteo adapter to bidderFactory
Spark-NF Oct 11, 2017
1f7d0fa
Add documentation for Prebid 1.0 Criteo adapter
Spark-NF Oct 11, 2017
dc36bd3
Add support for zone-matching bids on Prebid 1.0 Criteo adapter
Spark-NF Oct 11, 2017
f780bc5
Add unit tests to the Prebid 1.0 Criteo adapter
Spark-NF Oct 11, 2017
dd664a7
Explicit the fact that Criteo bids are net revenue
Spark-NF Oct 12, 2017
85b65ed
Pass currency in Criteo 1.0 adapter
Spark-NF Nov 28, 2017
ae7b2ca
Update Criteo adapter to use PublisherTag if present
Spark-NF Nov 28, 2017
fa076c8
Implement fastbid in prebid 1.0 criteo adapter
ahubertcriteo Dec 1, 2017
761a203
Pass the bid requests to the Criteo interpret method
Spark-NF Dec 7, 2017
6a8ea52
Add missing ttl and creativeId fields to Criteo bids
Spark-NF Dec 7, 2017
d4ff98e
Add 'native' support to the Criteo adapter
Spark-NF Dec 7, 2017
b7d85e7
Check that the Criteo adapter returned by PublisherTag is not empty
Spark-NF Dec 11, 2017
675d3ea
Fix 'assign to const' IE errors in Criteo native adapter
Spark-NF Dec 12, 2017
ac73344
Update criteo prebid adapter to reload publisher tag once auction is
ahubertcriteo Dec 12, 2017
78b01ec
Disable the PublisherTag event queue
Spark-NF Jan 25, 2018
4bfa905
Fix Criteo adapter on older Prebid versions not using response.body
Spark-NF Jan 26, 2018
fa787ba
Fix TypeError if FastBid is outdated
Spark-NF Jan 29, 2018
1b1a191
Remove the success variable in tryGetCriteoFastBid
Spark-NF Jan 29, 2018
6e34a4c
Fix events being overwritten with FastBid
Spark-NF Jan 29, 2018
36dec3b
Update PublisherTag loading comment
Spark-NF Feb 1, 2018
14090c8
Use adUnitCode as impid
Spark-NF Feb 2, 2018
fc2f2ac
Add events handlers in Criteo adapter to fix timeouts not treated as …
Spark-NF Mar 19, 2018
de434bd
Add handler for setTargeting event
Spark-NF Mar 29, 2018
d62e9a5
Move the registeredEvents set higher up to reduce the chances of race…
Spark-NF Mar 29, 2018
5e3534f
Fix UTests following recent Criteo adapter changes
Spark-NF Apr 9, 2018
c64ac12
Add comment linking to the PublisherTag unminified source
Spark-NF Apr 10, 2018
e2df580
Do not return a request in buildRequests on error
Spark-NF Apr 19, 2018
6d81ed4
Use loadExternalScript instead of loadScript
Spark-NF Apr 26, 2018
ebf7dbc
Use spec.onTimeout instead of registering an event handler
Spark-NF Apr 26, 2018
5d7fdc4
GDPR support in Criteo adapter (#4)
ahubertcriteo May 2, 2018
167f09a
Remove BID_WON and SET_TARGETING events from Criteo adapter
Spark-NF May 3, 2018
5b9c1cd
Update adapter version
jsfaure May 16, 2018
47654b7
Add support for multi-size in Criteo adapter
Spark-NF May 21, 2018
dcea248
Fix support for multi size in Criteo adapter
jsfaure May 23, 2018
597d8f7
Update adapterVersion to 7
jsfaure May 24, 2018
0a1843d
GDPR support criteo: send undefined gdpr consent fields instead of false
ahubertcriteo May 25, 2018
46aecfd
Merge remote-tracking branch 'upstream/master' into criteo-1.0
ahubertcriteo May 25, 2018
b68f824
Update adapterVersion to 8
jsfaure May 25, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions modules/criteoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { parse } from 'src/url';
import * as utils from 'src/utils';
import find from 'core-js/library/fn/array/find';

const ADAPTER_VERSION = 7;
const ADAPTER_VERSION = 8;
const BIDDER_CODE = 'criteo';
const CDB_ENDPOINT = '//bidder.criteo.com/cdb';
const CRITEO_VENDOR_ID = 91;
Expand Down Expand Up @@ -208,12 +208,17 @@ function buildCdbRequest(context, bidRequests, bidderRequest) {
request.publisher.networkid = networkId;
}
if (bidderRequest && bidderRequest.gdprConsent) {
request.gdprConsent = {
gdprApplies: !!(bidderRequest.gdprConsent.gdprApplies),
consentData: bidderRequest.gdprConsent.consentString,
consentGiven: !!(bidderRequest.gdprConsent.vendorData && bidderRequest.gdprConsent.vendorData.vendorConsents &&
bidderRequest.gdprConsent.vendorData.vendorConsents[ CRITEO_VENDOR_ID.toString(10) ]),
};
request.gdprConsent = {};
if (typeof bidderRequest.gdprConsent.gdprApplies !== 'undefined') {
request.gdprConsent.gdprApplies = !!(bidderRequest.gdprConsent.gdprApplies);
}
if (bidderRequest.gdprConsent.vendorData && bidderRequest.gdprConsent.vendorData.vendorConsents &&
typeof bidderRequest.gdprConsent.vendorData.vendorConsents[ CRITEO_VENDOR_ID.toString(10) ] !== 'undefined') {
request.gdprConsent.consentGiven = !!(bidderRequest.gdprConsent.vendorData.vendorConsents[ CRITEO_VENDOR_ID.toString(10) ]);
}
if (typeof bidderRequest.gdprConsent.consentString !== 'undefined') {
request.gdprConsent.consentData = bidderRequest.gdprConsent.consentString;
}
}
return request;
}
Expand Down
25 changes: 24 additions & 1 deletion test/spec/modules/criteoBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ describe('The Criteo bidding adapter', () => {
expect(ortbRequest.slots[0].sizes[1]).to.equal('728x90');
expect(ortbRequest.gdprConsent.consentData).to.equal(undefined);
expect(ortbRequest.gdprConsent.gdprApplies).to.equal(false);
expect(ortbRequest.gdprConsent.consentGiven).to.equal(false);
expect(ortbRequest.gdprConsent.consentGiven).to.equal(undefined);
});

it('should properly build a mixed request', () => {
Expand Down Expand Up @@ -169,6 +169,29 @@ describe('The Criteo bidding adapter', () => {
expect(ortbRequest.slots[1].sizes[1]).to.equal('728x90');
expect(ortbRequest.gdprConsent).to.equal(undefined);
});

it('should properly build request with undefined gdpr consent fields when they are not provided', () => {
const bidRequests = [
{
bidder: 'criteo',
adUnitCode: 'bid-123',
transactionId: 'transaction-123',
sizes: [[728, 90]],
params: {
zoneId: 123,
},
},
];
const bidderRequest = { timeout: 3000,
gdprConsent: {
},
};

const ortbRequest = spec.buildRequests(bidRequests, bidderRequest).data;
expect(ortbRequest.gdprConsent.consentData).to.equal(undefined);
expect(ortbRequest.gdprConsent.gdprApplies).to.equal(undefined);
expect(ortbRequest.gdprConsent.consentGiven).to.equal(undefined);
});
});

describe('interpretResponse', () => {
Expand Down