Skip to content

Commit

Permalink
Taboola Bid Adapter - support topics handling (#11139)
Browse files Browse the repository at this point in the history
* cookie-look-up-logic-fix-gpp-fix

* Append support for topics in taboolaPrebidAdapter

* test fix

---------

Co-authored-by: ahmadlob <109217988+ahmadlob@users.noreply.github.com>
Co-authored-by: Ahmad Lobany <ahmad.l@taboola.com>
  • Loading branch information
3 people authored Feb 26, 2024
1 parent 2a3b64f commit 1ecfe8e
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
5 changes: 4 additions & 1 deletion modules/taboolaBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,13 @@ function fillTaboolaReqData(bidderRequest, bidRequest, data) {
const {refererInfo, gdprConsent = {}, uspConsent} = bidderRequest;
const site = getSiteProperties(bidRequest.params, refererInfo, bidderRequest.ortb2);
const device = {ua: navigator.userAgent};
const user = {
let user = {
buyeruid: userData.getUserId(gdprConsent, uspConsent),
ext: {}
};
if (bidderRequest && bidderRequest.ortb2 && bidderRequest.ortb2.user) {
user.data = bidderRequest.ortb2.user.data;
}
const regs = {
coppa: 0,
ext: {}
Expand Down
3 changes: 3 additions & 0 deletions modules/topicsFpdModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ const bidderIframeList = {
}, {
bidder: 'onetag',
iframeURL: 'https://onetag-sys.com/static/topicsapi.html'
}, {
bidder: 'taboola',
iframeURL: 'https://cdn.taboola.com/libtrc/static/topics/taboola-prebid-browsing-topics.html'
}]
}

Expand Down
6 changes: 5 additions & 1 deletion modules/topicsFpdModule.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ pbjs.setConfig({
bidder: 'onetag',
iframeURL: 'https://onetag-sys.com/static/topicsapi.html',
expiry: 7 // Configurable expiry days
}, {
bidder: 'taboola',
iframeURL: 'https://cdn.taboola.com/libtrc/static/topics/taboola-prebid-browsing-topics.html',
expiry: 7 // Configurable expiry days
}]
}
....
Expand All @@ -71,4 +75,4 @@ pbjs.setConfig({
| topics.bidders | no | Array of objects | Array of topics callers with the iframe locations and other necessary informations like bidder(Bidder code) and expiry. Default Array of topics in the module itself.|
| topics.bidders[].bidder | yes | string | Bidder Code of the bidder(SSP). |
| topics.bidders[].iframeURL | yes | string | URL which is hosted on bidder/SSP/third-party domains which will call Topics API. |
| topics.bidders[].expiry | no | integer | Max number of days where Topics data will be persist. If Data is stored for more than mentioned expiry day, it will be deleted from storage. Default is 21 days which is hardcoded in Module. |
| topics.bidders[].expiry | no | integer | Max number of days where Topics data will be persist. If Data is stored for more than mentioned expiry day, it will be deleted from storage. Default is 21 days which is hardcoded in Module. |
24 changes: 24 additions & 0 deletions test/spec/modules/taboolaBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,30 @@ describe('Taboola Adapter', function () {
const res = spec.buildRequests([defaultBidRequest], bidderRequest);
expect(res.data.ext.example).to.deep.equal(bidderRequest.ortb2.ext.example);
});

it('should pass additional parameter in request for topics', function () {
const ortb2 = {
...commonBidderRequest,
ortb2: {
user: {
data: {
segment: [
{
id: '243'
}
],
name: 'pa.taboola.com',
ext: {
segclass: '4',
segtax: 601
}
}
}
}
}
const res = spec.buildRequests([defaultBidRequest], {...ortb2})
expect(res.data.user.data).to.deep.equal(ortb2.ortb2.user.data);
});
});

describe('handle privacy segments when building request', function () {
Expand Down

0 comments on commit 1ecfe8e

Please sign in to comment.