From b532636d80f2f4c287573823c78cc061ae98712d Mon Sep 17 00:00:00 2001 From: Tal Avital Date: Wed, 26 Nov 2025 15:07:09 +0200 Subject: [PATCH 1/3] add deferredBilling support using onBidBillable --- modules/taboolaBidAdapter.js | 10 ++- test/spec/modules/taboolaBidAdapter_spec.js | 83 +++++++++++++++++++++ 2 files changed, 92 insertions(+), 1 deletion(-) diff --git a/modules/taboolaBidAdapter.js b/modules/taboolaBidAdapter.js index dda4694a52c..13e42a4eacd 100644 --- a/modules/taboolaBidAdapter.js +++ b/modules/taboolaBidAdapter.js @@ -114,6 +114,7 @@ const converter = ortbConverter({ bidResponse(buildBidResponse, bid, context) { const bidResponse = buildBidResponse(bid, context); bidResponse.nurl = bid.nurl; + bidResponse.burl = bid.burl; bidResponse.ad = replaceAuctionPrice(bid.adm, bid.price); if (bid.ext && bid.ext.dchain) { deepSetValue(bidResponse, 'meta.dchain', bid.ext.dchain); @@ -212,11 +213,18 @@ export const spec = { return bids; }, onBidWon: (bid) => { - if (bid.nurl) { + if (bid.nurl && !bid.deferBilling) { const resolvedNurl = replaceAuctionPrice(bid.nurl, bid.originalCpm); ajax(resolvedNurl); } }, + onBidBillable: (bid) => { + const billingUrl = bid.burl || bid.nurl; + if (billingUrl) { + const resolvedBillingUrl = replaceAuctionPrice(billingUrl, bid.originalCpm); + ajax(resolvedBillingUrl); + } + }, getUserSyncs: function(syncOptions, serverResponses, gdprConsent, uspConsent, gppConsent) { const syncs = [] const queryParams = []; diff --git a/test/spec/modules/taboolaBidAdapter_spec.js b/test/spec/modules/taboolaBidAdapter_spec.js index 8219ec3e8e2..9c06d717a04 100644 --- a/test/spec/modules/taboolaBidAdapter_spec.js +++ b/test/spec/modules/taboolaBidAdapter_spec.js @@ -116,6 +116,89 @@ describe('Taboola Adapter', function () { spec.onBidWon(bid); expect(server.requests[0].url).to.equals('http://win.example.com/3.4') }); + + it('should not fire nurl when deferBilling is true', function () { + const nurl = 'http://win.example.com/${AUCTION_PRICE}'; + const bid = { + requestId: 1, + cpm: 2, + originalCpm: 3.4, + creativeId: 1, + ttl: 60, + netRevenue: true, + mediaType: 'banner', + ad: '...', + width: 300, + height: 250, + nurl: nurl, + deferBilling: true + } + spec.onBidWon(bid); + expect(server.requests.length).to.equal(0); + }); + }); + + describe('onBidBillable', function () { + it('onBidBillable exist as a function', () => { + expect(spec.onBidBillable).to.exist.and.to.be.a('function'); + }); + + it('should fire burl when available', function () { + const burl = 'http://billing.example.com/${AUCTION_PRICE}'; + const nurl = 'http://win.example.com/${AUCTION_PRICE}'; + const bid = { + requestId: 1, + cpm: 2, + originalCpm: 3.4, + creativeId: 1, + ttl: 60, + netRevenue: true, + mediaType: 'banner', + ad: '...', + width: 300, + height: 250, + nurl: nurl, + burl: burl + } + spec.onBidBillable(bid); + expect(server.requests[0].url).to.equals('http://billing.example.com/3.4'); + }); + + it('should fall back to nurl when burl is not available', function () { + const nurl = 'http://win.example.com/${AUCTION_PRICE}'; + const bid = { + requestId: 1, + cpm: 2, + originalCpm: 3.4, + creativeId: 1, + ttl: 60, + netRevenue: true, + mediaType: 'banner', + ad: '...', + width: 300, + height: 250, + nurl: nurl + } + spec.onBidBillable(bid); + expect(server.requests[0].url).to.equals('http://win.example.com/3.4'); + }); + + it('should not fire anything when neither burl nor nurl is available', function () { + const bid = { + requestId: 1, + cpm: 2, + originalCpm: 3.4, + creativeId: 1, + ttl: 60, + netRevenue: true, + mediaType: 'banner', + ad: '...', + width: 300, + height: 250 + } + spec.onBidBillable(bid); + expect(server.requests.length).to.equal(0); + }); }); describe('onTimeout', function () { From a0ffb60c1fa4b3ace9c4c7faf5ded651cb52effb Mon Sep 17 00:00:00 2001 From: Tal Avital Date: Thu, 27 Nov 2025 15:00:40 +0200 Subject: [PATCH 2/3] update burl setting --- modules/taboolaBidAdapter.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/taboolaBidAdapter.js b/modules/taboolaBidAdapter.js index 13e42a4eacd..efbb81453a6 100644 --- a/modules/taboolaBidAdapter.js +++ b/modules/taboolaBidAdapter.js @@ -114,7 +114,9 @@ const converter = ortbConverter({ bidResponse(buildBidResponse, bid, context) { const bidResponse = buildBidResponse(bid, context); bidResponse.nurl = bid.nurl; - bidResponse.burl = bid.burl; + if (bid.burl) { + bidResponse.burl = bid.burl; + } bidResponse.ad = replaceAuctionPrice(bid.adm, bid.price); if (bid.ext && bid.ext.dchain) { deepSetValue(bidResponse, 'meta.dchain', bid.ext.dchain); From 823951230d9c167d7fb8c34fa43fab321e18d7d2 Mon Sep 17 00:00:00 2001 From: Tal Avital Date: Thu, 4 Dec 2025 15:59:20 +0200 Subject: [PATCH 3/3] support nurl firing logic --- modules/taboolaBidAdapter.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/taboolaBidAdapter.js b/modules/taboolaBidAdapter.js index efbb81453a6..3e7127f1ab7 100644 --- a/modules/taboolaBidAdapter.js +++ b/modules/taboolaBidAdapter.js @@ -218,9 +218,13 @@ export const spec = { if (bid.nurl && !bid.deferBilling) { const resolvedNurl = replaceAuctionPrice(bid.nurl, bid.originalCpm); ajax(resolvedNurl); + bid.taboolaBillingFired = true; } }, onBidBillable: (bid) => { + if (bid.taboolaBillingFired) { + return; + } const billingUrl = bid.burl || bid.nurl; if (billingUrl) { const resolvedBillingUrl = replaceAuctionPrice(billingUrl, bid.originalCpm);