Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 2 additions & 3 deletions modules/taboolaBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ function getBid(requestId, currency, bidResponse) {
}

const {
price: cpm, crid: creativeId, adm: ad, w: width, h: height, adomain: advertiserDomains, meta = {}
price: cpm, crid: creativeId, adm: ad, w: width, h: height, exp: ttl, adomain: advertiserDomains, meta = {}
} = bidResponse;

if (advertiserDomains && advertiserDomains.length > 0) {
Expand All @@ -233,7 +233,7 @@ function getBid(requestId, currency, bidResponse) {

return {
requestId,
ttl: 60,
ttl,
mediaType: BANNER,
cpm,
creativeId,
Expand All @@ -245,5 +245,4 @@ function getBid(requestId, currency, bidResponse) {
netRevenue: false
};
}

registerBidder(spec);
26 changes: 26 additions & 0 deletions test/spec/modules/taboolaBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ describe('Taboola Adapter', function () {
'crid': '278195503434041083381',
'w': 300,
'h': 250,
'exp': 60,
'lurl': 'http://us-trc.taboola.com/sample'
}
],
Expand Down Expand Up @@ -386,6 +387,31 @@ describe('Taboola Adapter', function () {
const res = spec.interpretResponse(serverResponse, request)
expect(res).to.deep.equal(expectedRes)
});

it('should set the correct ttl form the response', function () {
// set exp-ttl to be 125
const [bid] = serverResponse.body.seatbid[0].bid;
serverResponse.body.seatbid[0].bid[0].exp = 125
const expectedRes = [
{
requestId: request.bids[0].bidId,
cpm: bid.price,
creativeId: bid.crid,
ttl: 125,
netRevenue: false,
currency: serverResponse.body.cur,
mediaType: 'banner',
ad: bid.adm,
width: bid.w,
height: bid.h,
meta: {
'advertiserDomains': bid.adomain
},
}
]
const res = spec.interpretResponse(serverResponse, request)
expect(res).to.deep.equal(expectedRes)
});
})

describe('userData', function () {
Expand Down