Skip to content

Commit

Permalink
SChain support (prebid#5272)
Browse files Browse the repository at this point in the history
* Livewrapped bid and analytics adapter

* Fixed some tests for browser compatibility

* Fixed some tests for browser compatibility

* Changed analytics adapter code name

* Fix double quote in debug message

* modified how gdpr is being passed

* Added support for Publisher Common ID Module

* Corrections for ttr in analytics

* ANalytics updates

* Auction start time stamp changed

* Detect recovered ad blocked requests
Make it possible to pass dynamic parameters to adapter

* Collect info on ad units receiving any valid bid

* Support for ID5
Pass metadata from adapter

* Typo in test + eids on wrong level

* Fix for Prebid 3.0

* Fix get referer

* http -> https in tests

* Native support

* Read sizes from mediatype.banner

* Revert accidental commit

* Support native data collection + minor refactorings

* Set analytics endpoint

* Support for app parameters

* Fix issue where adunits with bids were not counted on reload

* Send debug info from adapter to external debugger

* SChain support
  • Loading branch information
bjorn-lw authored and iggyfisk committed Jun 22, 2020
1 parent d9998e9 commit 55d6b40
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/livewrappedBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export const spec = {
const ifa = find(bidRequests, hasIfaParam);
const bundle = find(bidRequests, hasBundleParam);
const tid = find(bidRequests, hasTidParam);
const schain = bidRequests[0].schain;
bidUrl = bidUrl ? bidUrl.params.bidUrl : URL;
url = url ? url.params.url : (getAppDomain() || getTopWindowLocation(bidderRequest));
test = test ? test.params.test : undefined;
Expand All @@ -82,7 +83,8 @@ export const spec = {
cookieSupport: !utils.isSafariBrowser() && storage.cookiesAreEnabled(),
rcv: getAdblockerRecovered(),
adRequests: [...adRequests],
rtbData: handleEids(bidRequests)
rtbData: handleEids(bidRequests),
schain: schain
};

if (config.getConfig().debug) {
Expand Down
25 changes: 25 additions & 0 deletions test/spec/modules/livewrappedBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,31 @@ describe('Livewrapped adapter tests', function () {
}]);
});

it('should send schain object if available', function() {
sandbox.stub(utils, 'isSafariBrowser').callsFake(() => false);
sandbox.stub(storage, 'cookiesAreEnabled').callsFake(() => true);
let testbidRequest = clone(bidderRequest);
let schain = {
'ver': '1.0',
'complete': 1,
'nodes': [
{
'asi': 'directseller.com',
'sid': '00001',
'rid': 'BidRequest1',
'hp': 1
}
]
};

testbidRequest.bids[0].schain = schain;

let result = spec.buildRequests(testbidRequest.bids, testbidRequest);
let data = JSON.parse(result.data);

expect(data.schain).to.deep.equal(schain);
});

describe('interpretResponse', function () {
it('should handle single success response', function() {
let lwResponse = {
Expand Down

0 comments on commit 55d6b40

Please sign in to comment.