Skip to content

Commit

Permalink
Richaudience Bid Adapter: add schain to endpoint payload (prebid#7893)
Browse files Browse the repository at this point in the history
Co-authored-by: sgimenez <sergi.gimenez@richaudience.com>
  • Loading branch information
2 people authored and Chris Pabst committed Jan 10, 2022
1 parent 3d10ef8 commit c41a74f
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 2 deletions.
5 changes: 3 additions & 2 deletions modules/richaudienceBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isEmpty, deepAccess, isStr } from '../src/utils.js';
import {isEmpty, deepAccess, isStr} from '../src/utils.js';
import {registerBidder} from '../src/adapters/bidderFactory.js';
import {config} from '../src/config.js';
import {BANNER, VIDEO} from '../src/mediaTypes.js';
Expand Down Expand Up @@ -52,7 +52,8 @@ export const spec = {
videoData: raiGetVideoInfo(bid),
scr_rsl: raiGetResolution(),
cpuc: (typeof window.navigator != 'undefined' ? window.navigator.hardwareConcurrency : null),
kws: (!isEmpty(bid.params.keywords) ? bid.params.keywords : null)
kws: (!isEmpty(bid.params.keywords) ? bid.params.keywords : null),
schain: bid.schain
};

REFERER = (typeof bidderRequest.refererInfo.referer != 'undefined' ? encodeURIComponent(bidderRequest.refererInfo.referer) : null)
Expand Down
40 changes: 40 additions & 0 deletions test/spec/modules/richaudienceBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,46 @@ describe('Richaudience adapter tests', function () {
})).to.equal(true);
});

it('should pass schain', function() {
let schain = {
'ver': '1.0',
'complete': 1,
'nodes': [{
'asi': 'richaudience.com',
'sid': '00001',
'hp': 1
}, {
'asi': 'richaudience-2.com',
'sid': '00002',
'hp': 1
}]
}

DEFAULT_PARAMS_NEW_SIZES[0].schain = {
'ver': '1.0',
'complete': 1,
'nodes': [{
'asi': 'richaudience.com',
'sid': '00001',
'hp': 1
}, {
'asi': 'richaudience-2.com',
'sid': '00002',
'hp': 1
}]
}

const request = spec.buildRequests(DEFAULT_PARAMS_NEW_SIZES, {
gdprConsent: {
consentString: 'BOZcQl_ObPFjWAeABAESCD-AAAAjx7_______9______9uz_Ov_v_f__33e8__9v_l_7_-___u_-33d4-_1vf99yfm1-7ftr3tp_87ues2_Xur__59__3z3_NohBgA',
gdprApplies: true
},
refererInfo: {}
})
const requestContent = JSON.parse(request[0].data);
expect(requestContent).to.have.property('schain').to.deep.equal(schain);
})

describe('userSync', function () {
it('Verifies user syncs iframe include', function () {
config.setConfig({
Expand Down

0 comments on commit c41a74f

Please sign in to comment.