Skip to content

Commit

Permalink
simplified the approach in adpater code
Browse files Browse the repository at this point in the history
  • Loading branch information
pm-harshad-mane committed Aug 14, 2019
1 parent f73d4c1 commit b7fa658
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions modules/pubmaticBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ export const spec = {
var dctrArr = [];
var bid;
var blockedIabCategories = [];
let schainConfig;

validBidRequests.forEach(originalBid => {
bid = utils.deepClone(originalBid);
bid.params.adSlot = bid.params.adSlot || '';
Expand Down Expand Up @@ -849,7 +849,6 @@ export const spec = {
if (impObj) {
payload.imp.push(impObj);
}
schainConfig = schainConfig || bid.schain;
});

if (payload.imp.length == 0) {
Expand All @@ -873,10 +872,12 @@ export const spec = {
payload.device.geo = payload.user.geo;
payload.site.page = conf.kadpageurl.trim() || payload.site.page.trim();
payload.site.domain = _getDomainFromURL(payload.site.page);
if (schainConfig) {

// adding schain object
if (validBidRequests[0].schain) {
payload.source = {
ext: {
schain: schainConfig
schain: validBidRequests[0].schain
}
};
}
Expand Down

0 comments on commit b7fa658

Please sign in to comment.