Skip to content

Rubicon Bid Adapter : added support for IAB segtax 7 in Rubicon bid adapter #12794

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

Merged
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
2 changes: 1 addition & 1 deletion modules/rubiconBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,7 @@ function applyFPD(bidRequest, mediaType, data) {

const gpid = deepAccess(bidRequest, 'ortb2Imp.ext.gpid');
const dsa = deepAccess(fpd, 'regs.ext.dsa');
const SEGTAX = {user: [4], site: [1, 2, 5, 6]};
const SEGTAX = {user: [4], site: [1, 2, 5, 6, 7]};
const MAP = {user: 'tg_v.', site: 'tg_i.', adserver: 'tg_i.dfp_ad_unit_code', pbadslot: 'tg_i.pbadslot', keywords: 'kw'};
const validate = function(prop, key, parentName) {
if (key === 'data' && Array.isArray(prop)) {
Expand Down
23 changes: 23 additions & 0 deletions test/spec/modules/rubiconBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2916,6 +2916,29 @@ describe('the rubicon adapter', function () {
expect(slotParams['tg_v.tax404']).is.equal(undefined);
});

it('should support IAB segtax 7 in site segments', () => {
const localBidderRequest = Object.assign({}, bidderRequest);
localBidderRequest.refererInfo = {domain: 'bob'};
config.setConfig({
rubicon: {
sendUserSegtax: [4],
sendSiteSegtax: [1, 2, 5, 6, 7]
}
});
localBidderRequest.ortb2.site = {
content: {
data: [{
ext: {
segtax: '7'
},
segment: [{id: 8}, {id: 9}]
}]
}
};
const slotParams = spec.createSlotParams(bidderRequest.bids[0], localBidderRequest);
expect(slotParams['tg_i.tax7']).to.equal('8,9');
});

it('should add p_site.mobile if mobile is a number in ortb2.site', function () {
// Set up a bidRequest with mobile property as a number
const localBidderRequest = Object.assign({}, bidderRequest);
Expand Down