Skip to content

Commit

Permalink
Criteo Bid Adapter : Pass bid id through criteo bid adapter (#10336)
Browse files Browse the repository at this point in the history
Co-authored-by: v.raybaud <v.raybaud@criteo.com>
  • Loading branch information
vraybaud and v.raybaud authored Aug 9, 2023
1 parent f2fbcbe commit 55df5c9
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/criteoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ function buildCdbRequest(context, bidRequests, bidderRequest) {
networkId = bidRequest.params.networkId || networkId;
schain = bidRequest.schain || schain;
const slot = {
slotid: bidRequest.bidId,
impid: bidRequest.adUnitCode,
transactionid: bidRequest.ortb2Imp?.ext?.tid
};
Expand Down
27 changes: 27 additions & 0 deletions test/spec/modules/criteoBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,33 @@ describe('The Criteo bidding adapter', function () {
expect(ortbRequest.source.tid).to.equal('abc');
});

it('should properly transmit bidId if available', function () {
const bidderRequest = {
ortb2: {
source: {
tid: 'abc'
}
}
};
const bidRequests = [
{
bidId: 'bidId',
bidder: 'criteo',
adUnitCode: 'bid-123',
transactionId: 'transaction-123',
mediaTypes: {
banner: {
sizes: [[728, 90]]
}
},
params: {}
},
];
const request = spec.buildRequests(bidRequests, bidderRequest);
const ortbRequest = request.data;
expect(ortbRequest.slots[0].slotid).to.equal('bidId');
});

it('should properly build a request if refererInfo is not provided', function () {
const bidderRequest = {};
const bidRequests = [
Expand Down

0 comments on commit 55df5c9

Please sign in to comment.