Skip to content

Commit

Permalink
Jixie Bid Adapter: add schain (prebid#8439)
Browse files Browse the repository at this point in the history
* Adapter does not seem capable of supporting advertiserDomains prebid#6650
added response comment and some trivial code.

* removed a blank line at the end of file
added a space behind the // in comments

* in response to comment from reviewer. add the aspect of advertiserdomain in unit tests

* added the code to get the keywords from the meta tags if available.

* jixie sending schain info to jixie backend

* support of schain info sent to jixie endpoint, fixing some indentation complaints from auto build check
  • Loading branch information
jxdeveloper1 authored and renebaudisch committed Jun 28, 2022
1 parent 1f9b6ab commit 26380c1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/jixieBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ export const spec = {
let ids = fetchIds_();
let eids = [];
let miscDims = internal.getMiscDims();
let schain = deepAccess(validBidRequests[0], 'schain');

// all available user ids are sent to our backend in the standard array layout:
if (validBidRequests[0].userId) {
Expand All @@ -209,6 +210,7 @@ export const spec = {
mkeywords: miscDims.mkeywords,
bids: bids,
eids: eids,
schain: schain,
pricegranularity: pg,
cfg: jixieCfgBlob
}, ids);
Expand Down
17 changes: 17 additions & 0 deletions test/spec/modules/jixieBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,23 @@ describe('jixie Adapter', function () {
expect(payload.device).to.deep.include(content);
});

it('schain info should be accessible when available', function () {
const schain = {
ver: '1.0',
complete: 1,
nodes: [{
asi: 'ssp.test',
sid: '00001',
hp: 1
}]
};
const oneSpecialBidReq = Object.assign({}, bidRequests_[0], { schain: schain });
const request = spec.buildRequests([oneSpecialBidReq], bidderRequest_);
const payload = JSON.parse(request.data);
expect(payload.schain).to.deep.equal(schain);
expect(payload.schain).to.deep.include(schain);
});

it('should populate eids when supported userIds are available', function () {
const oneSpecialBidReq = Object.assign({}, bidRequests_[0], {
userId: {
Expand Down

0 comments on commit 26380c1

Please sign in to comment.