Skip to content

Commit

Permalink
Criteo Bid Adapter: Add missing tmax along the request send to backend (
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardlabat authored Apr 30, 2024
1 parent 51532c6 commit a6aba0e
Show file tree
Hide file tree
Showing 2 changed files with 20 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 @@ -674,6 +674,7 @@ function buildCdbRequest(context, bidRequests, bidderRequest) {
if (bidderRequest && bidderRequest.ortb2?.bapp) {
request.bapp = bidderRequest.ortb2.bapp;
}
request.tmax = bidderRequest.timeout;
return request;
}

Expand Down
19 changes: 19 additions & 0 deletions test/spec/modules/criteoBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,25 @@ describe('The Criteo bidding adapter', function () {
expect(ortbRequest.source.tid).to.equal('abc');
});

it('should properly transmit tmax if available', function () {
const bidRequests = [
{
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.tmax).to.equal(bidderRequest.timeout);
});

it('should properly transmit bidId if available', function () {
const bidderRequest = {
ortb2: {
Expand Down

0 comments on commit a6aba0e

Please sign in to comment.