Skip to content

Commit

Permalink
Inskin Bid Adapter: override schain with publisher id (prebid#7444)
Browse files Browse the repository at this point in the history
* Set publisher ID as schain id

* Updated Inskin markdown file
  • Loading branch information
cciocov authored Sep 23, 2021
1 parent 6ab27bd commit b2577b7
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
12 changes: 12 additions & 0 deletions modules/inskinBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,18 @@ export const spec = {
parallel: true
}, validBidRequests[0].params);

if (data.publisherId) {
data.rtb = {
schain: {
ext: {
sid: String(data.publisherId)
}
}
};

delete data.publisherId;
}

data.keywords = data.keywords || [];
const restrictions = [];

Expand Down
9 changes: 5 additions & 4 deletions modules/inskinBidAdapter.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Overview

Module Name: InSkin Bid Adapter
Module Name: Inskin Bid Adapter

Module Type: Bid Adapter

Maintainer: jgrimes@adzerk.com
Maintainer: tech@inskinmedia.com

# Description

Connects to InSkin Media for receiving bids from configured demand sources.
Connects to Inskin Media for receiving bids from configured demand sources.

# Test Parameters
```javascript
Expand All @@ -21,7 +21,8 @@ Connects to InSkin Media for receiving bids from configured demand sources.
bidder: 'inskin',
params: {
networkId: '9874',
siteId: '983808'
siteId: '983808',
publisherId: '123456'
}
}
]
Expand Down
11 changes: 10 additions & 1 deletion test/spec/modules/inskinBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ const REQUEST = {
'bidder': 'inskin',
'params': {
'networkId': 9874,
'siteId': 730181
'siteId': 730181,
'publisherId': 123456
},
'placementCode': 'div-gpt-ad-1487778092495-0',
'sizes': [
Expand Down Expand Up @@ -374,4 +375,12 @@ describe('InSkin BidAdapter', function () {
expect(opts.length).to.equal(3);
});
});
describe('supply chain id', function () {
it('should use publisherId as sid', function () {
const request = spec.buildRequests(REQUEST.bidRequest, bidderRequest);
const payload = JSON.parse(request.data);

expect(payload.rtb.schain.ext.sid).to.equal('123456');
});
});
});

0 comments on commit b2577b7

Please sign in to comment.