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

Support fpd #21

Closed
wants to merge 4 commits into from
Closed
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
11 changes: 4 additions & 7 deletions modules/taboolaBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,20 +106,17 @@ export const spec = {
regs.coppa = 1;
}

const ortb2 = bidderRequest.ortb2 || {
badv: [],
bcat: []
};

const ortb2 = bidderRequest.ortb2;
const request = {
id: bidderRequest.auctionId,
imp: imps,
site,
device,
source: {fd: 1},
tmax: bidderRequest.timeout,
bcat: ortb2.bcat,
badv: ortb2.badv,
bcat: ortb2.bcat || bidRequest.params.bcat || [],
badv: ortb2.badv || bidRequest.params.badv || [],
wlang: ortb2.wlang || bidRequest.params.wlang || [],
user,
regs
};
Expand Down
19 changes: 19 additions & 0 deletions test/spec/modules/taboolaBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ describe('Taboola Adapter', function () {
'source': {'fd': 1},
'bcat': [],
'badv': [],
'wlang': [],
'user': {
'buyeruid': 0,
'ext': {},
Expand Down Expand Up @@ -216,6 +217,24 @@ describe('Taboola Adapter', function () {
expect(resData.tmax).to.equal(500);
});

describe('first party data', function () {
it('should parse first party data', function () {
const bidderRequest = {
...commonBidderRequest,
ortb2: {
bcat: ['EX1', 'EX2', 'EX3'],
badv: ['site.com'],
wlang: ['de'],
}
}
const res = spec.buildRequests([defaultBidRequest], bidderRequest);
const resData = JSON.parse(res.data);
expect(resData.bcat).to.deep.equal(bidderRequest.ortb2.bcat)
expect(resData.badv).to.deep.equal(bidderRequest.ortb2.badv)
expect(resData.wlang).to.deep.equal(bidderRequest.ortb2.wlang)
});
});

describe('handle privacy segments when building request', function () {
it('should pass GDPR consent', function () {
const bidderRequest = {
Expand Down