Skip to content

Commit 4fc72b3

Browse files
apukh-magnitekiho-shige
authored andcommitted
Added support for IAB segtax 7 in Rubicon bid adapter; Added unit test to verify segtax 7 functionality (prebid#12794)
1 parent 9f90e1e commit 4fc72b3

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

modules/rubiconBidAdapter.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@ function applyFPD(bidRequest, mediaType, data) {
922922

923923
const gpid = deepAccess(bidRequest, 'ortb2Imp.ext.gpid');
924924
const dsa = deepAccess(fpd, 'regs.ext.dsa');
925-
const SEGTAX = {user: [4], site: [1, 2, 5, 6]};
925+
const SEGTAX = {user: [4], site: [1, 2, 5, 6, 7]};
926926
const MAP = {user: 'tg_v.', site: 'tg_i.', adserver: 'tg_i.dfp_ad_unit_code', pbadslot: 'tg_i.pbadslot', keywords: 'kw'};
927927
const validate = function(prop, key, parentName) {
928928
if (key === 'data' && Array.isArray(prop)) {

test/spec/modules/rubiconBidAdapter_spec.js

+23
Original file line numberDiff line numberDiff line change
@@ -2916,6 +2916,29 @@ describe('the rubicon adapter', function () {
29162916
expect(slotParams['tg_v.tax404']).is.equal(undefined);
29172917
});
29182918

2919+
it('should support IAB segtax 7 in site segments', () => {
2920+
const localBidderRequest = Object.assign({}, bidderRequest);
2921+
localBidderRequest.refererInfo = {domain: 'bob'};
2922+
config.setConfig({
2923+
rubicon: {
2924+
sendUserSegtax: [4],
2925+
sendSiteSegtax: [1, 2, 5, 6, 7]
2926+
}
2927+
});
2928+
localBidderRequest.ortb2.site = {
2929+
content: {
2930+
data: [{
2931+
ext: {
2932+
segtax: '7'
2933+
},
2934+
segment: [{id: 8}, {id: 9}]
2935+
}]
2936+
}
2937+
};
2938+
const slotParams = spec.createSlotParams(bidderRequest.bids[0], localBidderRequest);
2939+
expect(slotParams['tg_i.tax7']).to.equal('8,9');
2940+
});
2941+
29192942
it('should add p_site.mobile if mobile is a number in ortb2.site', function () {
29202943
// Set up a bidRequest with mobile property as a number
29212944
const localBidderRequest = Object.assign({}, bidderRequest);

0 commit comments

Comments
 (0)