Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Taboola Bid Adapter - support topics & SDA handling #11139

Merged
merged 8 commits into from
Feb 26, 2024
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